Re: how to debug when "Segmentation fault"

Discussion in 'Python' started by Michael Ekstrand, Oct 4, 2005.

  1. On Oct 4, 2005, at 2:08 PM, Jp Calderone wrote:
    > On Tue, 4 Oct 2005 11:22:24 -0500, Michael Ekstrand
    > <> wrote:
    >> I've never seen "stock" Python (stable release w/ only included
    >> modules)
    >> segfault, but did see a segfault with an extension module I was using
    >> the other week (lxml IIRC, but I'm not sure).
    >>

    >
    > exarkun@boson:~$ python
    > Python 2.4.2c1 (#2, Sep 24 2005, 00:48:19)
    > [GCC 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu8)] on linux2
    > Type "help", "copyright", "credits" or "license" for more information.
    >>>> import sys
    >>>> sys.setrecursionlimit(1e9)

    > __main__:1: DeprecationWarning: integer argument expected, got float
    >>>> (lambda f: f(f))(lambda f: f(f))

    > Segmentation fault
    > exarkun@boson:~$ python
    > Python 2.4.2c1 (#2, Sep 24 2005, 00:48:19)
    > [GCC 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu8)] on linux2
    > Type "help", "copyright", "credits" or "license" for more information.
    >>>> class foo(type):

    > ... def mro(self):
    > ... return [float]
    > ...
    >>>> class bar:

    > ... __metaclass__ = foo
    > ...
    > Segmentation fault
    > exarkun@boson:~$ python
    > Python 2.4.2c1 (#2, Sep 24 2005, 00:48:19)
    > [GCC 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu8)] on linux2
    > Type "help", "copyright", "credits" or "license" for more information.
    >>>> import dl
    >>>> dl.open('libc.so.6').call('memcpy', 0, 0, 1024)

    > Segmentation fault
    > exarkun@boson:~$


    I stand corrected.

    Except for the 2nd one, where I'm not quite sure what's going on, I'd
    say I have yet to see the Python interpreter crash when doing "normal"
    things not involving C esoteria (for some definition of normal not
    including setting the recursion limit to 1e9).

    Or maybe my total faith in Python to keep me from ever having to think
    about memory problems when doing high-level coding is misplaced, but
    I'd like to think not...

    - Michael
     
    Michael Ekstrand, Oct 4, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alex Hunsley
    Replies:
    17
    Views:
    896
  2. Pud
    Replies:
    0
    Views:
    608
  3. Replies:
    0
    Views:
    573
  4. Maksim Kasimov

    how to debug when "Segmentation fault"

    Maksim Kasimov, Oct 4, 2005, in forum: Python
    Replies:
    9
    Views:
    734
    Maksim Kasimov
    Oct 5, 2005
  5. Replies:
    3
    Views:
    475
Loading...

Share This Page