crash with python3.6.2 and readline

David Epstein masbab at live.warwick.ac.uk
Tue Sep 5 23:29:14 UTC 2017


What is the procedure for adding to bug report #54728. 
<https://trac.macports.org/ticket/54728>

Here is a summary of what happened on my machine: 
<https://trac.macports.org/ticket/54728>

1. Installed python3.6.2 without specifying a variant.
2. This version is stable (that is, no crash) but interaction with 
readline is faulty.
3. Installed python3.6.2 +readline.
4. Installed py36-readline as suggested by the installation script for 
the previous step.
5. the new version of python, in interactive mode, crashes when I type 
carriage return, with message like

Python(21762,0x7fffb987c3c0) malloc: *** error for object 0x10d930640: 
pointer being freed was not allocated.

6. Interaction of readline with unix shell appears normal after call to 
python terminates (both variants).

I have some information (file attached bu1.txt). I also attach the crash 
report produced by Macos (bug2.txt).
I haven't yet collected any evidence for Point 2 above, but the fault 
could perhaps be demonstrated using script.

What additional info would be helpful?

David Epstein
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20170906/fc87008c/attachment.html>
-------------- next part --------------
Script started on Tue Sep  5 22:58:29 2017
Macintosh-2:~%
port installed | egrep "\bpy.*36"
  py27-setuptools @36.2.7_0 (active)
  py36-cython @0.26_0 (active)
  py36-nose @1.3.7_0 (active)
  py36-numpy @1.13.1_0+gfortran (active)
  py36-readline @6.2.4.1_1 (active)
  py36-setuptools @36.2.7_0 (active)
  python36 @3.6.2_0
  python36 @3.6.2_0+readline (active)
  vim @8.0.0891_0+huge+python36 (active)
Macintosh-2:~% ls /opt/local/bin/python3*6*
/opt/local/bin/python3.6@		/opt/local/bin/python3.6m@
/opt/local/bin/python3.6-config@	/opt/local/bin/python3.6m-config@
Macintosh-2:~% ls -l python3
ls: python3: No such file or directory
Macintosh-2:~% ls -l python3
lrwxr-xr-x  1 root  wheel  24  5 Sep 20:50 /opt/local/bin/python3@ -> /opt/local/bin/python3.6
Macintosh-2:~% python3
Python 3.6.2 (default, Sep  5 2017, 20:47:49) 
[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.
>>> 
Python(21762,0x7fffb987c3c0) malloc: *** error for object 0x10d930640: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort
Macintosh-2:~% exit


-------------- next part --------------
Process:               Python [21824]
Path:                  /opt/local/Library/Frameworks/Python.framework/Versions/3.6/Resources/Python.app/Contents/MacOS/Python
Identifier:            Python
Version:               3.6.2 (3.6.2)
Code Type:             X86-64 (Native)
Parent Process:        tcsh [21632]
Responsible:           Python [21824]
User ID:               502

Date/Time:             2017-09-06 00:10:55.716 +0100
OS Version:            Mac OS X 10.12.6 (16G29)
Report Version:        12
Anonymous UUID:        6725F168-5BEC-B1B1-5C9F-DF78A4ED392F

Sleep/Wake UUID:       94F81595-798C-4DC6-9AE9-4E0D88E9F346

Time Awake Since Boot: 160000 seconds
Time Since Wake:       4800 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
abort() called
*** error for object 0x10082c640: pointer being freed was not allocated
 

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	0x00007fffb0a96d42 __pthread_kill + 10
1   libsystem_pthread.dylib       	0x00007fffb0b84457 pthread_kill + 90
2   libsystem_c.dylib             	0x00007fffb09fc420 abort + 129
3   libsystem_malloc.dylib        	0x00007fffb0aebfe7 free + 530
4   org.python.python             	0x00000001003cc152 PyOS_Readline + 285
5   org.python.python             	0x00000001003ce4e8 tok_nextc + 95
6   org.python.python             	0x00000001003cd349 tok_get + 166
7   org.python.python             	0x00000001003cd287 PyTokenizer_Get + 14
8   org.python.python             	0x00000001003cc3fb parsetok + 95
9   org.python.python             	0x000000010048d45a PyParser_ASTFromFileObject + 101
10  org.python.python             	0x000000010048d29c PyRun_InteractiveOneObject + 426
11  org.python.python             	0x000000010048cbe4 PyRun_InteractiveLoopFlags + 105
12  org.python.python             	0x000000010048cb48 PyRun_AnyFileExFlags + 60
13  org.python.python             	0x00000001004a0ce7 Py_Main + 3655
14  org.python.python             	0x00000001003c4e1d 0x1003c3000 + 7709
15  libdyld.dylib                 	0x00007fffb0968235 start + 1

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x0000000000000006  rcx: 0x00007fff5f83bed8  rdx: 0x0000000000000000
  rdi: 0x0000000000000307  rsi: 0x0000000000000006  rbp: 0x00007fff5f83bf00  rsp: 0x00007fff5f83bed8
   r8: 0x0000000000000000   r9: 0x0000000000000000  r10: 0x0000000008000000  r11: 0x0000000000000206
  r12: 0x00007fe3a0019a00  r13: 0x0000000000000001  r14: 0x00007fffb987c3c0  r15: 0x0000000000000000
  rip: 0x00007fffb0a96d42  rfl: 0x0000000000000206  cr2: 0x00007fffb985e128
  
Logical CPU:     0
Error Code:      0x02000148
Trap Number:     133


Binary Images:
       0x1003c3000 -        0x1003c4fff +org.python.python (3.6.2 - 3.6.2) <6FF0B3CF-0B96-3470-BCEF-A670EFF683D7> /opt/local/Library/Frameworks/Python.framework/Versions/3.6/Resources/Python.app/Contents/MacOS/Python
       0x1003c7000 -        0x10052fff7 +org.python.python (3.6.2, [c] 2001-2017 Python Software Foundation. - 3.6.2) <9F1515F1-380C-320D-9E3C-0A5713CE1F93> /opt/local/Library/Frameworks/Python.framework/Versions/3.6/Python
       0x100687000 -        0x10068fff3 +libintl.8.dylib (0) <34C7A792-8F97-3B47-BE05-892044CF0A65> /opt/local/lib/libintl.8.dylib
       0x100694000 -        0x100789ff7 +libiconv.2.dylib (0) <455FEED2-6E0D-3401-B482-886C3489F9EC> /opt/local/lib/libiconv.2.dylib
       0x100a70000 -        0x100a71fff +_heapq.cpython-36m-darwin.so (0) <64EC9970-6438-32F3-BB70-A158D4A8FB6C> /opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload/_heapq.cpython-36m-darwin.so
       0x100af5000 -        0x100b27fff +readline.cpython-36m-darwin.so (0) <7A619482-DDAE-3472-AE11-32C754B16DA9> /opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/readline/readline.cpython-36m-darwin.so
       0x100b41000 -        0x100b7affb +libncurses.6.dylib (0) <DC0446AF-80E7-3BD2-AB75-6DCB9B7276CA> /opt/local/lib/libncurses.6.dylib
       0x1048b5000 -        0x1048f2dc7  dyld (433.5) <322C06B7-8878-311D-888C-C8FD2CA96FF3> /usr/lib/dyld
    0x7fff9b161000 -     0x7fff9b5faff7  com.apple.CoreFoundation (6.9 - 1349.8) <09ED473E-5DE8-307F-B55C-16F6419236D5> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
    0x7fffaf17f000 -     0x7fffaf180ff3  libDiagnosticMessagesClient.dylib (102) <84A04D24-0E60-3810-A8C0-90A65E2DF61A> /usr/lib/libDiagnosticMessagesClient.dylib
    0x7fffaf3be000 -     0x7fffaf3bfffb  libSystem.B.dylib (1238.60.2) <F18AC1E7-C6F1-34B1-8069-BE571B3231D4> /usr/lib/libSystem.B.dylib
    0x7fffaf4f8000 -     0x7fffaf54eff7  libc++.1.dylib (307.5) <0B43BB5D-E6EB-3464-8DE9-B41AC8ED9D1C> /usr/lib/libc++.1.dylib
    0x7fffaf54f000 -     0x7fffaf578ff7  libc++abi.dylib (307.4) <BC271AD3-831B-362A-9DA7-E8C51F285FE4> /usr/lib/libc++abi.dylib
    0x7fffafab9000 -     0x7fffafcdeffb  libicucore.A.dylib (57166.0.1) <CCD2ED24-3071-383B-925D-8D763BB12A6F> /usr/lib/libicucore.A.dylib
    0x7fffb006d000 -     0x7fffb043f047  libobjc.A.dylib (709.1) <70614861-0340-32E2-85ED-FE65759CDFFA> /usr/lib/libobjc.A.dylib
    0x7fffb086c000 -     0x7fffb087dff3  libz.1.dylib (67) <46E3FFA2-4328-327A-8D34-A03E20BFFB8E> /usr/lib/libz.1.dylib
    0x7fffb088c000 -     0x7fffb0890ff7  libcache.dylib (79) <093A4DAB-8385-3D47-A350-E20CB7CCF7BF> /usr/lib/system/libcache.dylib
    0x7fffb0891000 -     0x7fffb089bfff  libcommonCrypto.dylib (60092.50.5) <8A64D1B0-C70E-385C-92F0-E669079FDA90> /usr/lib/system/libcommonCrypto.dylib
    0x7fffb089c000 -     0x7fffb08a3fff  libcompiler_rt.dylib (62) <55D47421-772A-32AB-B529-1A46C2F43B4D> /usr/lib/system/libcompiler_rt.dylib
    0x7fffb08a4000 -     0x7fffb08acfff  libcopyfile.dylib (138) <819BEA3C-DF11-3E3D-A1A1-5A51C5BF1961> /usr/lib/system/libcopyfile.dylib
    0x7fffb08ad000 -     0x7fffb0930fdf  libcorecrypto.dylib (442.50.19) <65D7165E-2E71-335D-A2D6-33F78E2DF0C1> /usr/lib/system/libcorecrypto.dylib
    0x7fffb0931000 -     0x7fffb0962fff  libdispatch.dylib (703.50.37) <6582BAD6-ED27-3B30-B620-90B1C5A4AE3C> /usr/lib/system/libdispatch.dylib
    0x7fffb0963000 -     0x7fffb0968ffb  libdyld.dylib (433.5) <9B2AC56D-107C-3541-A127-9094A751F2C9> /usr/lib/system/libdyld.dylib
    0x7fffb0969000 -     0x7fffb0969ffb  libkeymgr.dylib (28) <7AA011A9-DC21-3488-BF73-3B5B14D1FDD6> /usr/lib/system/libkeymgr.dylib
    0x7fffb0977000 -     0x7fffb0977fff  liblaunch.dylib (972.70.1) <B856ABD2-896E-3DE0-B2C8-146A6AF8E2A7> /usr/lib/system/liblaunch.dylib
    0x7fffb0978000 -     0x7fffb097dff3  libmacho.dylib (898) <17D5D855-F6C3-3B04-B680-E9BF02EF8AED> /usr/lib/system/libmacho.dylib
    0x7fffb097e000 -     0x7fffb0980ff3  libquarantine.dylib (85.50.1) <12448CC2-378E-35F3-BE33-9DC395A5B970> /usr/lib/system/libquarantine.dylib
    0x7fffb0981000 -     0x7fffb0982ffb  libremovefile.dylib (45) <38D4CB9C-10CD-30D3-8B7B-A515EC75FE85> /usr/lib/system/libremovefile.dylib
    0x7fffb0983000 -     0x7fffb099bff7  libsystem_asl.dylib (349.50.5) <096E4228-3B7C-30A6-8B13-EC909A64499A> /usr/lib/system/libsystem_asl.dylib
    0x7fffb099c000 -     0x7fffb099cff7  libsystem_blocks.dylib (67) <10DC5404-73AB-35B3-A277-A8AFECB476EB> /usr/lib/system/libsystem_blocks.dylib
    0x7fffb099d000 -     0x7fffb0a2afef  libsystem_c.dylib (1158.50.2) <E5AE5244-7D0C-36AC-8BB6-C7AE7EA52A4B> /usr/lib/system/libsystem_c.dylib
    0x7fffb0a2b000 -     0x7fffb0a2effb  libsystem_configuration.dylib (888.60.2) <BECC01A2-CA8D-31E6-BCDF-D452965FA976> /usr/lib/system/libsystem_configuration.dylib
    0x7fffb0a2f000 -     0x7fffb0a32fff  libsystem_coreservices.dylib (41.4) <7D26DE79-B424-3450-85E1-F7FAB32714AB> /usr/lib/system/libsystem_coreservices.dylib
    0x7fffb0a33000 -     0x7fffb0a4bfff  libsystem_coretls.dylib (121.50.4) <EC6FCF07-DCFB-3A03-9CC9-6DD3709974C6> /usr/lib/system/libsystem_coretls.dylib
    0x7fffb0a4c000 -     0x7fffb0a52fff  libsystem_dnssd.dylib (765.50.9) <CC960215-0B1B-3822-A13A-3DDE96FA796F> /usr/lib/system/libsystem_dnssd.dylib
    0x7fffb0a53000 -     0x7fffb0a7cff7  libsystem_info.dylib (503.50.4) <611DB84C-BF70-3F92-8702-B9F28A900920> /usr/lib/system/libsystem_info.dylib
    0x7fffb0a7d000 -     0x7fffb0a9fff7  libsystem_kernel.dylib (3789.70.16) <34B1F16C-BC9C-3C5F-9045-0CAE91CB5914> /usr/lib/system/libsystem_kernel.dylib
    0x7fffb0aa0000 -     0x7fffb0ae7fe7  libsystem_m.dylib (3121.6) <86D499B5-BBDC-3D3B-8A4E-97AE8E6672A4> /usr/lib/system/libsystem_m.dylib
    0x7fffb0ae8000 -     0x7fffb0b06ff7  libsystem_malloc.dylib (116.50.8) <A3D15F17-99A6-3367-8C7E-4280E8619C95> /usr/lib/system/libsystem_malloc.dylib
    0x7fffb0b07000 -     0x7fffb0b60ffb  libsystem_network.dylib (856.60.1) <369D0221-56CA-3C3E-9EDE-94B41CAE77B7> /usr/lib/system/libsystem_network.dylib
    0x7fffb0b61000 -     0x7fffb0b6aff3  libsystem_networkextension.dylib (563.60.2) <B021F2B3-8A75-3633-ABB0-FC012B8E9B0C> /usr/lib/system/libsystem_networkextension.dylib
    0x7fffb0b6b000 -     0x7fffb0b74ff3  libsystem_notify.dylib (165.20.1) <B8160190-A069-3B3A-BDF6-2AA408221FAE> /usr/lib/system/libsystem_notify.dylib
    0x7fffb0b75000 -     0x7fffb0b7dfe7  libsystem_platform.dylib (126.50.8) <897462FD-B318-321B-A554-E61982630F7E> /usr/lib/system/libsystem_platform.dylib
    0x7fffb0b7e000 -     0x7fffb0b88ff7  libsystem_pthread.dylib (218.60.3) <B8FB5E20-3295-39E2-B5EB-B464D1D4B104> /usr/lib/system/libsystem_pthread.dylib
    0x7fffb0b89000 -     0x7fffb0b8cff7  libsystem_sandbox.dylib (592.70.1) <4B92EC49-ACD0-36AE-B07A-A2B8152EAF9D> /usr/lib/system/libsystem_sandbox.dylib
    0x7fffb0b8d000 -     0x7fffb0b8eff3  libsystem_secinit.dylib (24.50.4) <F78B847B-3565-3E4B-98A6-F7AD40392E2D> /usr/lib/system/libsystem_secinit.dylib
    0x7fffb0b8f000 -     0x7fffb0b96ffb  libsystem_symptoms.dylib (532.50.47) <3390E07C-C1CE-348F-ADBD-2C5440B45EAA> /usr/lib/system/libsystem_symptoms.dylib
    0x7fffb0b97000 -     0x7fffb0baaff7  libsystem_trace.dylib (518.70.1) <AC63A7FE-50D9-3A30-96E6-F6B7FF16E465> /usr/lib/system/libsystem_trace.dylib
    0x7fffb0bab000 -     0x7fffb0bb0ffb  libunwind.dylib (35.3) <3D50D8A8-C460-334D-A519-2DA841102C6B> /usr/lib/system/libunwind.dylib
    0x7fffb0bb1000 -     0x7fffb0bdaff7  libxpc.dylib (972.70.1) <BF896DF0-D8E9-31A8-A4B3-01120BFEEE52> /usr/lib/system/libxpc.dylib

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 85287
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=132.6M resident=0K(0%) swapped_out_or_unallocated=132.6M(100%)
Writable regions: Total=55.7M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=55.7M(100%)
 
                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Kernel Alloc Once                    8K        2 
MALLOC                            36.3M       10 
MALLOC guard page                   16K        4 
MALLOC_LARGE (reserved)            512K        3         reserved VM address space (unallocated)
STACK GUARD                          4K        2 
Stack                             16.0M        2 
VM_ALLOCATE                       2564K        7 
__DATA                            3512K       55 
__LINKEDIT                       115.1M       10 
__TEXT                            17.5M       51 
__UNICODE                          556K        2 
shared memory                        8K        3 
===========                     =======  ======= 
TOTAL                            192.0M      139 
TOTAL, minus reserved VM space   191.5M      139 

Model: MacBookPro11,2, BootROM MBP112.0138.B40, 4 processors, Intel Core i7, 2 GHz, 16 GB, SMC 2.18f15
Graphics: Intel Iris Pro, Intel Iris Pro, Built-In
Memory Module: BANK 0/DIMM0, 8 GB, DDR3, 1600 MHz, 0x80AD, 0x484D54343147533641465238412D50422020
Memory Module: BANK 1/DIMM0, 8 GB, DDR3, 1600 MHz, 0x80AD, 0x484D54343147533641465238412D50422020
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x134), Broadcom BCM43xx 1.0 (7.21.171.130.1a1)
Bluetooth: Version 5.0.5f1, 3 services, 27 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
Serial ATA Device: APPLE SSD SM0512F, 500.28 GB
USB Device: USB 3.0 Bus
USB Device: Apple Internal Keyboard / Trackpad
USB Device: BRCM20702 Hub
USB Device: Bluetooth USB Host Controller
Thunderbolt Bus: MacBook Pro, Apple Inc., 17.1



More information about the macports-users mailing list