Opened 3 months ago

Closed 3 months ago

Last modified 3 months ago

#70603 closed defect (fixed)

python312 @3.12.5_0+lto+optimizations: aborts with ctypes

Reported by: quintusdias (John G Evans) Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version: 2.10.1
Keywords: Cc:
Port: python312

Description

I have a package called glymur that uses ctypes to interface with the openjpeg library and I have been running into segfaults when using python312 on intel. The more I try to isolate the bug, the more I think might not have anything to do with the openjpeg port, but rather with the ctypes module on python312.

The attached reproduction steps are basically pulled from the official python documentation at https://docs.python.org/3/library/ctypes.html#ctypes-callback-functions. It produces segfaults on python312, but not on python311 or python310. It also does not produce segfaults on Anaconda on the same machine. I do not see the segfaults on ARM either, just intel. Removing the +lto and +optimizations variants did not seem to change anything.

Attachments (2)

reproduction-steps.py (458 bytes) - added by quintusdias (John G Evans) 3 months ago.
reproduction steps
Python-2024-08-21-134749.ips (12.9 KB) - added by quintusdias (John G Evans) 3 months ago.
crash log from ~/Library/Logs/DiagnosticsReports

Download all attachments as: .zip

Change History (6)

Changed 3 months ago by quintusdias (John G Evans)

Attachment: reproduction-steps.py added

reproduction steps

Changed 3 months ago by quintusdias (John G Evans)

crash log from ~/Library/Logs/DiagnosticsReports

comment:1 Changed 3 months ago by quintusdias (John G Evans)

Owner: set to jmr@…
Port: python312 added; jmr@macports.org removed
Status: newassigned

Apologies, mixed up a few fields when initially filling this out.

comment:2 Changed 3 months ago by jmroot (Joshua Root)

Owner: changed from jmr@… to jmroot
Status: assignedaccepted

Can this be reproduced with other distributions of Python 3.12, or just MacPorts?

comment:3 Changed 3 months ago by jmroot (Joshua Root)

Resolution: fixed
Status: acceptedclosed

In abd158fe8d4007feb98ec94c25d41738e1986c9a/macports-ports (master):

python312: fix crash in ctypes

The configure script was adding -DUSING_APPLE_OS_LIBFFI=1 to CFLAGS
despite building against the MacPorts libffi.

Closes: #70603

comment:4 Changed 3 months ago by jmroot (Joshua Root)

Summary: python312 @3.12.5_0+lto+optimizations: segfaults with ctypespython312 @3.12.5_0+lto+optimizations: aborts with ctypes
Note: See TracTickets for help on using tickets.