Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seg fault when calling unicode() on old style object in virtualenv #61462

Closed
johtso mannequin opened this issue Feb 20, 2013 · 5 comments
Closed

Seg fault when calling unicode() on old style object in virtualenv #61462

johtso mannequin opened this issue Feb 20, 2013 · 5 comments
Labels
topic-unicode type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@johtso
Copy link
Mannequin

johtso mannequin commented Feb 20, 2013

BPO 17260
Nosy @pitrou, @ned-deily, @ezio-melotti
Superseder
  • bpo-16839: segmentation fault when unicode(classic_class_instance)
  • Files
  • unicode-bug.py
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2013-02-21.02:33:36.238>
    created_at = <Date 2013-02-20.22:28:36.219>
    labels = ['expert-unicode', 'type-crash']
    title = 'Seg fault when calling unicode() on old style object in virtualenv'
    updated_at = <Date 2013-02-21.02:33:36.201>
    user = 'https://bugs.python.org/johtso'

    bugs.python.org fields:

    activity = <Date 2013-02-21.02:33:36.201>
    actor = 'ned.deily'
    assignee = 'none'
    closed = True
    closed_date = <Date 2013-02-21.02:33:36.238>
    closer = 'ned.deily'
    components = ['Unicode']
    creation = <Date 2013-02-20.22:28:36.219>
    creator = 'johtso'
    dependencies = []
    files = ['29136']
    hgrepos = []
    issue_num = 17260
    keywords = []
    message_count = 5.0
    messages = ['182562', '182564', '182573', '182574', '182576']
    nosy_count = 4.0
    nosy_names = ['pitrou', 'ned.deily', 'ezio.melotti', 'johtso']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '16839'
    type = 'crash'
    url = 'https://bugs.python.org/issue17260'
    versions = ['Python 2.7']

    @johtso
    Copy link
    Mannequin Author

    johtso mannequin commented Feb 20, 2013

    Running the code attached causes a segmentation fault.

    This only occurs when run from within a virtual environment, and when the class is an old style class.

    I've tested on OSX with both 2.7.3 installed via Homebrew, and the default 2.7.2 Python installation.

    Also got the same result testing with 2.7.3 on linux ([GCC 4.4.5] on linux2)

    I've verified that exactly the same Python installation is being used inside and outside of the virtual env.

    Running the same code under 2.5 and 2.6 results in no seg fault.

    @johtso johtso mannequin added topic-unicode type-crash A hard crash of the interpreter, possibly with a core dump labels Feb 20, 2013
    @johtso johtso mannequin changed the title Seg fault when calling unicode() on old style class in virtualenv Seg fault when calling unicode() on old style object in virtualenv Feb 20, 2013
    @pitrou
    Copy link
    Member

    pitrou commented Feb 20, 2013

    Can you please post a gdb traceback?

    @johtso
    Copy link
    Mannequin Author

    johtso mannequin commented Feb 21, 2013

    Program received signal EXC_BAD_ACCESS, Could not access memory.
    Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000008
    0x000000010004e221 in PyObject_GetAttr ()
    (gdb) bt
    #0 0x000000010004e221 in PyObject_GetAttr ()
    #1 0x000000010004e0ff in PyObject_Unicode ()
    #2 0x000000010007ee57 in unicode_new ()
    #3 0x0000000100063cbc in type_call ()
    #4 0x00000001000108d1 in PyObject_Call ()
    #5 0x00000001000a5a1a in PyEval_EvalFrameEx ()
    #6 0x00000001000a313f in PyEval_EvalCodeEx ()
    #7 0x00000001000a2916 in PyEval_EvalCode ()
    #8 0x00000001000c9e2e in PyRun_FileExFlags ()
    #9 0x00000001000c980a in PyRun_SimpleFileExFlags ()
    #10 0x00000001000ded8a in Py_Main ()
    #11 0x0000000100000e4a in ?? ()
    #12 0x0000000100000d51 in ?? ()

    @ned-deily
    Copy link
    Member

    I can reproduce the segfault with a v2.7.3 Python + virtualenv but not with a current 2.7 tip Python + virtualenv. Nothing comes to mind immediately; I'll try bisecting.

    @ned-deily
    Copy link
    Member

    Duh! bpo-16839 "segmentation fault when unicode(classic_class_instance)"

    That was recently fixed and will be available in the upcoming 2.7.4 maintenance release.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    topic-unicode type-crash A hard crash of the interpreter, possibly with a core dump
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants