Re: [GHC] #4318: Crash while building HEAD on OS X
#4318: Crash while building HEAD on OS X --+- Reporter: gwright | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.2.1 Component: Compiler |Version: 6.13 Resolution: fixed| Keywords: Testcase: | Blockedby: Difficulty: | Os: MacOS X Blocking: | Architecture: x86_64 (amd64) Failure: Building GHC failed | --+- Changes (by igloo): * status: new = closed * resolution: = fixed Comment: Thanks, Greg. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/4318#comment:22 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #4318: Crash while building HEAD on OS X
#4318: Crash while building HEAD on OS X ---+ Reporter: gwright |Owner: Type: bug | Status: new Priority: normal |Milestone: 7.2.1 Component: Compiler| Version: 6.13 Keywords: | Testcase: Blockedby: | Difficulty: Os: MacOS X | Blocking: Architecture: x86_64 (amd64) | Failure: Building GHC failed ---+ Comment(by gwright): This bug should be closed. The patch that fixed most of the problem (incorrect lookup of external symbols) was applied although I didn't attach the patch to this ticket. The most obvious remaining linker bug was repaired by #4867. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/4318#comment:21 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #4318: Crash while building HEAD on OS X
#4318: Crash while building HEAD on OS X ---+ Reporter: gwright |Owner: Type: bug | Status: new Priority: normal |Milestone: 7.0.1 Component: Compiler| Version: 6.13 Keywords: | Testcase: Blockedby: | Difficulty: Os: MacOS X | Blocking: Architecture: x86_64 (amd64) | Failure: Building GHC failed ---+ Comment(by simonmar): Often it's obvious when several tests are failing for the same reason - identical error messages for instance - in this case file a single ticket for all the failures. If you're not sure, or the error message is generic (e.g. segfault) then file separate tickets. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/4318#comment:18 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #4318: Crash while building HEAD on OS X
#4318: Crash while building HEAD on OS X ---+ Reporter: gwright |Owner: Type: bug | Status: new Priority: normal |Milestone: 7.0.1 Component: Compiler| Version: 6.13 Keywords: | Testcase: Blockedby: | Difficulty: Os: MacOS X | Blocking: Architecture: x86_64 (amd64) | Failure: Building GHC failed ---+ Comment(by gwright): The result of running the testsuite on the complete build: {{{ OVERALL SUMMARY for test run started at Tue Oct 19 21:32:59 EDT 2010 2610 total tests, which gave rise to 9754 test cases, of which 0 caused framework failures 1864 were skipped 7544 expected passes 248 expected failures 2 unexpected passes 96 unexpected failures Unexpected passes: simplrun006(optc,optasm) Unexpected failures: 1372(normal) 1959(normal) 2578(normal) 4038(ghci) CPUTime001(optc,optasm,ghci,threaded2) IPRun(normal,optc,hpc,optasm,ghci,threaded1,threaded2) T1735(ghci) T1969(normal) T3007(normal) T3245(normal,optc,hpc,optasm,threaded1,threaded2) T3294(normal) T4059(normal) ThreadDelay001(threaded1,threaded2) apirecomp001(normal) arith005(ghci) arith012(ghci) arith015(ghci) break001(ghci) break006(ghci) bug1465(normal) cabal01(normal) cabal04(normal) cgrun014(ghci) cgrun034(ghci) cgrun044(ghci) cholewo-eval(ghci) derefnull(normal,optc,hpc,optasm,ghci,threaded1,threaded2) driver062a(normal) driver062b(normal) driver062c(normal) driver062d(normal) driver062e(normal) driver081a(normal) driver081b(normal) dynamic_flags_001(normal) gadt23(normal) ghcpkg05(normal) hClose003(threaded2) hpc_markup_multi_001(normal) hpc_markup_multi_002(normal) hpc_markup_multi_003(normal) hs-boot(normal,optc,hpc,optasm) mod179(normal) num010(ghci) numrun014(ghci) outofmem(normal) print019(ghci) process003(threaded2) prog003(ghci) rand001(ghci) readRun002(ghci) readRun003(ghci) recomp001(normal) recomp004(normal) recomp007(normal) rn.prog006(normal) rtsOpts(normal) showDouble(ghci) signals002(ghci) signals004(ghci,threaded1,threaded2) tc003(hpc) tcfail138(normal) tcrun020(normal,optc,hpc,optasm,ghci,threaded1,threaded2) withRtsOpts(normal) }}} More failed tests than showed up with the `validate` script. Overall, the situation doesn't look too bad, though. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/4318#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #4318: Crash while building HEAD on OS X
#4318: Crash while building HEAD on OS X ---+ Reporter: gwright |Owner: Type: bug | Status: new Priority: normal |Milestone: 7.0.1 Component: Compiler| Version: 6.13 Keywords: | Testcase: Blockedby: | Difficulty: Os: MacOS X | Blocking: Architecture: x86_64 (amd64) | Failure: Building GHC failed ---+ Comment(by simonmar): Looks good, though of course we should be aiming to get the failing tests to be exactly the same as the Linux builds. FYI last night's HEAD build results: {{{ Unexpected failures: IndTypesPerf(normal) T1735(ghci) T1969(normal) T3294(normal) T3330a(normal) hpc_markup_multi_001(normal) hpc_markup_multi_002(normal) hpc_markup_multi_003(normal) tc003(hpc,profc,profasm) }}} -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/4318#comment:16 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #4318: Crash while building HEAD on OS X
#4318: Crash while building HEAD on OS X ---+ Reporter: gwright |Owner: Type: bug | Status: new Priority: normal |Milestone: 7.0.1 Component: Compiler| Version: 6.13 Keywords: | Testcase: Blockedby: | Difficulty: Os: MacOS X | Blocking: Architecture: x86_64 (amd64) | Failure: Building GHC failed ---+ Comment(by gwright): Replying to [comment:16 simonmar]: Looks good, though of course we should be aiming to get the failing tests to be exactly the same as the Linux builds. FYI last night's HEAD build results... Toward that end, should I file a bug for each test failure separately, or make some attempt to bundle them into groups of related failures? One bug per test case has the advantage of being easy to parcel out. Now that we can build 64 bit on OS X SL, we should be able to involve more people in bug hunts. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/4318#comment:17 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #4318: Crash while building HEAD on OS X
#4318: Crash while building HEAD on OS X ---+ Reporter: gwright |Owner: Type: bug | Status: new Priority: normal |Milestone: 7.0.1 Component: Compiler| Version: 6.13 Keywords: | Testcase: Blockedby: | Difficulty: Os: MacOS X | Blocking: Architecture: x86_64 (amd64) | Failure: Building GHC failed ---+ Comment(by gwright): Okay, my changes to Linker.c merged into a fresh pull from 18 Oct 2010 are quite encouraging. Here's the results of the validate script (with stop on error disabled in `mk/validate.mk`): {{{ OVERALL SUMMARY for test run started at Tue Oct 19 20:38:56 EDT 2010 2610 total tests, which gave rise to 9751 test cases, of which 0 caused framework failures 7444 were skipped 2194 expected passes 79 expected failures 1 unexpected passes 33 unexpected failures Unexpected passes: simplrun006(optc) Unexpected failures: 1372(normal) 1959(normal) 2578(normal) T1969(normal) T3007(normal) T3245(normal) T3294(normal) T4059(normal) break001(ghci) break006(ghci) bug1465(normal) cabal01(normal) cabal04(normal) derefnull(normal) driver062a(normal) driver062b(normal) driver062c(normal) driver062d(normal) driver062e(normal) driver081a(normal) driver081b(normal) gadt23(normal) ghcpkg05(normal) hs-boot(normal) mod179(normal) outofmem(normal) print019(ghci) prog003(ghci) recomp004(normal) rn.prog006(normal) rtsOpts(normal) tcfail138(normal) withRtsOpts(normal) --- Oops! Looks like you have some unexpected test results or framework failures. Please fix them before pushing/sending patches. --- }}} Before the changes to Linker.c, every ghci test ended in a segfault or abort trap. I'll tidy the debug messages I added and send the patch upstream tomorrow. I'll also run a full build and the testsuite. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/4318#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #4318: Crash while building HEAD on OS X
#4318: Crash while building HEAD on OS X ---+ Reporter: gwright |Owner: Type: bug | Status: new Priority: normal |Milestone: 7.0.1 Component: Compiler| Version: 6.13 Keywords: | Testcase: Blockedby: | Difficulty: Os: MacOS X | Blocking: Architecture: x86_64 (amd64) | Failure: Building GHC failed ---+ Comment(by gwright): For completeness, the ghc version in the above was 7.1.20101018. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/4318#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #4318: Crash while building HEAD on OS X
#4318: Crash while building HEAD on OS X ---+ Reporter: gwright |Owner: Type: bug | Status: new Priority: normal |Milestone: 7.0.1 Component: Compiler| Version: 6.13 Keywords: | Testcase: Blockedby: | Difficulty: Os: MacOS X | Blocking: Architecture: x86_64 (amd64) | Failure: Building GHC failed ---+ Comment(by gwright): Now I know what the bug is: relocations of type `X86_64_RELOC_GOT` and `X86_64_RELOC_GOT_LOAD` are not handled by the Mach-O linker. There is a stub of code for these cases, but it does something nonsensical. I'm guessing it was simply never finished. This doesn't seem too hard to fix, but it's fiddly. If I'm lucky and my current hunch works, maybe a patch in a couple of days. Otherwise, I'll need to try to understand Apple's ld64 code to understand these relocations in more detail. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/4318#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #4318: Crash while building HEAD on OS X
#4318: Crash while building HEAD on OS X ---+ Reporter: gwright |Owner: Type: bug | Status: new Priority: normal |Milestone: 7.0.1 Component: Compiler| Version: 6.13 Keywords: | Testcase: Blockedby: | Difficulty: Os: MacOS X | Blocking: Architecture: x86_64 (amd64) | Failure: Building GHC failed ---+ Comment(by gwright): I have ghci from HEAD working, built 64 bit on OS X 10.6. At least it works well enough to define `fact` and `fib` at the prompt and get the right answers. (Certainly an improvement over a segfault or abort trap!) I'll resync with HEAD and apply my patches, then run the testsuite. There may still be some other problems with the linker lurking, since there have clearly been paths through the code that were never exercised in the 64 bit Mach-O case. The final change to fix the crash wasn't much; better to be lucky than smart. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/4318#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #4318: Crash while building HEAD on OS X
#4318: Crash while building HEAD on OS X ---+ Reporter: gwright |Owner: Type: bug | Status: new Priority: normal |Milestone: 7.0.1 Component: Compiler| Version: 6.13 Keywords: | Testcase: Blockedby: | Difficulty: Os: MacOS X | Blocking: Architecture: x86_64 (amd64) | Failure: Building GHC failed ---+ Comment(by gwright): At last some progress: there's more than one bug here, and I've located and fixed one of them. The check for `symbol-n_value == 0` in `relocateSection` is just wrong. (In fact, according to the header file comments and my reading of the Mach-O object file format, it is simply nonsensical.) This is probably a remnant of the original reverse- engineering approach used to get the Mach-O linker going. I've fixed it to check the `symbol-n_type` flags correctly. I still don't know why the RTS symbols are not being resolved. It's not a failure to find the RTS symbols, instead, it appears as if there is no attempt to look them up at all. I've added extensive debugging output to the Mach-O linker and will include them with my eventual patch. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/4318#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #4318: Crash while building HEAD on OS X
#4318: Crash while building HEAD on OS X ---+ Reporter: gwright |Owner: Type: bug | Status: new Priority: normal |Milestone: 7.0.1 Component: Compiler| Version: 6.13 Keywords: | Testcase: Blockedby: | Difficulty: Os: MacOS X | Blocking: Architecture: x86_64 (amd64) | Failure: Building GHC failed ---+ Changes (by igloo): * milestone: = 7.0.1 -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/4318#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #4318: Crash while building HEAD on OS X
#4318: Crash while building HEAD on OS X ---+ Reporter: gwright |Owner: Type: bug | Status: new Priority: normal |Milestone: Component: Compiler| Version: 6.13 Keywords: | Testcase: Blockedby: | Difficulty: Os: MacOS X | Blocking: Architecture: x86_64 (amd64) | Failure: Building GHC failed ---+ Comment(by simonmar): The author of the Mach-O linker was a bit light on the debugging output. I see a couple of `debugBelch` calls in there, but that's all. I think you'll need to add some more debug output to see what's going on, or debug it directly in gdb. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/4318#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #4318: Crash while building HEAD on OS X
#4318: Crash while building HEAD on OS X ---+ Reporter: gwright |Owner: Type: bug | Status: new Priority: normal |Milestone: Component: Compiler| Version: 6.13 Keywords: | Testcase: Blockedby: | Difficulty: Os: MacOS X | Blocking: Architecture: x86_64 (amd64) | Failure: Building GHC failed ---+ Comment(by gwright): This does appear to be a linker bug. I can reproduce it just by running `ghc-stage2 --interactive`. The incorrectly resolved symbol is `_stg_bh_upd_frame_info`. This address is pushed on the stack in `_base_GHCziIOziHandleziFD_stdin_info` (referenced in `initInterpBuffering`). `_stg_bh_upd_frame_info` is resolved as zero, and when the null pointer on the stack is dereferenced the crash occurs. In the simple case of just trying to start `ghc-stage2` interactively, it happens when `threadPaused` scans the stack. I'll try `+RTS -Dl` and report what I find. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/4318#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #4318: Crash while building HEAD on OS X
#4318: Crash while building HEAD on OS X ---+ Reporter: gwright |Owner: Type: bug | Status: new Priority: normal |Milestone: Component: Compiler| Version: 6.13 Keywords: | Testcase: Blockedby: | Difficulty: Os: MacOS X | Blocking: Architecture: x86_64 (amd64) | Failure: Building GHC failed ---+ Comment(by gwright): I rebuilt ghc-stage2 according to SimonM's instructions above. The additional output is meagre and unilluminating. I get {{{ redwing-apache:ghc gwright$ inplace/bin/ghc-stage2 --interactive +RTS -Dl GHCi, version 6.13.20100904: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... loadObj /Users/gwright/tmp/ghc/libraries/ghc- prim/dist-install/build/HSghc-prim-0.2.0.0.o linking ... done. Loading package integer-gmp ... loadObj /Users/gwright/tmp/ghc/libraries /integer-gmp/dist-install/build/HSinteger-gmp-0.2.0.0.o linking ... done. Loading package base ... addDLL: dll_name = 'libiconv.dylib' internal_dlopen: dll_name = 'libiconv.dylib' loadObj /Users/gwright/tmp/ghc/libraries/base/dist- install/build/HSbase-4.3.0.0.o linking ... done. Loading package ffi-1.0 ... loadObj /Users/gwright/tmp/ghc/libffi/dist- install/build/HSffi.o linking ... done. Segmentation fault }}} This isn't telling me much. Is there an enhanced interrogation method to make the linker tell us what it's been up to? -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/4318#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #4318: Crash while building HEAD on OS X
#4318: Crash while building HEAD on OS X ---+ Reporter: gwright |Owner: Type: bug | Status: new Priority: normal |Milestone: Component: Compiler| Version: 6.13 Keywords: | Testcase: Blockedby: | Difficulty: Os: MacOS X | Blocking: Architecture: x86_64 (amd64) | Failure: Building GHC failed ---+ Changes (by PHO): * cc: p...@… (added) -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/4318#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #4318: Crash while building HEAD on OS X
#4318: Crash while building HEAD on OS X ---+ Reporter: gwright |Owner: Type: bug | Status: new Priority: normal |Milestone: Component: Compiler| Version: 6.13 Keywords: | Testcase: Blockedby: | Difficulty: Os: MacOS X | Blocking: Architecture: x86_64 (amd64) | Failure: Building GHC failed ---+ Comment(by simonmar): I expect it's a bug in the linker. `newDynCAF` is a clue that you're running dynamically-loaded code, and it looks like the code has tried to jump to address zero: probably an address that should have been patched by the linker. You can turn on verbose debug output in the linker by compiling stage2 with debugging on (`cd ghc; rm stage2/build/tmp/ghc-stage2; make 2 GhcDebugged=YES`), and then run it with `+RTS -Dl`. That will show you details about all the object files and relocations. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/4318#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #4318: Crash while building HEAD on OS X
#4318: Crash while building HEAD on OS X ---+ Reporter: gwright | Owner: Type: bug | Status: new Priority: normal | Component: Compiler Version: 6.13|Keywords: Testcase: | Blockedby: Os: MacOS X |Blocking: Architecture: x86_64 (amd64) | Failure: Building GHC failed ---+ Comment(by gwright): In the synthetic backtrace I gave, the crash occurs at the bottom. This is opposite from the usual way a C stack is shown in gdb. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/4318#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #4318: Crash while building HEAD on OS X
#4318: Crash while building HEAD on OS X ---+ Reporter: gwright | Owner: Type: bug | Status: new Priority: normal | Component: Compiler Version: 6.13|Keywords: Testcase: | Blockedby: Os: MacOS X |Blocking: Architecture: x86_64 (amd64) | Failure: Building GHC failed ---+ Comment(by gwright): Another piece of information is that the crash occurs not long after the last library (`ffi-1.0`) is loaded. If I set breakpoints at `loadObj` and `stg_ap_p_info` before starting the program, when loading `ffi-1.0` I've hit the `stg_ap_p_info` breakpoint 208833 times. The crash occurs after hitting `stg_ap_p_info` 209211 times. So the failure happens (relatively) quickly after the libraries are loaded. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/4318#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs