[issue41637] Calling with an infinite number of parameters is not detected

2020-08-30 Thread Camion


Camion  added the comment:

I understand all that. But the problem is that it should crash the program and 
not the interpreter.

--

___
Python tracker 

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



[issue41637] Calling with an infinite number of parameters is not detected

2020-08-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It does not differ much from list(inf()). Sooner or later it will raise 
MemoryError. You can interrupt the execution by pressing Ctrl-C. Although the 
response may be slow if your computer started swapping.

There is nothing special about unpacking infinite number of parameters. You can 
achieve the same result in many other ways in any programming language. If you 
want you program do not use too much swap, limit the virtual memory size by the 
shell ulimit command (or by resource.setrlimit() in Python).

--
nosy: +serhiy.storchaka
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue41637] Calling with an infinite number of parameters is not detected

2020-08-29 Thread Camion

Camion  added the comment:

Well, I know an infinite loop  is not necessarily wrong, especially in a 
generator. and I also know how to avoid this problem.
My problem is not there. It's just that I believe it should possibly crash the 
program and not the interpreter. 
I even wonder if being able to cause an interpreter crash couldn't become a 
security hole in some cases.probably the basic solution would be to forward an 
exception to the program if the interpreter running it gets an allocation error.

About core dump or crash report, it didn't generate one but I think I should 
install a few things on the computer to get it.

Le dimanche 30 août 2020 à 02:02:01 UTC+2, Terry J. Reedy 
 a écrit :  

Terry J. Reedy  added the comment:

On Windows, I get an indefinite hang rather than an overt crash with a crash 
box.  I believe that there was some swapping out to disk.  I got the same with 
list(itertools.count()). 

If you got a core dump or crash report, you might upload it.  

There is infinite looping in the argument collection but no infinite recursion 
(calling) here.  The latter is detected pretty quickly because of sys.recursion 
limit.  Infinite loops by themselves are not necessarily wrong.  This typing 
box is run by an infinite loop.  Change your 'use' to

def use(iter):
    for i in iter: print(i)

and there would be no problem.  So I disagree with 'should have been detected'. 
 I am only leaving this open in case you got an overt crash for this particular 
loop.  Those we try to fix.

--
nosy: +terry.reedy
title: Calling a function with an infinite number of parameters is not detected 
and crash the interpreter instead of causing an exception -> Calling with an 
infinite number of parameters is not detected
versions: +Python 3.9

___
Python tracker 

___

--

___
Python tracker 

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



[issue41637] Calling with an infinite number of parameters is not detected

2020-08-29 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

On Windows, I get an indefinite hang rather than an overt crash with a crash 
box.  I believe that there was some swapping out to disk.  I got the same with 
list(itertools.count()). 

If you got a core dump or crash report, you might upload it.  

There is infinite looping in the argument collection but no infinite recursion 
(calling) here.  The latter is detected pretty quickly because of sys.recursion 
limit.  Infinite loops by themselves are not necessarily wrong.  This typing 
box is run by an infinite loop.  Change your 'use' to

def use(iter):
for i in iter: print(i)

and there would be no problem.  So I disagree with 'should have been detected'. 
 I am only leaving this open in case you got an overt crash for this particular 
loop.  Those we try to fix.

--
nosy: +terry.reedy
title: Calling a function with an infinite number of parameters is not detected 
and crash the interpreter instead of causing an exception -> Calling with an 
infinite number of parameters is not detected
versions: +Python 3.9

___
Python tracker 

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