[MacPorts] #36490: cctools: lipo assertion failure and crash
#36490: cctools: lipo assertion failure and crash --------------------------+------------------------ Reporter: ryandesign@… | Owner: jeremyhu@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Keywords: | Port: cctools --------------------------+------------------------ lipo is crashing again with an assertion failure on certain input files (files less than 4 bytes long). This is like #36081, except that rebuilding cctools has not helped. {{{ $ echo hi > a $ /usr/bin/lipo -info a /usr/bin/lipo: can't figure out the architecture type of: a $ /opt/local/bin/lipo -info a Assertion failed: (length >=4 && "Invalid magic number length"), function IdentifyFileType, file Path.cpp, line 44. Abort trap: 6 $ echo -n four > a $ /opt/local/bin/lipo -info a /opt/local/bin/lipo: can't figure out the architecture type of: a $ port provides $(which lipo) /opt/local/bin/lipo is provided by: cctools $ port installed cctools The following ports are currently installed: cctools @829_1+llvm31+universal (active) $ }}} -- Ticket URL: <https://trac.macports.org/ticket/36490> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36490: cctools: lipo assertion failure and crash ---------------------------+------------------------ Reporter: ryandesign@… | Owner: jeremyhu@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: cctools | ---------------------------+------------------------ Comment (by jeremyhu@…): This is slightly different than #36081, although it's tripping over the same assertion. This has to do with the size of the file. llvm-3.1 doesn't like that it's too small. It tries to read a 4-byte magic number, but your file is only 3 bytes. {{{ ~ $ /bin/echo -n "1234" > b ~ $ /opt/local/bin/lipo -info b /opt/local/bin/lipo: can't figure out the architecture type of: b ~ $ /bin/echo -n "123" > b ~ $ /opt/local/bin/lipo -info b Assertion failed: (length >=4 && "Invalid magic number length"), function IdentifyFileType, file Path.cpp, line 44. Abort trap: 6 }}} -- Ticket URL: <https://trac.macports.org/ticket/36490#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36490: cctools: lipo assertion failure and crash ---------------------------+------------------------ Reporter: ryandesign@… | Owner: jeremyhu@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: cctools | ---------------------------+------------------------ Comment (by jeremyhu@…): {{{ Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x00007fff8a004212 __pthread_kill + 10 1 libsystem_c.dylib 0x00007fff888a8af4 pthread_kill + 90 2 libLLVM-3.1.dylib 0x000000010b92baa6 abort + 22 3 libLLVM-3.1.dylib 0x000000010b92ba81 __assert_rtn + 81 4 libLLVM-3.1.dylib 0x000000010b91f285 llvm::sys::IdentifyFileType(char const*, unsigned int) + 725 5 libLTO.dylib 0x000000010af22269 LTOModule::isBitcodeFile(void const*, unsigned long) + 9 6 libLTO.dylib 0x000000010af251a9 lto_module_is_object_file_in_memory + 9 7 lipo 0x000000010aee1bb4 is_llvm_bitcode_from_memory + 702 8 lipo 0x000000010aedb539 main + 5501 9 libdyld.dylib 0x00007fff849d27e1 start + 1 }}} -- Ticket URL: <https://trac.macports.org/ticket/36490#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36490: cctools: lipo assertion failure and crash ---------------------------+------------------------ Reporter: ryandesign@… | Owner: jeremyhu@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: cctools | ---------------------------+------------------------ Comment (by jeremyhu@…): Note that /usr/bin/lipo does not use LTO which is why it does not hit this assertion, but if you use xcrun lipo, it will use LTO and fails with the same assertion: {{{ $ xcrun lipo -info b Assertion failed: (length >=4 && "Invalid magic number length"), function IdentifyFileType, file Path.cpp, line 44. Abort trap: 6 }}} -- Ticket URL: <https://trac.macports.org/ticket/36490#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36490: cctools: lipo assertion failure and crash ---------------------------+------------------------ Reporter: ryandesign@… | Owner: jeremyhu@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: cctools | ---------------------------+------------------------ Comment (by jeremyhu@…): Oh wait, that was actually resulting in /opt/local/bin/lipo being run. FWIW, replacing llvm-3.1's libLTO with XCode's "fixes" the issue, so we should just fix this in llvm. I'm seeing this with llvm-2.9 through llvm-3.2's libLTO. -- Ticket URL: <https://trac.macports.org/ticket/36490#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36490: cctools: lipo assertion failure and crash ---------------------------+------------------------ Reporter: ryandesign@… | Owner: jeremyhu@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: cctools | ---------------------------+------------------------ Comment (by jeremyhu@…): Ok, it passes with the host's libLTO because the host has assertions disabled ... -- Ticket URL: <https://trac.macports.org/ticket/36490#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36490: cctools: lipo assertion failure and crash ---------------------------+------------------------ Reporter: ryandesign@… | Owner: jeremyhu@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: cctools | ---------------------------+------------------------ Comment (by jeremyhu@…): <rdar://problem/12448054> -- Ticket URL: <https://trac.macports.org/ticket/36490#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36490: cctools: lipo assertion failure and crash ---------------------------+------------------------ Reporter: ryandesign@… | Owner: jeremyhu@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: cctools | ---------------------------+------------------------ Comment (by jeremyhu@…): If you rebuild llvm-3.1 without the +assertions variant, I expect the issue should go away for you. -- Ticket URL: <https://trac.macports.org/ticket/36490#comment:7> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36490: cctools: lipo assertion failure and crash ---------------------------+------------------------ Reporter: ryandesign@… | Owner: jeremyhu@… Type: defect | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: llvm-3.1 | ---------------------------+------------------------ Changes (by jeremyhu@…): * status: new => assigned * port: cctools => llvm-3.1 -- Ticket URL: <https://trac.macports.org/ticket/36490#comment:8> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36490: cctools: lipo assertion failure and crash ---------------------------+------------------------ Reporter: ryandesign@… | Owner: jeremyhu@… Type: defect | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: | Keywords: Port: llvm-3.1 | ---------------------------+------------------------ Changes (by mfeiri@…): * cc: mfeiri@… (removed) -- Ticket URL: <https://trac.macports.org/ticket/36490#comment:9> MacPorts <http://www.macports.org/> Ports system for Mac OS
#36490: cctools: lipo assertion failure and crash ---------------------------+------------------------ Reporter: ryandesign@… | Owner: jeremyhu@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.1.2 Resolution: fixed | Keywords: Port: llvm-3.1 | ---------------------------+------------------------ Changes (by jeremyhu@…): * status: assigned => closed * resolution: => fixed -- Ticket URL: <https://trac.macports.org/ticket/36490#comment:10> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts