Issue 18289: python.org Interactive interpreter linked with libedit can segfault on future OS X (original) (raw)

Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information.

print round(1.123456, 3) 1.123 print round(1.123756, 3) Segmentation fault: 11

This doesn't happen if you just do the second round, only if you do both. python -c "print round(1.123456, 3); print round(1.123756, 3)" doesn't segfault.

Doesn't segfault on brew's python: Python 2.7.3 (default, May 19 2013, 04:22:38) [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.51)] on darwin Type "help", "copyright", "credits" or "license" for more information.

print round(1.123456, 3) 1.123 print round(1.123756, 3) 1.124

Doesn't segfault on another box: Python 2.7.2+ (default, Jul 20 2012, 22:12:53) [GCC 4.6.1] on linux2 Type "help", "copyright", "credits" or "license" for more information.

print round(1.123456, 3) 1.123 print round(1.123756, 3) 1.124

OSX Log File: (goes to EOF)

Process: Python [5423] Path: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python Identifier: Python Version: 2.7.3 (2.7.3) Code Type: X86-64 (Native) Parent Process: bash [1219] Responsible: iTerm [442] User ID: 501

Date/Time: 2013-06-24 13:55:56.871 +1000 OS Version: Mac OS X 10.9 (13A476u) Report Version: 11 Anonymous UUID: D8CE5653-35DD-5963-C8C9-E5012E41FDEE

Sleep/Wake UUID: 9C40804C-F025-4E16-A61A-D1E9D9F68DD3

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

Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000

VM Regions Near 0: --> __TEXT 0000000100000000-0000000100001000 [ 4K] r-x/rwx SM=COW /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 readline.so 0x00000001002eff97 call_readline + 647 1 org.python.python 0x0000000100008852 PyOS_Readline + 274 2 org.python.python 0x000000010000a0a8 tok_nextc + 104 3 org.python.python 0x000000010000a853 PyTokenizer_Get + 147 4 org.python.python 0x000000010000544a parsetok + 218 5 org.python.python 0x00000001000e7722 PyParser_ASTFromFile + 146 6 org.python.python 0x00000001000e8983 PyRun_InteractiveOneFlags + 243 7 org.python.python 0x00000001000e8c6e PyRun_InteractiveLoopFlags + 78 8 org.python.python 0x00000001000e9451 PyRun_AnyFileExFlags + 161 9 org.python.python 0x000000010010006d Py_Main + 3085 10 org.python.python 0x0000000100000f14 0x100000000 + 3860

Thread 0 crashed with X86 Thread State (64-bit): rax: 0x0000000000000000 rbx: 0x0000000100600000 rcx: 0x0000000100600000 rdx: 0x0000000000002800 rdi: 0x0000000000000000 rsi: 0x00000001002f0254 rbp: 0x00007fff5fbff620 rsp: 0x00007fff5fbff550 r8: 0x0000000100600000 r9: 0x0000000000000000 r10: 0x0000000000000007 r11: 0x0000000000000001 r12: 0x0000000000000001 r13: 0x0000000000000018 r14: 0x00007fff5fbff5e0 r15: 0x00007fff5fbff560 rip: 0x00000001002eff97 rfl: 0x0000000000010206 cr2: 0x0000000000000000

Logical CPU: 4 Error Code: 0x00000004 Trap Number: 14

Binary Images: 0x100000000 - 0x100000fff +org.python.python (2.7.3 - 2.7.3) /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python 0x100003000 - 0x10016dff7 +org.python.python (2.7.3, [c] 2004-2012 Python Software Foundation. - 2.7.3) <4F9EF48A-7D0C-0C1A-670B-3BF4E72C8696> /Library/Frameworks/Python.framework/Versions/2.7/Python 0x1002ee000 - 0x1002f0fff +readline.so (???) /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/readline.so 0x1004f0000 - 0x10050effb libedit.2.dylib (39) <24343EDB-E64F-34DC-8632-68C9E44E0FF7> /usr/lib/libedit.2.dylib 0x7fff66a19000 - 0x7fff66a4c987 dyld (236) /usr/lib/dyld 0x7fff8201f000 - 0x7fff82026ff3 libcopyfile.dylib (103) <7925E83E-6C96-38AD-9E53-AA9AE7C9E406> /usr/lib/system/libcopyfile.dylib 0x7fff82062000 - 0x7fff82063ff7 libsystem_blocks.dylib (63) /usr/lib/system/libsystem_blocks.dylib 0x7fff823cd000 - 0x7fff823f4ff3 libsystem_info.dylib (449) <6080681C-A561-3458-AA51-4DBE6D4E36B2> /usr/lib/system/libsystem_info.dylib 0x7fff82460000 - 0x7fff82466fef libsystem_platform.dylib (20.0.0.0.1) /usr/lib/system/libsystem_platform.dylib 0x7fff82514000 - 0x7fff8251bff7 liblaunch.dylib (841) <0554A59B-30EE-3E01-A5F6-3676F4B060B2> /usr/lib/system/liblaunch.dylib 0x7fff826d3000 - 0x7fff826d3ff7 libkeymgr.dylib (28) /usr/lib/system/libkeymgr.dylib 0x7fff829d4000 - 0x7fff829d5ffb libremovefile.dylib (33) /usr/lib/system/libremovefile.dylib 0x7fff83972000 - 0x7fff839b4ff7 libauto.dylib (185.4) <4B2CABC5-1F75-3225-81B4-882AEAE31ADC> /usr/lib/libauto.dylib 0x7fff84188000 - 0x7fff8418ffff libcompiler_rt.dylib (35) <9348DDF4-A5A7-3FDA-95E8-5018F88DC3AE> /usr/lib/system/libcompiler_rt.dylib 0x7fff84190000 - 0x7fff84191fff libunc.dylib (28) <34E818C3-373C-3564-8941-D9161473FD8A> /usr/lib/system/libunc.dylib 0x7fff8478c000 - 0x7fff8478ffff libsystem_stats.dylib (91.0.0.1.5) /usr/lib/system/libsystem_stats.dylib 0x7fff84790000 - 0x7fff847b7ff7 libsystem_network.dylib (241.2) <377DF6DA-A545-3146-A2B0-69B7D4492FB2> /usr/lib/system/libsystem_network.dylib 0x7fff85ae6000 - 0x7fff85ae9ff7 libdyld.dylib (236) <35641DC4-9D32-302F-BBE4-2B2E8A3D1D6B> /usr/lib/system/libdyld.dylib 0x7fff86229000 - 0x7fff8624afff libc++abi.dylib (41) /usr/lib/libc++abi.dylib 0x7fff87095000 - 0x7fff870c4fd2 libsystem_m.dylib (3047.15) <471B9063-4C93-3157-A862-AD84E3620182> /usr/lib/system/libsystem_m.dylib 0x7fff870c6000 - 0x7fff870d7ff7 libsystem_asl.dylib (215) <0995D278-3165-324E-8B35-936EA612ACD1> /usr/lib/system/libsystem_asl.dylib 0x7fff88073000 - 0x7fff8808dfff libsystem_malloc.dylib (23) <987C72AA-A2B3-3AD8-8616-D8A04B7440EF> /usr/lib/system/libsystem_malloc.dylib 0x7fff88c56000 - 0x7fff88c58ff3 libsystem_configuration.dylib (589) /usr/lib/system/libsystem_configuration.dylib 0x7fff88ce4000 - 0x7fff88ce5ff7 libsystem_sandbox.dylib (272) /usr/lib/system/libsystem_sandbox.dylib 0x7fff88f00000 - 0x7fff88f01ff7 libDiagnosticMessagesClient.dylib (100) /usr/lib/libDiagnosticMessagesClient.dylib 0x7fff88f02000 - 0x7fff88f0cfff libcommonCrypto.dylib (60047) <68F03BCA-58FD-39CC-878D-B7F6283102E5> /usr/lib/system/libcommonCrypto.dylib 0x7fff88f82000 - 0x7fff8900bff7 libsystem_c.dylib (995) <82F1BDE9-FD58-3749-9837-15ADC6909E0A> /usr/lib/system/libsystem_c.dylib 0x7fff89b93000 - 0x7fff89d4bffb libicucore.A.dylib (511.13) <552A1606-39B8-3A4F-A975-73838AC1FDD6> /usr/lib/libicucore.A.dylib 0x7fff8a265000 - 0x7fff8a267fff libquarantine.dylib (65) <8791F59F-9F9F-3A24-83C4-BFD04CF589EA> /usr/lib/system/libquarantine.dylib 0x7fff8a5ec000 - 0x7fff8a5f5ff3 libsystem_notify.dylib (121) <549072AF-B6C9-3F63-8027-72E70CAF91E4> /usr/lib/system/libsystem_notify.dylib 0x7fff8a5fc000 - 0x7fff8a62cfff libncurses.5.4.dylib (42) /usr/lib/libncurses.5.4.dylib 0x7fff8af11000 - 0x7fff8af63fff libc++.1.dylib (118) /usr/lib/libc++.1.dylib 0x7fff8c7e4000 - 0x7fff8c7e8ff7 libcache.dylib (61) /usr/lib/system/libcache.dylib 0x7fff8d234000 - 0x7fff8d24eff7 libdispatch.dylib (338.0.0.0.1) <280908EF-A853-3653-A5B0-ED2668057F26> /usr/lib/system/libdispatch.dylib 0x7fff8d262000 - 0x7fff8d263ff3 libSystem.B.dylib (1197) <3EE2A53C-6274-3FE4-AF73-E6BC8054D6EB> /usr/lib/libSystem.B.dylib 0x7fff8d6d1000 - 0x7fff8d6d6ff7 libunwind.dylib (35.3) <56390AC7-A945-3A4B-9E83-305EF4828104> /usr/lib/system/libunwind.dylib 0x7fff8e439000 - 0x7fff8e440ff7 libsystem_pthread.dylib (52) /usr/lib/system/libsystem_pthread.dylib 0x7fff8e441000 - 0x7fff8e625fff com.apple.CoreFoundation (6.9 - 839.13) <048EF287-A909-3CF5-B077-D885BCC0CE5F> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 0x7fff8e9ba000 - 0x7fff8e9d5ff7 libsystem_kernel.dylib (2422.1.4.1.8) <49597BCD-66AE-3511-A739-ADCC5F15EBF5> /usr/lib/system/libsystem_kernel.dylib 0x7fff8ea31000 - 0x7fff8ea39fff libsystem_dnssd.dylib (519.0.71) <69EC92C2-E2E4-315E-AE65-B20E6BA117F8> /usr/lib/system/libsystem_dnssd.dylib 0x7fff8ea74000 - 0x7fff8eac2ff7 libcorecrypto.dylib (159) <9597C75C-2559-319C-B991-9A955C69C325> /usr/lib/system/libcorecrypto.dylib 0x7fff8eb14000 - 0x7fff8eb36fff libxpc.dylib (296.0.0.1.1) <4D58910D-3A78-3E94-A00F-C8184A51592B> /usr/lib/system/libxpc.dylib 0x7fff8ebaa000 - 0x7fff8ed57f37 libobjc.A.dylib (548) /usr/lib/libobjc.A.dylib 0x7fff8efcb000 - 0x7fff8efd0fff libmacho.dylib (845) <042598A7-4439-3CF6-8D51-FA41B43A52E7> /usr/lib/system/libmacho.dylib 0x7fff8f2d1000 - 0x7fff8f2e2ff7 libz.1.dylib (53) <372E2641-66CA-3B13-8BE6-3A4335F861A6> /usr/lib/libz.1.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: 698403 thread_create: 0 thread_set_state: 0

VM Region Summary: ReadOnly portion of Libraries: Total=74.5M resident=14.9M(20%) swapped_out_or_unallocated=59.6M(80%) Writable regions: Total=19.9M written=2144K(11%) resident=2816K(14%) swapped_out=0K(0%) unallocated=17.2M(86%)

REGION TYPE VIRTUAL =========== ======= Kernel Alloc Once 4K MALLOC 11.6M MALLOC (admin) 16K STACK GUARD 56.0M Stack 8192K VM_ALLOCATE 8K __DATA 1452K __LINKEDIT 64.1M __TEXT 10.4M __UNICODE 544K shared memory 4K =========== ======= TOTAL 152.1M

Model: MacBookPro10,1, BootROM MBP101.00EE.B02, 4 processors, Intel Core i7, 2.3 GHz, 8 GB, SMC 2.3f35 Graphics: Intel HD Graphics 4000, Intel HD Graphics 4000, Built-In, 1024 MB Graphics: NVIDIA GeForce GT 650M, NVIDIA GeForce GT 650M, PCIe, 1024 MB Memory Module: BANK 0/DIMM0, 4 GB, DDR3, 1600 MHz, 0x80AD, 0x484D54333531533642465238432D50422020 Memory Module: BANK 1/DIMM0, 4 GB, DDR3, 1600 MHz, 0x80AD, 0x484D54333531533642465238432D50422020 AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0xEF), Broadcom BCM43xx 1.0 (6.30.223.82.10) Bluetooth: Version 4.2.0b3 12469, 3 services, 21 devices, 3 incoming serial ports Network Service: Wi-Fi, AirPort, en0 Serial ATA Device: APPLE SSD SM256E, 251 GB USB Device: hub_device USB Device: FaceTime HD Camera (Built-in) USB Device: hub_device USB Device: hub_device USB Device: BRCM20702 Hub USB Device: Bluetooth USB Host Controller USB Device: Apple Internal Keyboard / Trackpad