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

libffi on 32bit is broken on linux #61625

Closed
fijall mannequin opened this issue Mar 14, 2013 · 7 comments
Closed

libffi on 32bit is broken on linux #61625

fijall mannequin opened this issue Mar 14, 2013 · 7 comments
Labels
type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@fijall
Copy link
Mannequin

fijall mannequin commented Mar 14, 2013

BPO 17423
Nosy @gpshead, @vstinner, @alex, @asvetlov, @skrah
Superseder
  • bpo-17245: ctypes libffi needs to align the x86 stack to 16 bytes
  • Files
  • x.py
  • x.c
  • ffi.diff
  • 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-03-18.20:58:36.806>
    created_at = <Date 2013-03-14.21:09:03.242>
    labels = ['type-crash']
    title = 'libffi on 32bit is broken on linux'
    updated_at = <Date 2013-03-18.20:59:11.903>
    user = 'https://bugs.python.org/fijall'

    bugs.python.org fields:

    activity = <Date 2013-03-18.20:59:11.903>
    actor = 'gregory.p.smith'
    assignee = 'none'
    closed = True
    closed_date = <Date 2013-03-18.20:58:36.806>
    closer = 'gregory.p.smith'
    components = []
    creation = <Date 2013-03-14.21:09:03.242>
    creator = 'fijall'
    dependencies = []
    files = ['29410', '29411', '29412']
    hgrepos = []
    issue_num = 17423
    keywords = ['patch']
    message_count = 7.0
    messages = ['184193', '184201', '184313', '184316', '184318', '184323', '184520']
    nosy_count = 7.0
    nosy_names = ['gregory.p.smith', 'vstinner', 'hodgestar', 'alex', 'asvetlov', 'skrah', 'fijall']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = None
    status = 'closed'
    superseder = '17245'
    type = 'crash'
    url = 'https://bugs.python.org/issue17423'
    versions = []

    @fijall
    Copy link
    Mannequin Author

    fijall mannequin commented Mar 14, 2013

    The bug is a little tricky to reproduce. You need a 32bit linux. First compile x.c with:

    gcc -O3 -g -shared -o x.so x.c -std=c99 -msse3 -ftree-vectorize -mfpmath=sse

    and run x.py. It segfaults because the alignment of stack is not preserved (and it's assumed on a modern linux). Patch attached.

    @fijall fijall mannequin added the type-crash A hard crash of the interpreter, possibly with a core dump label Mar 14, 2013
    @skrah
    Copy link
    Mannequin

    skrah mannequin commented Mar 14, 2013

    Is this the same as bpo-17245?

    @vstinner
    Copy link
    Member

    libffi is not part of Python project, but Python has a copy for system which don't provide system libffi. You should report the issue upstream:
    http://sourceware.org/libffi/

    (Or is the issue already fixed upstream?)

    @fijall
    Copy link
    Mannequin Author

    fijall mannequin commented Mar 16, 2013

    The issue is reported upstrem and is/will be fixed

    @fijall
    Copy link
    Mannequin Author

    fijall mannequin commented Mar 16, 2013

    It's not "a copy for systems that don't provide libffi", since CPython makes zero effort to try to use system libffi if present.

    @alex
    Copy link
    Member

    alex commented Mar 16, 2013

    The patch has been merged into libffi upstream: https://github.com/atgreen/libffi/pull/32

    @gpshead
    Copy link
    Member

    gpshead commented Mar 18, 2013

    I'm taking care of this with a libffi update per bpo-17192 and bpo-19245. Thanks for the upstream fix into libffi 3.0.13 alex. :)

    @gpshead gpshead closed this as completed Mar 18, 2013
    @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
    type-crash A hard crash of the interpreter, possibly with a core dump
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants