Max OSX 10.8 build problems - seg fault

Asked by Peter Sankauskas on 2012-10-27

I am trying to get pyexiv2 working on OSX. I have been using these instructions:
https://gist.github.com/819680

which worked really well 2 years ago, but things have changed. I modified one line in there to be this:

install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.6/Python /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib build/libexiv2python.dylib

but still the seg fault remains. Here are the details of the seg fault:

Process: Python [457]
Path: /usr/local/Cellar/python/2.7.3/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 [294]
User ID: 501

Date/Time: 2012-10-26 22:24:24.087 -0700
OS Version: Mac OS X 10.8.2 (12C60)
Report Version: 10

Interval Since Last Report: 10249 sec
Crashes Since Last Report: 2
Per-App Crashes Since Last Report: 2
Anonymous UUID: 229616B3-B264-3580-EBA6-D8783CEE7DFB

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 0000000105ea4000-0000000105ea5000 [ 4K] r-x/rwx SM=COW /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python

Application Specific Information:
/Library/Python/2.7/site-packages/libexiv2python.so

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 org.python.python 0x000000010666d0ec PyInt_FromLong + 33
1 libexiv2python.so 0x000000010622f821 boost::python::converter::arg_to_python<int>::arg_to_python(int const&) + 33
2 libexiv2python.so 0x000000010622f864 _object* boost::python::api::object_initializer_impl<false, false>::get<int>(int const&, mpl_::bool_<false>) + 36
3 libexiv2python.so 0x000000010622f942 _object* boost::python::api::object_base_initializer<int>(int const&) + 50
4 libexiv2python.so 0x000000010622f974 boost::python::api::object::object<int>(int const&) + 28
5 libexiv2python.so 0x000000010622f9fc boost::python::tuple boost::python::make_tuple<int, int, int>(int const&, int const&, int const&) + 108
6 libexiv2python.so 0x00000001062174ff __static_initialization_and_destruction_0(int, int) + 351
7 libexiv2python.so 0x0000000106217381 _GLOBAL__I__ZN12_GLOBAL__N_12_1E + 33
8 dyld 0x00007fff65ab7378 ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 236
9 dyld 0x00007fff65ab7762 ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 46
10 dyld 0x00007fff65ab406e ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&) + 380
11 dyld 0x00007fff65ab3eba ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 54
12 dyld 0x00007fff65aa8e38 dyld::runInitializers(ImageLoader*) + 89
13 dyld 0x00007fff65aae87c dlopen + 581
14 libdyld.dylib 0x00007fff8fde7dd8 dlopen + 57
15 org.python.python 0x0000000105f54a2f _PyImport_GetDynLoadFunc + 305
16 org.python.python 0x0000000105f40d07 _PyImport_LoadDynamicModule + 103
17 org.python.python 0x0000000105f40a82 import_submodule + 327
18 org.python.python 0x0000000105f40687 load_next + 322
19 org.python.python 0x0000000105f3e939 PyImport_ImportModuleLevel + 1143
20 org.python.python 0x0000000105f254d8 builtin___import__ + 136
21 org.python.python 0x0000000105eb54b9 PyObject_Call + 97
22 org.python.python 0x0000000105f2f85c PyEval_CallObjectWithKeywords + 168
23 org.python.python 0x0000000105f2dac5 PyEval_EvalFrameEx + 15366
24 org.python.python 0x0000000105f29e84 PyEval_EvalCodeEx + 1857
25 org.python.python 0x0000000105f2973d PyEval_EvalCode + 54
26 org.python.python 0x0000000105f3d50e PyImport_ExecCodeModuleEx + 241
27 org.python.python 0x0000000105f4009d load_source_module + 1169
28 org.python.python 0x0000000105f40326 load_package + 371
29 org.python.python 0x0000000105f40a82 import_submodule + 327
30 org.python.python 0x0000000105f40649 load_next + 260
31 org.python.python 0x0000000105f3e939 PyImport_ImportModuleLevel + 1143
32 org.python.python 0x0000000105f254d8 builtin___import__ + 136
33 org.python.python 0x0000000105eb54b9 PyObject_Call + 97
34 org.python.python 0x0000000105f2f85c PyEval_CallObjectWithKeywords + 168
35 org.python.python 0x0000000105f2dac5 PyEval_EvalFrameEx + 15366
36 org.python.python 0x0000000105f29e84 PyEval_EvalCodeEx + 1857
37 org.python.python 0x0000000105f2973d PyEval_EvalCode + 54
38 org.python.python 0x0000000105f47de7 run_mod + 53
39 org.python.python 0x0000000105f47c69 PyRun_InteractiveOneFlags + 480
40 org.python.python 0x0000000105f476ff PyRun_InteractiveLoopFlags + 188
41 org.python.python 0x0000000105f475ad PyRun_AnyFileExFlags + 60
42 org.python.python 0x0000000105f584bd Py_Main + 2909
43 libdyld.dylib 0x00007fff8fde87e1 start + 1

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000106760d80 rbx: 0x0000000000000000 rcx: 0x0000000000000000 rdx: 0x00007fff59d58b40
  rdi: 0x0000000000000000 rsi: 0x00007fff59d58cc4 rbp: 0x00007fff59d58aa0 rsp: 0x00007fff59d58a90
   r8: 0x00007fff59d58970 r9: 0x0000000000000000 r10: 0x0000000000001002 r11: 0x000000010678b068
  r12: 0x00007fff65ad90f0 r13: 0x0000000000000002 r14: 0x00007f9d4142a690 r15: 0x0000000000000001
  rip: 0x000000010666d0ec rfl: 0x0000000000010287 cr2: 0x0000000000000000
Logical CPU: 6

Binary Images:
       0x105ea4000 - 0x105ea4fff +org.python.python (2.7.3 - 2.7.3) <D4553F78-9203-3736-8152-CF3F070A8BEC> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
       0x105eab000 - 0x105fb2ff7 +org.python.python (2.7.3, [c] 2004-2012 Python Software Foundation. - 2.7.3) <9B06CA11-D725-3032-A314-9FF12D0A1693> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/Python
       0x10618e000 - 0x106190ff7 +readline.so (0) <8EFFC0AC-3649-3422-9080-A751B94560AD> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/readline.so
       0x106196000 - 0x1061b9ff7 +libreadline.6.2.dylib (6.2) <9667412F-D7B5-3514-9B90-E6D699C045D0> /usr/local/opt/readline/lib/libreadline.6.2.dylib
       0x1061fe000 - 0x106289fff +libexiv2python.so (0) <84FFE701-1F54-341D-AE89-2A90790073E6> /Library/Python/2.7/site-packages/libexiv2python.so
       0x10638b000 - 0x1063c1ff7 +libboost_python-mt.dylib (0) <23F2558A-53F9-3C71-B40D-3CE9FB8B55B8> /usr/local/lib/libboost_python-mt.dylib
       0x106409000 - 0x106575ff7 +libexiv2.12.dylib (0) <88DDE3BB-F8EE-3CEC-B564-4D5CAC135749> /usr/local/lib/libexiv2.12.dylib
       0x106619000 - 0x106726fff org.python.python (2.7.2 - 2.7.2) <B2E5B3C9-2D7C-37D7-B23D-84DEF8DDAF28> /System/Library/Frameworks/Python.framework/Versions/2.7/Python
    0x7fff65aa4000 - 0x7fff65ad893f dyld (210.2.3) <36CAA36E-72BC-3E48-96D9-B96A2DF77730> /usr/lib/dyld
    0x7fff83df8000 - 0x7fff83df9fff libDiagnosticMessagesClient.dylib (8) <8548E0DC-0D2F-30B6-B045-FE8A038E76D8> /usr/lib/libDiagnosticMessagesClient.dylib
    0x7fff83e65000 - 0x7fff83e6afff libcache.dylib (57) <65187C6E-3FBF-3EB8-A1AA-389445E2984D> /usr/lib/system/libcache.dylib
    0x7fff83ee5000 - 0x7fff83eedfff liblaunch.dylib (442.26.2) <2F71CAF8-6524-329E-AC56-C506658B4C0C> /usr/lib/system/liblaunch.dylib
    0x7fff84afb000 - 0x7fff84b29ff7 libsystem_m.dylib (3022.6) <B434BE5C-25AB-3EBD-BAA7-5304B34E3441> /usr/lib/system/libsystem_m.dylib
    0x7fff84fe1000 - 0x7fff851e1fff libicucore.A.dylib (491.11.1) <CC318A27-878A-38CE-9292-1B98353FA9C7> /usr/lib/libicucore.A.dylib
    0x7fff86675000 - 0x7fff8685efff com.apple.CoreFoundation (6.8 - 744.12) <EF002794-DAEF-31C6-866C-E3E3AC387A9F> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
    0x7fff87117000 - 0x7fff87118ff7 libdnsinfo.dylib (453.18) <E7595861-ECF9-336E-9901-BED2620FAA80> /usr/lib/system/libdnsinfo.dylib
    0x7fff87773000 - 0x7fff87798ff7 libc++abi.dylib (24.4) <E7BD9363-1D25-3551-A68A-2E2FF6ABECD7> /usr/lib/libc++abi.dylib
    0x7fff8789c000 - 0x7fff878d4fff libncurses.5.4.dylib (37.3) <68D5B5F5-8252-3F1E-AFF1-C6AFE145DBC1> /usr/lib/libncurses.5.4.dylib
    0x7fff88046000 - 0x7fff88051fff libsystem_notify.dylib (98.5) <C49275CC-835A-3207-AFBA-8C01374927B6> /usr/lib/system/libsystem_notify.dylib
    0x7fff882d3000 - 0x7fff8833cfff libstdc++.6.dylib (56) <EAA2B53E-EADE-39CF-A0EF-FB9D4940672A> /usr/lib/libstdc++.6.dylib
    0x7fff8835d000 - 0x7fff88362fff libcompiler_rt.dylib (30) <08F8731D-5961-39F1-AD00-4590321D24A9> /usr/lib/system/libcompiler_rt.dylib
    0x7fff887e2000 - 0x7fff887e2fff libkeymgr.dylib (25) <CC9E3394-BE16-397F-926B-E579B60EE429> /usr/lib/system/libkeymgr.dylib
    0x7fff88f50000 - 0x7fff88f51ff7 libSystem.B.dylib (169.3) <9089D72D-E714-31E1-80C8-698A8E8B05AD> /usr/lib/libSystem.B.dylib
    0x7fff88fc9000 - 0x7fff88fe4ff7 libexpat.1.dylib (12) <95D59F1F-0A5C-3F33-BA97-26F7D796CE7A> /usr/lib/libexpat.1.dylib
    0x7fff8998c000 - 0x7fff89a58fe7 libsystem_c.dylib (825.25) <8CBCF9B9-EBB7-365E-A3FF-2F3850763C6B> /usr/lib/system/libsystem_c.dylib
    0x7fff89a97000 - 0x7fff89b8cfff libiconv.2.dylib (34) <FEE8B996-EB44-37FA-B96E-D379664DEFE1> /usr/lib/libiconv.2.dylib
    0x7fff8a362000 - 0x7fff8a398fff libsystem_info.dylib (406.17) <4FFCA242-7F04-365F-87A6-D4EFB89503C1> /usr/lib/system/libsystem_info.dylib
    0x7fff8c2c1000 - 0x7fff8c2d6ff7 libdispatch.dylib (228.23) <D26996BF-FC57-39EB-8829-F63585561E09> /usr/lib/system/libdispatch.dylib
    0x7fff8cc2d000 - 0x7fff8cc3bfff libcommonCrypto.dylib (60026) <2D6537F5-1B5E-305C-A1CF-D1FA80CA3939> /usr/lib/system/libcommonCrypto.dylib
    0x7fff8d046000 - 0x7fff8d048ff7 libunc.dylib (25) <92805328-CD36-34FF-9436-571AB0485072> /usr/lib/system/libunc.dylib
    0x7fff8d1a2000 - 0x7fff8d1c4ff7 libxpc.dylib (140.41) <FAC04D8B-680E-325F-8F0C-DD69859D0E01> /usr/lib/system/libxpc.dylib
    0x7fff8d468000 - 0x7fff8d46ffff libcopyfile.dylib (89) <876573D0-E907-3566-A108-577EAD1B6182> /usr/lib/system/libcopyfile.dylib
    0x7fff8d470000 - 0x7fff8d471ff7 libsystem_sandbox.dylib (220) <3C3B03CF-C525-3CB3-8557-62E91B93AC95> /usr/lib/system/libsystem_sandbox.dylib
    0x7fff8de03000 - 0x7fff8de6bff7 libc++.1.dylib (65.1) <20E31B90-19B9-3C2A-A9EB-474E08F9FE05> /usr/lib/libc++.1.dylib
    0x7fff8e327000 - 0x7fff8e376ff7 libcorecrypto.dylib (106.2) <CE0C29A3-C420-339B-ADAA-52F4683233CC> /usr/lib/system/libcorecrypto.dylib
    0x7fff8e386000 - 0x7fff8e398ff7 libz.1.dylib (43) <2A1551E8-A272-3DE5-B692-955974FE1416> /usr/lib/libz.1.dylib
    0x7fff8e727000 - 0x7fff8e773ff7 libauto.dylib (185.1) <73CDC482-16E3-3FC7-9BB4-FBA2DA44DBC2> /usr/lib/libauto.dylib
    0x7fff8ebd1000 - 0x7fff8ebd2fff libsystem_blocks.dylib (59) <D92DCBC3-541C-37BD-AADE-ACC75A0C59C8> /usr/lib/system/libsystem_blocks.dylib
    0x7fff8f4f5000 - 0x7fff8f4fdff7 libsystem_dnssd.dylib (379.32.1) <62AA0B84-188A-348B-8F9E-3E2DB08DB93C> /usr/lib/system/libsystem_dnssd.dylib
    0x7fff8f60f000 - 0x7fff8f61dff7 libsystem_network.dylib (77.10) <0D99F24E-56FE-380F-B81B-4A4C630EE587> /usr/lib/system/libsystem_network.dylib
    0x7fff8fdcd000 - 0x7fff8fdd3ff7 libunwind.dylib (35.1) <21703D36-2DAB-3D8B-8442-EAAB23C060D3> /usr/lib/system/libunwind.dylib
    0x7fff8fde6000 - 0x7fff8fde9ff7 libdyld.dylib (210.2.3) <F59367C9-C110-382B-A695-9035A6DD387E> /usr/lib/system/libdyld.dylib
    0x7fff90401000 - 0x7fff90407fff libmacho.dylib (829) <BF332AD9-E89F-387E-92A4-6E1AB74BD4D9> /usr/lib/system/libmacho.dylib
    0x7fff90408000 - 0x7fff90409ff7 libremovefile.dylib (23.1) <DBBFAF35-AC78-3856-92F6-6E4FD9DF14A2> /usr/lib/system/libremovefile.dylib
    0x7fff9040a000 - 0x7fff9040cfff libquarantine.dylib (52) <4BE2E642-A14F-340A-B482-5BD2AEFD9C24> /usr/lib/system/libquarantine.dylib
    0x7fff9040d000 - 0x7fff9052592f libobjc.A.dylib (532.2) <90D31928-F48D-3E37-874F-220A51FD9E37> /usr/lib/libobjc.A.dylib
    0x7fff9092e000 - 0x7fff90949ff7 libsystem_kernel.dylib (2050.18.24) <C0535565-35D1-31A7-A744-63D9F10F12A4> /usr/lib/system/libsystem_kernel.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: 332
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=69.9M resident=35.3M(51%) swapped_out_or_unallocated=34.6M(49%)
Writable regions: Total=20.4M written=2332K(11%) resident=2896K(14%) swapped_out=0K(0%) unallocated=17.6M(86%)

REGION TYPE VIRTUAL
=========== =======
MALLOC 11.8M
MALLOC guard page 32K
STACK GUARD 56.0M
Stack 8192K
__DATA 2092K
__LINKEDIT 55.3M
__TEXT 14.6M
__UNICODE 544K
shared memory 12K
=========== =======
TOTAL 148.3M

Model: MacBookPro8,2, BootROM MBP81.0047.B27, 4 processors, Intel Core i7, 2 GHz, 8 GB, SMC 1.69f3
Graphics: Intel HD Graphics 3000, Intel HD Graphics 3000, Built-In, 512 MB
Graphics: AMD Radeon HD 6490M, AMD Radeon HD 6490M, PCIe, 256 MB
Memory Module: BANK 0/DIMM0, 4 GB, DDR3, 1333 MHz, 0x80CE, 0x4D34373142353237334448302D4348392020
Memory Module: BANK 1/DIMM0, 4 GB, DDR3, 1333 MHz, 0x80CE, 0x4D34373142353237334448302D4348392020
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0xD6), Broadcom BCM43xx 1.0 (5.106.98.81.22)
Bluetooth: Version 4.0.9f33 10885, 2 service, 11 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en1
Serial ATA Device: SAMSUNG SSD 830 Series, 256.06 GB
Serial ATA Device: MATSHITADVD-R UJ-898
USB Device: FaceTime HD Camera (Built-in), apple_vendor_id, 0x8509, 0xfa200000 / 3
USB Device: hub_device, 0x0424 (SMSC), 0x2513, 0xfa100000 / 2
USB Device: Apple Internal Keyboard / Trackpad, apple_vendor_id, 0x0245, 0xfa120000 / 5
USB Device: BRCM2070 Hub, 0x0a5c (Broadcom Corp.), 0x4500, 0xfa110000 / 4
USB Device: Bluetooth USB Host Controller, apple_vendor_id, 0x821a, 0xfa113000 / 6
USB Device: hub_device, 0x0424 (SMSC), 0x2513, 0xfd100000 / 2
USB Device: USB Receiver, 0x046d (Logitech Inc.), 0xc52b, 0xfd120000 / 4
USB Device: IR Receiver, apple_vendor_id, 0x8242, 0xfd110000 / 3

Does anyone know what might be causing this, and any possible work around?

Thanks.

Question information

Language:
English Edit question
Status:
Answered
For:
pyexiv2 Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Olivier Tilloy (osomon) said : #1

What version of pyexiv2 are you compiling? Is it the latest release (0.3.2), or the tip of the trunk (revision 376)?
If it is the release, can you try again with the tip of the trunk (bzr branch lp:pyexiv2) and let me know if it’s any better?

Peter Sankauskas (pas256) said : #2

Hi Olivier,

That was actually for version 0.3.0. I tried with 0.3.2, and the same thing (seg fault).

Just now, I tried with tip of the trunk, and also received a seg fault when trying "import pyexiv2". This is with a freshly upgraded brew as well.

Here is the updated crash report:

Process: Python [457]
Path: /usr/local/Cellar/python/2.7.3/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 [294]
User ID: 501

Date/Time: 2012-10-26 22:24:24.087 -0700
OS Version: Mac OS X 10.8.2 (12C60)
Report Version: 10

Interval Since Last Report: 10249 sec
Crashes Since Last Report: 2
Per-App Crashes Since Last Report: 2
Anonymous UUID: 229616B3-B264-3580-EBA6-D8783CEE7DFB

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 0000000105ea4000-0000000105ea5000 [ 4K] r-x/rwx SM=COW /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python

Application Specific Information:
/Library/Python/2.7/site-packages/libexiv2python.so

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 org.python.python 0x000000010666d0ec PyInt_FromLong + 33
1 libexiv2python.so 0x000000010622f821 boost::python::converter::arg_to_python<int>::arg_to_python(int const&) + 33
2 libexiv2python.so 0x000000010622f864 _object* boost::python::api::object_initializer_impl<false, false>::get<int>(int const&, mpl_::bool_<false>) + 36
3 libexiv2python.so 0x000000010622f942 _object* boost::python::api::object_base_initializer<int>(int const&) + 50
4 libexiv2python.so 0x000000010622f974 boost::python::api::object::object<int>(int const&) + 28
5 libexiv2python.so 0x000000010622f9fc boost::python::tuple boost::python::make_tuple<int, int, int>(int const&, int const&, int const&) + 108
6 libexiv2python.so 0x00000001062174ff __static_initialization_and_destruction_0(int, int) + 351
7 libexiv2python.so 0x0000000106217381 _GLOBAL__I__ZN12_GLOBAL__N_12_1E + 33
8 dyld 0x00007fff65ab7378 ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 236
9 dyld 0x00007fff65ab7762 ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 46
10 dyld 0x00007fff65ab406e ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&) + 380
11 dyld 0x00007fff65ab3eba ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 54
12 dyld 0x00007fff65aa8e38 dyld::runInitializers(ImageLoader*) + 89
13 dyld 0x00007fff65aae87c dlopen + 581
14 libdyld.dylib 0x00007fff8fde7dd8 dlopen + 57
15 org.python.python 0x0000000105f54a2f _PyImport_GetDynLoadFunc + 305
16 org.python.python 0x0000000105f40d07 _PyImport_LoadDynamicModule + 103
17 org.python.python 0x0000000105f40a82 import_submodule + 327
18 org.python.python 0x0000000105f40687 load_next + 322
19 org.python.python 0x0000000105f3e939 PyImport_ImportModuleLevel + 1143
20 org.python.python 0x0000000105f254d8 builtin___import__ + 136
21 org.python.python 0x0000000105eb54b9 PyObject_Call + 97
22 org.python.python 0x0000000105f2f85c PyEval_CallObjectWithKeywords + 168
23 org.python.python 0x0000000105f2dac5 PyEval_EvalFrameEx + 15366
24 org.python.python 0x0000000105f29e84 PyEval_EvalCodeEx + 1857
25 org.python.python 0x0000000105f2973d PyEval_EvalCode + 54
26 org.python.python 0x0000000105f3d50e PyImport_ExecCodeModuleEx + 241
27 org.python.python 0x0000000105f4009d load_source_module + 1169
28 org.python.python 0x0000000105f40326 load_package + 371
29 org.python.python 0x0000000105f40a82 import_submodule + 327
30 org.python.python 0x0000000105f40649 load_next + 260
31 org.python.python 0x0000000105f3e939 PyImport_ImportModuleLevel + 1143
32 org.python.python 0x0000000105f254d8 builtin___import__ + 136
33 org.python.python 0x0000000105eb54b9 PyObject_Call + 97
34 org.python.python 0x0000000105f2f85c PyEval_CallObjectWithKeywords + 168
35 org.python.python 0x0000000105f2dac5 PyEval_EvalFrameEx + 15366
36 org.python.python 0x0000000105f29e84 PyEval_EvalCodeEx + 1857
37 org.python.python 0x0000000105f2973d PyEval_EvalCode + 54
38 org.python.python 0x0000000105f47de7 run_mod + 53
39 org.python.python 0x0000000105f47c69 PyRun_InteractiveOneFlags + 480
40 org.python.python 0x0000000105f476ff PyRun_InteractiveLoopFlags + 188
41 org.python.python 0x0000000105f475ad PyRun_AnyFileExFlags + 60
42 org.python.python 0x0000000105f584bd Py_Main + 2909
43 libdyld.dylib 0x00007fff8fde87e1 start + 1

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000106760d80 rbx: 0x0000000000000000 rcx: 0x0000000000000000 rdx: 0x00007fff59d58b40
  rdi: 0x0000000000000000 rsi: 0x00007fff59d58cc4 rbp: 0x00007fff59d58aa0 rsp: 0x00007fff59d58a90
   r8: 0x00007fff59d58970 r9: 0x0000000000000000 r10: 0x0000000000001002 r11: 0x000000010678b068
  r12: 0x00007fff65ad90f0 r13: 0x0000000000000002 r14: 0x00007f9d4142a690 r15: 0x0000000000000001
  rip: 0x000000010666d0ec rfl: 0x0000000000010287 cr2: 0x0000000000000000
Logical CPU: 6

Binary Images:
       0x105ea4000 - 0x105ea4fff +org.python.python (2.7.3 - 2.7.3) <D4553F78-9203-3736-8152-CF3F070A8BEC> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
       0x105eab000 - 0x105fb2ff7 +org.python.python (2.7.3, [c] 2004-2012 Python Software Foundation. - 2.7.3) <9B06CA11-D725-3032-A314-9FF12D0A1693> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/Python
       0x10618e000 - 0x106190ff7 +readline.so (0) <8EFFC0AC-3649-3422-9080-A751B94560AD> /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/readline.so
       0x106196000 - 0x1061b9ff7 +libreadline.6.2.dylib (6.2) <9667412F-D7B5-3514-9B90-E6D699C045D0> /usr/local/opt/readline/lib/libreadline.6.2.dylib
       0x1061fe000 - 0x106289fff +libexiv2python.so (0) <84FFE701-1F54-341D-AE89-2A90790073E6> /Library/Python/2.7/site-packages/libexiv2python.so
       0x10638b000 - 0x1063c1ff7 +libboost_python-mt.dylib (0) <23F2558A-53F9-3C71-B40D-3CE9FB8B55B8> /usr/local/lib/libboost_python-mt.dylib
       0x106409000 - 0x106575ff7 +libexiv2.12.dylib (0) <88DDE3BB-F8EE-3CEC-B564-4D5CAC135749> /usr/local/lib/libexiv2.12.dylib
       0x106619000 - 0x106726fff org.python.python (2.7.2 - 2.7.2) <B2E5B3C9-2D7C-37D7-B23D-84DEF8DDAF28> /System/Library/Frameworks/Python.framework/Versions/2.7/Python
    0x7fff65aa4000 - 0x7fff65ad893f dyld (210.2.3) <36CAA36E-72BC-3E48-96D9-B96A2DF77730> /usr/lib/dyld
    0x7fff83df8000 - 0x7fff83df9fff libDiagnosticMessagesClient.dylib (8) <8548E0DC-0D2F-30B6-B045-FE8A038E76D8> /usr/lib/libDiagnosticMessagesClient.dylib
    0x7fff83e65000 - 0x7fff83e6afff libcache.dylib (57) <65187C6E-3FBF-3EB8-A1AA-389445E2984D> /usr/lib/system/libcache.dylib
    0x7fff83ee5000 - 0x7fff83eedfff liblaunch.dylib (442.26.2) <2F71CAF8-6524-329E-AC56-C506658B4C0C> /usr/lib/system/liblaunch.dylib
    0x7fff84afb000 - 0x7fff84b29ff7 libsystem_m.dylib (3022.6) <B434BE5C-25AB-3EBD-BAA7-5304B34E3441> /usr/lib/system/libsystem_m.dylib
    0x7fff84fe1000 - 0x7fff851e1fff libicucore.A.dylib (491.11.1) <CC318A27-878A-38CE-9292-1B98353FA9C7> /usr/lib/libicucore.A.dylib
    0x7fff86675000 - 0x7fff8685efff com.apple.CoreFoundation (6.8 - 744.12) <EF002794-DAEF-31C6-866C-E3E3AC387A9F> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
    0x7fff87117000 - 0x7fff87118ff7 libdnsinfo.dylib (453.18) <E7595861-ECF9-336E-9901-BED2620FAA80> /usr/lib/system/libdnsinfo.dylib
    0x7fff87773000 - 0x7fff87798ff7 libc++abi.dylib (24.4) <E7BD9363-1D25-3551-A68A-2E2FF6ABECD7> /usr/lib/libc++abi.dylib
    0x7fff8789c000 - 0x7fff878d4fff libncurses.5.4.dylib (37.3) <68D5B5F5-8252-3F1E-AFF1-C6AFE145DBC1> /usr/lib/libncurses.5.4.dylib
    0x7fff88046000 - 0x7fff88051fff libsystem_notify.dylib (98.5) <C49275CC-835A-3207-AFBA-8C01374927B6> /usr/lib/system/libsystem_notify.dylib
    0x7fff882d3000 - 0x7fff8833cfff libstdc++.6.dylib (56) <EAA2B53E-EADE-39CF-A0EF-FB9D4940672A> /usr/lib/libstdc++.6.dylib
    0x7fff8835d000 - 0x7fff88362fff libcompiler_rt.dylib (30) <08F8731D-5961-39F1-AD00-4590321D24A9> /usr/lib/system/libcompiler_rt.dylib
    0x7fff887e2000 - 0x7fff887e2fff libkeymgr.dylib (25) <CC9E3394-BE16-397F-926B-E579B60EE429> /usr/lib/system/libkeymgr.dylib
    0x7fff88f50000 - 0x7fff88f51ff7 libSystem.B.dylib (169.3) <9089D72D-E714-31E1-80C8-698A8E8B05AD> /usr/lib/libSystem.B.dylib
    0x7fff88fc9000 - 0x7fff88fe4ff7 libexpat.1.dylib (12) <95D59F1F-0A5C-3F33-BA97-26F7D796CE7A> /usr/lib/libexpat.1.dylib
    0x7fff8998c000 - 0x7fff89a58fe7 libsystem_c.dylib (825.25) <8CBCF9B9-EBB7-365E-A3FF-2F3850763C6B> /usr/lib/system/libsystem_c.dylib
    0x7fff89a97000 - 0x7fff89b8cfff libiconv.2.dylib (34) <FEE8B996-EB44-37FA-B96E-D379664DEFE1> /usr/lib/libiconv.2.dylib
    0x7fff8a362000 - 0x7fff8a398fff libsystem_info.dylib (406.17) <4FFCA242-7F04-365F-87A6-D4EFB89503C1> /usr/lib/system/libsystem_info.dylib
    0x7fff8c2c1000 - 0x7fff8c2d6ff7 libdispatch.dylib (228.23) <D26996BF-FC57-39EB-8829-F63585561E09> /usr/lib/system/libdispatch.dylib
    0x7fff8cc2d000 - 0x7fff8cc3bfff libcommonCrypto.dylib (60026) <2D6537F5-1B5E-305C-A1CF-D1FA80CA3939> /usr/lib/system/libcommonCrypto.dylib
    0x7fff8d046000 - 0x7fff8d048ff7 libunc.dylib (25) <92805328-CD36-34FF-9436-571AB0485072> /usr/lib/system/libunc.dylib
    0x7fff8d1a2000 - 0x7fff8d1c4ff7 libxpc.dylib (140.41) <FAC04D8B-680E-325F-8F0C-DD69859D0E01> /usr/lib/system/libxpc.dylib
    0x7fff8d468000 - 0x7fff8d46ffff libcopyfile.dylib (89) <876573D0-E907-3566-A108-577EAD1B6182> /usr/lib/system/libcopyfile.dylib
    0x7fff8d470000 - 0x7fff8d471ff7 libsystem_sandbox.dylib (220) <3C3B03CF-C525-3CB3-8557-62E91B93AC95> /usr/lib/system/libsystem_sandbox.dylib
    0x7fff8de03000 - 0x7fff8de6bff7 libc++.1.dylib (65.1) <20E31B90-19B9-3C2A-A9EB-474E08F9FE05> /usr/lib/libc++.1.dylib
    0x7fff8e327000 - 0x7fff8e376ff7 libcorecrypto.dylib (106.2) <CE0C29A3-C420-339B-ADAA-52F4683233CC> /usr/lib/system/libcorecrypto.dylib
    0x7fff8e386000 - 0x7fff8e398ff7 libz.1.dylib (43) <2A1551E8-A272-3DE5-B692-955974FE1416> /usr/lib/libz.1.dylib
    0x7fff8e727000 - 0x7fff8e773ff7 libauto.dylib (185.1) <73CDC482-16E3-3FC7-9BB4-FBA2DA44DBC2> /usr/lib/libauto.dylib
    0x7fff8ebd1000 - 0x7fff8ebd2fff libsystem_blocks.dylib (59) <D92DCBC3-541C-37BD-AADE-ACC75A0C59C8> /usr/lib/system/libsystem_blocks.dylib
    0x7fff8f4f5000 - 0x7fff8f4fdff7 libsystem_dnssd.dylib (379.32.1) <62AA0B84-188A-348B-8F9E-3E2DB08DB93C> /usr/lib/system/libsystem_dnssd.dylib
    0x7fff8f60f000 - 0x7fff8f61dff7 libsystem_network.dylib (77.10) <0D99F24E-56FE-380F-B81B-4A4C630EE587> /usr/lib/system/libsystem_network.dylib
    0x7fff8fdcd000 - 0x7fff8fdd3ff7 libunwind.dylib (35.1) <21703D36-2DAB-3D8B-8442-EAAB23C060D3> /usr/lib/system/libunwind.dylib
    0x7fff8fde6000 - 0x7fff8fde9ff7 libdyld.dylib (210.2.3) <F59367C9-C110-382B-A695-9035A6DD387E> /usr/lib/system/libdyld.dylib
    0x7fff90401000 - 0x7fff90407fff libmacho.dylib (829) <BF332AD9-E89F-387E-92A4-6E1AB74BD4D9> /usr/lib/system/libmacho.dylib
    0x7fff90408000 - 0x7fff90409ff7 libremovefile.dylib (23.1) <DBBFAF35-AC78-3856-92F6-6E4FD9DF14A2> /usr/lib/system/libremovefile.dylib
    0x7fff9040a000 - 0x7fff9040cfff libquarantine.dylib (52) <4BE2E642-A14F-340A-B482-5BD2AEFD9C24> /usr/lib/system/libquarantine.dylib
    0x7fff9040d000 - 0x7fff9052592f libobjc.A.dylib (532.2) <90D31928-F48D-3E37-874F-220A51FD9E37> /usr/lib/libobjc.A.dylib
    0x7fff9092e000 - 0x7fff90949ff7 libsystem_kernel.dylib (2050.18.24) <C0535565-35D1-31A7-A744-63D9F10F12A4> /usr/lib/system/libsystem_kernel.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: 332
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=69.9M resident=35.3M(51%) swapped_out_or_unallocated=34.6M(49%)
Writable regions: Total=20.4M written=2332K(11%) resident=2896K(14%) swapped_out=0K(0%) unallocated=17.6M(86%)

REGION TYPE VIRTUAL
=========== =======
MALLOC 11.8M
MALLOC guard page 32K
STACK GUARD 56.0M
Stack 8192K
__DATA 2092K
__LINKEDIT 55.3M
__TEXT 14.6M
__UNICODE 544K
shared memory 12K
=========== =======
TOTAL 148.3M

Model: MacBookPro8,2, BootROM MBP81.0047.B27, 4 processors, Intel Core i7, 2 GHz, 8 GB, SMC 1.69f3
Graphics: Intel HD Graphics 3000, Intel HD Graphics 3000, Built-In, 512 MB
Graphics: AMD Radeon HD 6490M, AMD Radeon HD 6490M, PCIe, 256 MB
Memory Module: BANK 0/DIMM0, 4 GB, DDR3, 1333 MHz, 0x80CE, 0x4D34373142353237334448302D4348392020
Memory Module: BANK 1/DIMM0, 4 GB, DDR3, 1333 MHz, 0x80CE, 0x4D34373142353237334448302D4348392020
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0xD6), Broadcom BCM43xx 1.0 (5.106.98.81.22)
Bluetooth: Version 4.0.9f33 10885, 2 service, 11 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en1
Serial ATA Device: SAMSUNG SSD 830 Series, 256.06 GB
Serial ATA Device: MATSHITADVD-R UJ-898
USB Device: FaceTime HD Camera (Built-in), apple_vendor_id, 0x8509, 0xfa200000 / 3
USB Device: hub_device, 0x0424 (SMSC), 0x2513, 0xfa100000 / 2
USB Device: Apple Internal Keyboard / Trackpad, apple_vendor_id, 0x0245, 0xfa120000 / 5
USB Device: BRCM2070 Hub, 0x0a5c (Broadcom Corp.), 0x4500, 0xfa110000 / 4
USB Device: Bluetooth USB Host Controller, apple_vendor_id, 0x821a, 0xfa113000 / 6
USB Device: hub_device, 0x0424 (SMSC), 0x2513, 0xfd100000 / 2
USB Device: USB Receiver, 0x046d (Logitech Inc.), 0xc52b, 0xfd120000 / 4
USB Device: IR Receiver, apple_vendor_id, 0x8242, 0xfd110000 / 3

Please let me know if there is something I can do to help figure this out, as this is an excellent library that I really want to be able to develop locally with.

Peter

Peter Sankauskas (pas256) said : #3

Forgot the console output:

Python 2.7.3 (default, Oct 25 2012, 22:13:41)
[GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyexiv2
Segmentation fault: 11

Olivier Tilloy (osomon) said : #4

Unfortunately I am without a clue here (not using pyexiv2 on MacOS myself)…

The System Python and the Homebrew Python are being linked into libexiv2python.

I have about the same problem here, on OSX 10.6.8 with Homebrew.

guilherme$ otool -L /usr/local/lib/python2.7/site-packages/libexiv2python.so
/usr/local/lib/python2.7/site-packages/libexiv2python.so:
 /usr/local/lib/python2.7/site-packages/libexiv2python.so (compatibility version 0.0.0, current version 0.0.0)
 /usr/local/lib/libboost_python-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
 /usr/local/lib/libexiv2.12.dylib (compatibility version 13.0.0, current version 13.0.0)
 /System/Library/Frameworks/Python.framework/Versions/2.6/Python (compatibility version 2.6.0, current version 2.6.1)
 /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
 /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)

Mixing python versions isn't good...
Somehow the compilation is picking the 'wrong' Python. Don't know how to solve yet.

I got it to work. A few details:

Like me, the OP also uses a brewed Python. In my case I have an 'universal' and 'framework' Python. Both boost and pyexiv2 must use the same Python version.

In order to have boost using the brewed Python, you might need to compile it instead of using a pre-compiled bottle (which seems to using the System Python). Try to remove boost and reinstall with the '--universal' flag (it will take a while to compile).

Finally, pyexiv2 have to be tweaked to find the brewed python 'framework'.
The following patch over the homebrew pyexiv2 formula (https://github.com/mxcl/homebrew/blob/master/Library/Formula/pyexiv2.rb) got me going.

Hope it helps!
Sure it is hardcoded to homebrew, I am not sure what would be a better way to handle this, perhaps having arguments similar to BOOSTLIB on the SConscript...

diff --git a/src/SConscript b/src/SConscript
index 748cad0..511bc53 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -28,7 +28,8 @@ env.Append(LIBS=libs)

+ # Link against Python framework on OS X
+ if env['PLATFORM'] == 'darwin':
+ env['FRAMEWORKS'] += ['Python']
+ env.AppendUnique(FRAMEWORKPATH='/usr/local/Cellar/python/2.7.3/Frameworks/')

 # Build shared library libpyexiv2
 cpp_sources = ['exiv2wrapper.cpp', 'exiv2wrapper_python.cpp']

Can you help with this problem?

Provide an answer of your own, or ask Peter Sankauskas for more information if necessary.

To post a message you must log in.