Crash in pyobjc-core when using the address sanitiser

Issue #279 new
Ronald Oussoren repo owner created an issue

The test suite for pyobjc-core sometimes fails with python3.7, always due to unexpected types in test_ivar.TestStructConvenience.

I’ve not yet managed to reproduce this reliably.

Comments (7)

  1. Ronald Oussoren reporter


    ERROR: test_using_convenience (PyObjCTest.test_ivar.TestStructConvenience) [long_long]
    Traceback (most recent call last):
      File "/Users/ronald/Projects/pyobjc-6/pyobjc-core/PyObjCTest/", line 283, in test_using_convenience
        v = getattr(objc.ivar, name)()
    TypeError: 'tuple' object is not callable

  2. Ronald Oussoren reporter

    It is worse than this, these tests sometimes crash.

    This could be a refcounting issue, I guess it is time to test using a debug build of CPython.

  3. Ronald Oussoren reporter

    Testing with a debug build of python with the undefined behaviour and address sanitisers finds an issue in OC_PythonData, in particular a segmentation fault in ``NSData.alloc().initWithData_(b”hello”)``.

    ==79979==The signal is caused by a READ memory access.
        #0 0x7fff7cc9969c in objc_msgSend (libobjc.A.dylib:x86_64h+0x669c)
        #1 0x7fff5479fa08 in -[NSData(NSData) initWithData:] (Foundation:x86_64+0x5da08)
        #2 0x7fff5486f31e in -[_NSPlaceholderData initWithData:] (Foundation:x86_64+0x12d31e)
        #3 0x115fae1e6 in ffi_call_unix64 darwin64.S:76
        #4 0x11dadb6ff  (<unknown module>)
    ==79979==Register values:
    rax = 0x00000000000b5af8  rbx = 0x000060800001aaa0  rcx = 0x000000000000020a  rdx = 0x000000000000020b  
    rdi = 0x000060800001aaa0  rsi = 0x00007fff50675128  rbp = 0x00007ffee0a55b70  rsp = 0x00007ffee0a55b48  
     r8 = 0x0000000000000060   r9 = 0x00000fffffffffff  r10 = 0x000000016f800088  r11 = 0x00007fff50675128  
    r12 = 0x00007ffee0a55b40  r13 = 0x0000000115fae9c8  r14 = 0x0000000000000001  r15 = 0x000060200031fcd0  
    AddressSanitizer can not provide additional info.
    SUMMARY: AddressSanitizer: SEGV (libobjc.A.dylib:x86_64h+0x669c) in objc_msgSend
    Abort trap: 6

    This is probably an unrelated issue, but still something that should be fixed.

  4. Ronald Oussoren reporter

    The crash in OC_PythonData is fixed in 1bfa8d08fe9a. … Mostly, the changeset only fixes the crash in, but not similar crashes in the archiving tests.

  5. Ronald Oussoren reporter

    The test failures seem to be gone with the changeset I mention earlier, more work is needed for the crash in the archiving tests (which only happen in a sanitiser build)

  6. Ronald Oussoren reporter

    The intermittent test error is not gone, got it again in a test run on 10.15 (using python 3.7, python 3.6 and 3.8 work fine)

  7. Log in to comment