python / cpython

The Python programming language
https://www.python.org
Other
63.09k stars 30.21k forks source link

MacOS Monterrey malloc issue #89032

Closed a639f2fd-0740-47da-93a7-8e0fc1124b15 closed 3 years ago

a639f2fd-0740-47da-93a7-8e0fc1124b15 commented 3 years ago
BPO 44869
Nosy @ronaldoussoren, @ned-deily, @edumorlom
Files
  • bug.log
  • 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: ```python assignee = None closed_at = created_at = labels = ['OS-mac', '3.8', '3.9', '3.10', '3.11', '3.7', 'type-crash'] title = 'MacOS Monterrey malloc issue' updated_at = user = 'https://github.com/edumorlom' ``` bugs.python.org fields: ```python activity = actor = 'ned.deily' assignee = 'none' closed = True closed_date = closer = 'ned.deily' components = ['macOS'] creation = creator = 'edumorlom' dependencies = [] files = ['50267'] hgrepos = [] issue_num = 44869 keywords = [] message_count = 9.0 messages = ['399247', '399248', '399249', '399322', '399406', '399509', '401255', '401256', '401292'] nosy_count = 3.0 nosy_names = ['ronaldoussoren', 'ned.deily', 'edumorlom'] pr_nums = [] priority = 'normal' resolution = 'third party' stage = 'resolved' status = 'closed' superseder = None type = 'crash' url = 'https://bugs.python.org/issue44869' versions = ['Python 3.6', 'Python 3.7', 'Python 3.8', 'Python 3.9', 'Python 3.10', 'Python 3.11'] ```

    a639f2fd-0740-47da-93a7-8e0fc1124b15 commented 3 years ago

    Running on MacOS Monterrey throws following error:

    malloc: *** error for object 0x7ffb5ea1a120: pointer being freed was not allocatedPython(4899,0x1061a8600)

    This started happening right after upgrading to the new MacOS Beta.

    a639f2fd-0740-47da-93a7-8e0fc1124b15 commented 3 years ago

    I am not sure how to reproduce it, I think it's being caused by an imported library.

    a639f2fd-0740-47da-93a7-8e0fc1124b15 commented 3 years ago

    These are the libraries that I'm using:

    ibm-db~=3.0.4
    Flask~=2.0.1
    pandas~=1.2.5
    requests~=2.25.1
    flask_basicauth~=0.2.0
    schedule~=1.1.0
    ronaldoussoren commented 3 years ago

    I'm afraid we cannot do a lot with the information you provided. I've just ran a full test run for a copy of 3.10rc1 installed using the universal2 installer and that doesn't have problem.

    One way to find more information about what's going on is to use fault handler (e.g. PYTHONFAULTHANDLER=1 python3.10 ...), although that will just print a Python stack trace when the executable crashes.

    Alternatively use a debugger to look at the C stack.

    a639f2fd-0740-47da-93a7-8e0fc1124b15 commented 3 years ago

    I've been able to tackle the issue down and reported it to the library. Although I'm not sure if it's a Python or library issue.

    https://github.com/ibmdb/python-ibmdb/issues/648

    ronaldoussoren commented 3 years ago

    There is a 3th possibility: This could be a bug in the OS, Monterey is still in beta at this point and beta's tend to contain more bugs than release versions.

    a639f2fd-0740-47da-93a7-8e0fc1124b15 commented 3 years ago

    Not sure if this is helpful, but I am attaching the MacOS bug log that is auto-generated when Python fails.

    a639f2fd-0740-47da-93a7-8e0fc1124b15 commented 3 years ago

    Also:

    (base) ➜ backend git:(development) ✗ PYTHONFAULTHANDLER=1 python3 server.py

    CONFIG_FILE=../config/development.json Python(27657,0x10839f600) malloc: error for object 0x7ffb4ac81d10: pointer being freed was not allocated Python(27657,0x10839f600) malloc: set a breakpoint in malloc_error_break to debug Fatal Python error: Aborted

    Current thread 0x000000010839f600 (most recent call first): File "/Users/edumoralesibm/fantasy-football-health-dashboard/backend/server.py", line 26 in \<module> [1] 27657 abort PYTHONFAULTHANDLER=1 python3 server.py

    ned-deily commented 3 years ago

    The crash report you provide shows a crash in libstdc++ which is normally not called directly by the Python interpreter or standard library modules on macOS but appears to be being called by libopenblas as provided by the copy of numpy in use. Suggest you follow up with the numpy, openblas, or homebrew projects, if that's where you obtained numpy and friends. Keep in mind that the problem might still be related to the pre-release status of macOS Monterey. Good luck!