On 2/8/13 9:01 AM, William Stein wrote:
Hi,

I was working on percent modes in a notebook, and was surprised to
find that if I run this [1] little self-contained pure Python program
under the Python in Sage, I get "4242 Segmentation fault      (core
dumped) python "$@"".  Also, under my Linux system-wide python (and
python3), the program just spins forever until I press control-c, when
it seg faults.   I've always wondered if being able to completely
crash the Python interpreter from pure Python (not Cython or calling
into some C library, e.g., with C types) with a segfault is considered
a bug.

[1]
###################################
def h(s):
     return '%s^%s'%(s,s)

def g(s):
     print(eval(s))

def f(s):
     eval(s)

f('g(h(s))')
###################################



Also in python 3 on OS X (not in Sage; in a system install):

%python3 Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 01:25:11)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> def h(s):
...     return '%s^%s'%(s,s)
...
>>> def g(s):
...     print(eval(s))
...
>>> def f(s):
...     eval(s)
...
>>> f('g(h(s))')
zsh: segmentation fault  python3

-Jason


--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to