[issue28620] Build Memory Leak

2016-11-05 Thread Honor

New submission from Honor:

Hi,

I am compiling python from source code with clang compiler.

as follows result:

==5284==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 11776 byte(s) in 8 object(s) allocated from:
#0 0x49ccbe (/home/y/Downloads/Python-3.5.2/Parser/pgen+0x49ccbe)
#1 0x4c86ca (/home/y/Downloads/Python-3.5.2/Parser/pgen+0x4c86ca)

Indirect leak of 2000 byte(s) in 3 object(s) allocated from:
#0 0x49ccbe (/home/y/Downloads/Python-3.5.2/Parser/pgen+0x49ccbe)
#1 0x4c86ca (/home/y/Downloads/Python-3.5.2/Parser/pgen+0x4c86ca)

Indirect leak of 898 byte(s) in 86 object(s) allocated from:
#0 0x49c9cb (/home/y/Downloads/Python-3.5.2/Parser/pgen+0x49c9cb)
#1 0x2ad0d5405679 (/lib/x86_64-linux-gnu/libc.so.6+0x89679)

Indirect leak of 520 byte(s) in 1 object(s) allocated from:
#0 0x49c9cb (/home/y/Downloads/Python-3.5.2/Parser/pgen+0x49c9cb)
#1 0x4cb549 (/home/y/Downloads/Python-3.5.2/Parser/pgen+0x4cb549)

Indirect leak of 178 byte(s) in 33 object(s) allocated from:
#0 0x49c9cb (/home/y/Downloads/Python-3.5.2/Parser/pgen+0x49c9cb)
#1 0x4c14d4 (/home/y/Downloads/Python-3.5.2/Parser/pgen+0x4c14d4)

SUMMARY: AddressSanitizer: 15372 byte(s) leaked in 131 allocation(s).

Python version 3.5.2
Operating System: Linux y 3.13.0-24-generic  14.04 ubuntu
gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3)

--
messages: 280111
nosy: Stone
priority: normal
severity: normal
status: open
title: Build Memory Leak

___
Python tracker 
<http://bugs.python.org/issue28620>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28620] Build Memory Leak

2016-11-05 Thread Honor

Honor added the comment:

Hmmm, Ok. Thanks a lot.

On Sat, Nov 5, 2016 at 4:50 PM, Xiang Zhang  wrote:

>
> Xiang Zhang added the comment:
>
> This seems a same problem as in #27780.
>
> --
> nosy: +xiang.zhang
>
> ___
> Python tracker 
> <http://bugs.python.org/issue28620>
> ___
>

--

___
Python tracker 
<http://bugs.python.org/issue28620>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28633] eval() Function - Segmentation Fault

2016-11-07 Thread Honor

New submission from Honor:

Hello,

Python version : 3.7.0a0
OS : Ubunt - Linux x 3.13.0-24-generic

Test Script:

>>> a="B\'\'F\'\'"
>>> eval(a)
Program received signal SIGSEGV, Segmentation fault.
0x00531c5a in parsestrplus (n=0x77ee0b20, c=0x7fffd730) at
Python/ast.c:5150
5150Py_DECREF(s);
(gdb) info reg
rax0x0 0
rbx0x0 0
rcx0x77e9bab0 140737352678064
rdx0x0 0
rsi0x77e9ba88 140737352678024
rdi0x77f74670 140737353565808
rbp0x1 0x1
rsp0x7fffd350 0x7fffd350
r8 0x0 0
r9 0x7fffd328 140737488343848
r100x77e9bab0 140737352678064
r110x7fffd2e0 140737488343776
r120x77ee0b20 140737352960800
r130x7fffd730 140737488344880
r140x0 0
r150x77f8557a 140737353635194
rip0x531c5a 0x531c5a 
eflags 0x10246 [ PF ZF IF RF ]
cs 0x33 51
ss 0x2b 43
ds 0x0 0
es 0x0 0
fs 0x0 0
gs 0x0 0

(gdb) bt
#0  0x00531c5a in parsestrplus (n=0x77ee0b20, c=0x7fffd730)
at Python/ast.c:5150
#1  ast_for_atom (c=c@entry=0x7fffd730, n=0x77ee0b20) at
Python/ast.c:2110
#2  0x0053221a in ast_for_atom_expr (n=0x77ee0d78,
c=0x7fffd730) at Python/ast.c:2465
#3  ast_for_power (n=0x77ee0d50, c=0x7fffd730) at Python/ast.c:2502
#4  ast_for_expr (c=c@entry=0x7fffd730, n=0x77ee0d50) at
Python/ast.c:2690
#5  0x00537446 in ast_for_testlist (n=0x77e8f0d0,
c=0x7fffd730) at Python/ast.c:2881
#6  PyAST_FromNodeObject (n=0x77ee0ad0, n@entry=0x77ee0af8,
flags=,
filename=filename@entry=0x77e9be30, arena=arena@entry=0x77f751e0)
at Python/ast.c:815
#7  0x0042649f in PyParser_ASTFromStringObject
(arena=0x77f751e0, flags=, start=258,
filename=0x77e9be30, s=0x77e9be30 "\003") at
Python/pythonrun.c:1124
#8  PyRun_StringFlags (str=str@entry=0x77e9bae0 "B''F''",
start=start@entry=258,
globals=globals@entry=0x77f5d168, locals=locals@entry=0x77f5d168,
flags=flags@entry=0x7fffd840)
at Python/pythonrun.c:902
#9  0x0053a9fe in builtin_eval_impl (module=,
locals=0x77f5d168, globals=0x77f5d168,
source=0x77e9bab0) at Python/bltinmodule.c:875
#10 builtin_eval (module=, args=) at
Python/clinic/bltinmodule.c.h:243
#11 0x004a7869 in _PyCFunction_FastCallDict (kwargs=0x0, nargs=1,
args=0x53a8b0 ,
func_obj=0x77fda990) at Objects/methodobject.c:234
#12 _PyCFunction_FastCallKeywords (func=func@entry=0x77fda990,
stack=stack@entry=0x77fa2ca8, nargs=1,
kwnames=kwnames@entry=0x0) at Objects/methodobject.c:295
#13 0x0053c954 in call_function
(pp_stack=pp_stack@entry=0x7fffda50,
oparg=oparg@entry=1,
kwnames=kwnames@entry=0x0) at Python/ceval.c:4793
#14 0x0054032c in _PyEval_EvalFrameDefault (f=,
throwflag=)
at Python/ceval.c:3277
#15 0x0053c571 in PyEval_EvalFrameEx (throwflag=0,
f=0x77fa2b28) at Python/ceval.c:718
#16 _PyEval_EvalCodeWithName (_co=_co@entry=0x77ed7270,
globals=globals@entry=0x77f5d168,
locals=locals@entry=0x77f5d168, args=args@entry=0x0,
argcount=argcount@entry=0, kwnames=kwnames@entry=0x0,
kwargs=kwargs@entry=0x8, kwcount=kwcount@entry=0, kwstep=kwstep@entry=2,
defs=defs@entry=0x0,
defcount=defcount@entry=0, kwdefs=kwdefs@entry=0x0,
closure=closure@entry=0x0, name=name@entry=0x0,
qualname=qualname@entry=0x0) at Python/ceval.c:4121
#17 0x0053d380 in PyEval_EvalCodeEx (closure=0x0, kwdefs=0x0,
defcount=0, defs=0x0, kwcount=0, kws=0x0,
argcount=0, args=0x0, locals=locals@entry=0x77f5d168,
globals=globals@entry=0x77f5d168,
_co=_co@entry=0x77ed7270) at Python/ceval.c:4142
#18 PyEval_EvalCode (co=co@entry=0x77ed7270, globals=globals@entry
=0x77f5d168,
locals=locals@entry=0x77f5d168) at Python/ceval.c:695
#19 0x00427bc4 in run_mod (arena=0x77f75180,
flags=0x7fffdd40, locals=0x77f5d168,
globals=0x77f5d168, filename=0x77f14ae8, mod=0x936ab0) at
Python/pythonrun.c:980
#20 PyRun_InteractiveOneObject (fp=fp@entry=0x774a9640
<_IO_2_1_stdin_>,
filename=filename@entry=0x77f14ae8, flags=flags@entry=0x7fffdd40)
at Python/pythonrun.c:233
#21 0x00427e8e in PyRun_InteractiveLoopFlags
(fp=fp@entry=0x774a9640
<_IO_2_1_stdin_>,
filename_str=filename_str@entry=0x5d0f05 "",
flags=flags@entry=0x7fffdd40)
at Python/pythonrun.c:112
#22 0x00427f9c in PyRun_AnyFileExFlags (fp=0x774a9640
<_IO_2_1_stdin_>, filename=0x5d0f05 "",
closeit=0, flags=0x7fffdd40) at Python/pythonrun.c:74
#23 0x00439b31 in run_file (p_cf=0x7fffdd40, filename=0

[issue28633] eval() Function - Segmentation Fault

2016-11-07 Thread Honor

Honor added the comment:

Why not?

I have tested it.
Different payload : '%%-'%B'4--'F''
Again crashed.
Can you try?

On Mon, Nov 7, 2016 at 9:14 PM, Serhiy Storchaka 
wrote:

>
> Changes by Serhiy Storchaka :
>
>
> --
> nosy: +serhiy.storchaka
>
> ___
> Python tracker 
> <http://bugs.python.org/issue28633>
> ___
>

--

___
Python tracker 
<http://bugs.python.org/issue28633>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28633] Concatenating bytes literal and f-string causes segmentation fault

2016-11-07 Thread Honor

Honor added the comment:

Another:

>>> 9,'''Ðؚ%''(r'''%b''''"r'''''
  File "", line 1
SyntaxError: cannot mix bytes and nonbytes literals
>>> 9,'B''Ðؚ%''(r'''%b''''"r'''
Traceback (most recent call last):
  File "", line 1, in 
ValueError: incomplete format key
>>> 9,'B''Ðؚ%''(r'''%b''''"r'''F
  File "", line 1
9,'B''Ðؚ%''(r'''%b''''"r'''F
   ^
SyntaxError: invalid syntax
>>> 9,'B''Ðؚ%''(r'''%b''''"r'''F'
  File "", line 1
9,'B''Ðؚ%''(r'''%b''''"r'''F'
 ^
SyntaxError: EOL while scanning string literal
>>>

On Mon, Nov 7, 2016 at 10:08 PM, Eric V. Smith 
wrote:

>
> Eric V. Smith added the comment:
>
> Works:
>
> >>> f'' b''
>   File "", line 1
> SyntaxError: cannot mix bytes and nonbytes literals
>
> Fails:
>
> >>> b'' f''
> Segmentation fault
> $
>
> Regular strings work:
> >>> '' b''
>   File "", line 1
> SyntaxError: cannot mix bytes and nonbytes literals
> >>> b'' ''
>   File "", line 1
> SyntaxError: cannot mix bytes and nonbytes literals
> >>>
>
> --
>
> ___
> Python tracker 
> <http://bugs.python.org/issue28633>
> ___
>

--

___
Python tracker 
<http://bugs.python.org/issue28633>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28669] Math Library Dos Attack

2016-11-11 Thread Honor

New submission from Honor:

Hello EveryOne,

Payload : 12**62**6
Test script:

import math
math.log10(12**62**6)

Program is looping. I tested apache server and flask web framework.
Result:
Frozen in frost. Cpu usage : %90-99 , system runs but server shutdowns.

Author : Onur TAŞLIOĞLU

--
messages: 280590
nosy: Stone
priority: normal
severity: normal
status: open
title: Math Library Dos Attack

___
Python tracker 
<http://bugs.python.org/issue28669>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28669] Math Library Dos Attack

2016-11-11 Thread Honor

Honor added the comment:

Very very very long and the server unreachable all path.

On Fri, Nov 11, 2016 at 7:08 PM, Mark Dickinson 
wrote:

>
> Mark Dickinson added the comment:
>
> Please can you give more details about why you consider this a problem?
>
> Yes, some computations take a long time. I fail to see why this is an
> issue.
>
> --
> nosy: +mark.dickinson
>
> ___
> Python tracker 
> <http://bugs.python.org/issue28669>
> ___
>

--

___
Python tracker 
<http://bugs.python.org/issue28669>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28669] Math Library Dos Attack

2016-11-11 Thread Honor

Honor added the comment:

I will take a video on this subject.
Then I will say the end result.

Thanks a lot.

On Fri, Nov 11, 2016 at 7:27 PM, Mark Dickinson 
wrote:

>
> Mark Dickinson added the comment:
>
> Thanks. The solution here is "Don't do that, then." That is, don't allow
> this code to execute on your server in the first place.
>
> At a guess, you've got a multithreaded server that's executing the given
> code on one thread, while continuing to listen for connections on another.
> Now the problem is not only that the power computation takes a long time,
> but also that the slow part all happens in a single bytecode instruction,
> so the GIL never gets released while the power operation is in progress,
> and no other threads can run.
>
> In theory it might be possible to rework the power operation to release
> the GIL now and then, but even if we did that there are plenty of other
> examples in the language that are going to have a similar effect (running
> for a long time without releasing the GIL). Changing all those isn't
> particularly practical.
>
> IOW, I'm afraid this isn't a problem with the core Python language; it's a
> problem with how you're using it: you want to think very carefully before
> allowing arbitrary untrusted code to execute on your server (if that's what
> you're doing), for reasons exactly like this one.
>
> --
>
> ___
> Python tracker 
> <http://bugs.python.org/issue28669>
> ___
>

--

___
Python tracker 
<http://bugs.python.org/issue28669>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com