Opened 7 years ago

Closed 7 years ago

#54700 closed defect (fixed)

python36 @3.6.2: aborts when importing struct; unallocated pointer being freed

Reported by: jhelm (John Helm) Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version: 2.4.1
Keywords: Cc:
Port: python36

Description (last modified by mf2k (Frank Schima))

Loading struct works with Python35 but crashes Python36. Thanks. /John Helm

Python 3.6.2 (default, Jul 18 2017, 14:13:41)
[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import struct
Python(15382,0x7fff7f851000) malloc: *** error for object 0x10f8b5110: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6
jlh-MacBook-Pro:fbaNG01 jlh$

Change History (13)

comment:1 Changed 7 years ago by jhelm (John Helm)

Correcting formatting of code block.

jlh-MacBook-Pro:fbaNG01 jlh$ python
Python 3.6.2 (default, Jul 18 2017, 14:13:41)
[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import struct
Python(15382,0x7fff7f851000) malloc: *** error for object 0x10f8b5110: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6
jlh-MacBook-Pro:fbaNG01 jlh$

comment:2 Changed 7 years ago by mf2k (Frank Schima)

Cc: jyrkiwahlstedt removed
Description: modified (diff)
Owner: set to jyrkiwahlstedt
Status: newassigned

comment:3 Changed 7 years ago by mf2k (Frank Schima)

FYI, it works fine on my computer.

comment:4 Changed 7 years ago by mf2k (Frank Schima)

What version of MacOS are you running?

comment:5 Changed 7 years ago by jhelm (John Helm)

Ouch. OS X 10.11.6 (El Capitan); and while I'm at it, Xcode is version is Version 8.0 (8A218a). Should I remove and reinstall MacPorts? Thanks /John

comment:6 Changed 7 years ago by mf2k (Frank Schima)

According to the wiki wiki:XcodeVersionInfo#OSX10.11, you should upgrade your Xcode and command line tools to 8.2.1. Then you can try re-installing your ports (no need to re-install Macports itself).

comment:7 Changed 7 years ago by jhelm (John Helm)

Thank you Frank. I upgraded to xcode 8.2.1 (8C1002) and verified the compiler version to be

jlh-MacBook-Pro:fbaNG01 jlh$ cc --version
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

I uninstalled and reinstalled python36, ran 'port diagnose', and then ran 'sudo port -nR upgrade --force python36' to force a rebuild. I still get the error.

Could my path or environment be wrong? Here's echo $PATH

/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/MacGPG2/bin:/Applications/Postgres.app/Contents/Versions/latest/bin

I won't spam you with the environment, but I can see anything egregious.

Finally I've installed python34, python33, and python31; they all import struct successfully.

comment:8 Changed 7 years ago by mf2k (Frank Schima)

While the path is largely irrelevant, it can effect if you are running Macports python 3.6 when you type "python" from the command line. It does look like you are running Macports python 3.6. However, it is slightly sub-optimal and should probably be optimized to remove the redundant path "/usr/local/bin", which is showing up twice.

It might be an underlying dependency of python 3.6 that needs to be rebuilt. Although I think they are same as the older pythons and you say those work. Shrug.

comment:9 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

I can reproduce this problem on Sierra.

$ python3.5
Python 3.5.4 (default, Aug 14 2017, 18:26:29) 
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import struct
>>> ^D
$ python3.6
Python 3.6.2 (default, Jul 23 2017, 12:22:19) 
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import struct
Python(88518,0x7fffa4f9f3c0) malloc: *** error for object 0x1047ff110: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6

comment:10 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

Summary: Python36 abends when importing struct; unallocated pointer being freedpython36 @3.6.2: aborts when importing struct; unallocated pointer being freed

comment:11 Changed 7 years ago by jmroot (Joshua Root)

Owner: changed from jyrkiwahlstedt to jmroot

comment:12 Changed 7 years ago by jmroot (Joshua Root)

Is this still a problem with the current version? I can't reproduce it.

comment:13 Changed 7 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: assignedclosed

Closing as per email from reporter.

Note: See TracTickets for help on using tickets.