Skip to content

OSX linker segfaulting on Travis #38878

Description

@alexcrichton

I've seen this quite a lot recently

Example logs:

clang: error: unable to execute command: Segmentation fault: 11
clang: error: linker command failed due to signal (use -v to see invocation)

Example Travis runs:

I'm opening a tracking issue so we can collect some more logs and hopefully draw conclusions from them at some point. Until then I'm not really sure how we'd deal with this...

Activity

  1. added
    O-macosOperating system: macOS
    A-spuriousArea: Spurious failures in builds (spuriously == for no apparent reason)
    on Jan 6, 2017
  2. Mark-Simulacrum commented on Jan 11, 2017

    @Mark-Simulacrum
    Member

    Is there a way to collect the coredump from the segfault so we could attempt to track down the reason behind the segfault? Perhaps we could at least pass -v to clang so we could try to reproduce locally?

  3. alexcrichton commented on Jan 11, 2017

    @alexcrichton
    MemberAuthor

    @Mark-Simulacrum your guess is as good as mine!

  4. sfackler commented on Jan 12, 2017

    @sfackler
    Member

    If you set ulimit -c unlimited, the core dump will end up in /cores.

  5. added 3 commits that reference this issue on Jan 13, 2017
  6. alexcrichton commented on Jan 20, 2017

    @alexcrichton
    MemberAuthor

    https://travis-ci.org/rust-lang/rust/jobs/193795162 is the first job where we got a stack trace:

    Core file '/cores/core.31933' (x86_64) was loaded.
    (lldb) command source -s 0 'cmds'
    Executing commands in '/Users/travis/build/rust-lang/rust/cmds'.
    (lldb) bt all
    * thread #1: tid = 0x0000, 0x00007fffaed8519d libsystem_c.dylib`__cxa_finalize_ranges + 369, stop reason = signal SIGSTOP
      * frame #0: 0x00007fffaed8519d libsystem_c.dylib`__cxa_finalize_ranges + 369
    
      thread #2: tid = 0x0001, 0x000000010f9fe5b4 dyld`ImageLoaderMachO::findClosestSymbol(mach_header const*, void const*, void const**) + 264, stop reason = signal SIGSTOP
        frame #0: 0x000000010f9fe5b4 dyld`ImageLoaderMachO::findClosestSymbol(mach_header const*, void const*, void const**) + 264
        frame #1: 0x000000010f9f5444 dyld`dladdr + 133
        frame #2: 0x00007fffaeced99c libdyld.dylib`dladdr + 72
        frame #3: 0x0000000100316647 ld`__assert_rtn + 207
        frame #4: 0x00000001003653c4 ld`ld::tool::InputFiles::parseWorkerThread() + 696
        frame #5: 0x00007fffaef07aab libsystem_pthread.dylib`_pthread_body + 180
        frame #6: 0x00007fffaef079f7 libsystem_pthread.dylib`_pthread_start + 286
        frame #7: 0x00007fffaef07221 libsystem_pthread.dylib`thread_start + 13
    

    I wouldn't necessarily call that... illuminating

  7. Mark-Simulacrum commented on Jan 20, 2017

    @Mark-Simulacrum
    Member

    I wonder if there would be a way to print what the files we're linking are? Maybe that would help since maybe the linker segfaults on an improperly formatted file or something like that; knowing what the files are (names and lengths) may help. I think passing -v to clang would be good enough, at least as a start.

  8. alexcrichton commented on Jan 20, 2017

    @alexcrichton
    MemberAuthor

    PRs are always welcome! I don't have any magical tricks up my sleeves to implement tricks like that unfortunately.

  9. alexcrichton commented on Jan 23, 2017

    @alexcrichton
    MemberAuthor

    Next successful stack trace: https://travis-ci.org/rust-lang/rust/jobs/194499380

    Core file '/cores/core.33216' (x86_64) was loaded.
    (lldb) command source -s 0 'cmds'
    Executing commands in '/Users/travis/build/rust-lang/rust/cmds'.
    (lldb) bt all
    * thread #1: tid = 0x0000, 0x00007fffbb6ec19d libsystem_c.dylib`__cxa_finalize_ranges + 369, stop reason = signal SIGSTOP
        frame #0: 0x00007fffbb6ec19d libsystem_c.dylib`__cxa_finalize_ranges + 369
    * thread #2: tid = 0x0001, 0x00007fffbb786756 libsystem_kernel.dylib`close + 10, stop reason = signal SIGSTOP
        frame #0: 0x00007fffbb786756 libsystem_kernel.dylib`close + 10
        frame #1: 0x0000000106869c10 ld`Snapshot::createSnapshot() + 270
        frame #2: 0x00000001067ac5da ld`__assert_rtn + 98
        frame #3: 0x00000001067fb3c4 ld`ld::tool::InputFiles::parseWorkerThread() + 696
        frame #4: 0x00007fffbb86eaab libsystem_pthread.dylib`_pthread_body + 180
        frame #5: 0x00007fffbb86e9f7 libsystem_pthread.dylib`_pthread_start + 286
        frame #6: 0x00007fffbb86e221 libsystem_pthread.dylib`thread_start + 13
    
  10. steveklabnik commented on Feb 14, 2017

    @steveklabnik
    Contributor
  11. arielb1 commented on Mar 2, 2017

    @arielb1
    Contributor

    These look like assertion failures:

        frame #2: 0x0000000107ac45da ld`__assert_rtn + 98
        frame #3: 0x00000001067fb3c4 ld`ld::tool::InputFiles::parseWorkerThread() + 696
    

    Now the question is how we recover the assert message. Any Mac person knows of a way?

  12. 4 remaining items

  13. added 2 commits that reference this issue on Mar 10, 2017
  14. added a commit that references this issue on Mar 10, 2017
  15. added a commit that references this issue on Mar 10, 2017
  16. added a commit that references this issue on Mar 11, 2017
  17. added a commit that references this issue on Mar 11, 2017
  18. alexcrichton commented on Mar 23, 2017

    @alexcrichton
    MemberAuthor

    Looks like #40422 did the trick, we haven't seen this in ~2 weeks, so closing.

  19. added a commit that references this issue on Nov 18, 2017
    1f491e0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-spuriousArea: Spurious failures in builds (spuriously == for no apparent reason)O-macosOperating system: macOS

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions