|
#5899: RTS crash w/ strange closure type 603975781 on OS X 10.8
-----------------------------------------------------------+---------------- Reporter: dylukes | Owner: Type: bug | Status: new Priority: high | Milestone: 7.4.2 Component: Runtime System | Version: 7.4.1 Keywords: rts, strange closure, internal error, os x | Os: MacOS X Architecture: x86_64 (amd64) | Failure: Runtime crash Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | -----------------------------------------------------------+---------------- Comment(by Irene): Hm, not sure how to attach a file. See [http://ireneknapp.com/himitsu/still-a-problem.tar.bz2] for the aforementioned dumps. -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5899#comment:20> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list [hidden email] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs |
|
In reply to this post by GHC
#5899: RTS crash w/ strange closure type 603975781 on OS X 10.8
-----------------------------------------------------------+---------------- Reporter: dylukes | Owner: Type: bug | Status: new Priority: high | Milestone: 7.4.2 Component: Runtime System | Version: 7.4.1 Keywords: rts, strange closure, internal error, os x | Os: MacOS X Architecture: x86_64 (amd64) | Failure: Runtime crash Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | -----------------------------------------------------------+---------------- Comment(by simonmar): I think you only forced ordering for the `Main.o` module, and not the libraries or the RTS, correct? I observed the ordering being mangled for one object file in the `base` package, so you would need to force the correct order for all the symbols in the libraries too. -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5899#comment:21> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list [hidden email] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs |
|
In reply to this post by GHC
#5899: RTS crash w/ strange closure type 603975781 on OS X 10.8
-----------------------------------------------------------+---------------- Reporter: dylukes | Owner: Type: bug | Status: new Priority: high | Milestone: 7.4.2 Component: Runtime System | Version: 7.4.1 Keywords: rts, strange closure, internal error, os x | Os: MacOS X Architecture: x86_64 (amd64) | Failure: Runtime crash Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | -----------------------------------------------------------+---------------- Comment(by Irene): Yes, that is correct - I didn't think of doing it for libraries and the RTS. I'll put together another test that does, and report back. Good catch! -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5899#comment:22> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list [hidden email] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs |
|
In reply to this post by GHC
#5899: RTS crash w/ strange closure type 603975781 on OS X 10.8
-----------------------------------------------------------+---------------- Reporter: dylukes | Owner: Type: bug | Status: new Priority: high | Milestone: 7.4.2 Component: Runtime System | Version: 7.4.1 Keywords: rts, strange closure, internal error, os x | Os: MacOS X Architecture: x86_64 (amd64) | Failure: Runtime crash Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | -----------------------------------------------------------+---------------- Comment(by Irene): I did the more thorough test, and the trivial program runs without a crash, producing correct output. Excellent! This means that the problem does indeed consist only of the TNTC thing, which is what I was trying to verify. -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5899#comment:23> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list [hidden email] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs |
|
In reply to this post by GHC
#5899: RTS crash w/ strange closure type 603975781 on OS X 10.8
-----------------------------------------------------------+---------------- Reporter: dylukes | Owner: Type: bug | Status: new Priority: high | Milestone: 7.4.2 Component: Runtime System | Version: 7.4.1 Keywords: rts, strange closure, internal error, os x | Os: MacOS X Architecture: x86_64 (amd64) | Failure: Runtime crash Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | -----------------------------------------------------------+---------------- Comment(by simonmar): One thought occurred to me: maybe if we set the size of the `_dsp` symbol to be the size of the info table plus the size of the code, that would prevent `ld` from separating them. But, as far as I can tell, symbols do not have sizes in Mach-O. I'm a bit bemused at how the linker can get away with reordering code within an object file. The behaviour seems to be inconsistent with the man page for ld, which says The object files are loaded in the order in which they are specified on the command line. The segments and the sections in those segments will appear in the output file in the order they are encountered in the object files being linked. [...] The use of the -order_file option will alter the layout rules above, and move the symbols specified to start of their section. which doesn't explicitly say that code within a section will not be reordered, but it strongly implies that. -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5899#comment:24> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list [hidden email] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs |
|
In reply to this post by GHC
#5899: RTS crash w/ strange closure type 603975781 on OS X 10.8
-----------------------------------------------------------+---------------- Reporter: dylukes | Owner: Type: bug | Status: new Priority: high | Milestone: 7.4.2 Component: Runtime System | Version: 7.4.1 Keywords: rts, strange closure, internal error, os x | Os: MacOS X Architecture: x86_64 (amd64) | Failure: Runtime crash Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | -----------------------------------------------------------+---------------- Comment(by chak): Replying to [comment:24 simonmar]: > I'm a bit bemused at how the linker can get away with reordering code within an object file. The behaviour seems to be inconsistent with the man page for ld, which says > > The object files are loaded in the order in which they are specified on > the command line. The segments and the sections in those segments will > appear in the output file in the order they are encountered in the object > files being linked. > [...] > The use of the -order_file option will alter the layout rules above, and > move the symbols specified to start of their section. > > which doesn't explicitly say that code within a section will not be reordered, but it strongly implies that. But don't the `-no_order_inits` and `-no_order_data` options make it clear that reordering within sections is happening? In fact, can't we use `-order_file` to solve this problem once and for all? -order_file file Alters the order in which functions and data are laid out. For each section in the output file, any symbol in that sec- tion that are specified in the order file file is moved to the start of its section and laid out in the same order as in the order file file. Order files are text files with one symbol name per line. Lines starting with a # are comments. A symbol name may be optionally preceded with its object file leaf name and a colon (e.g. foo.o:_foo). This is useful for static functions/data that occur in multiple files. A symbol name may also be optionally preceded with the architecture (e.g. ppc:_foo or ppc:foo.o:_foo). This enables you to have one order file that works for multiple architectures. Lit- eral c-strings may be ordered by by quoting the string (e.g. "Hello, world\n") in the order file. In fact, the man page makes it sound as if we can achieve TNTC without any hacks using an order file on OS X. Or am I missing something? -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5899#comment:25> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list [hidden email] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs |
|
In reply to this post by GHC
#5899: RTS crash w/ strange closure type 603975781 on OS X 10.8
-----------------------------------------------------------+---------------- Reporter: dylukes | Owner: Type: bug | Status: new Priority: high | Milestone: 7.4.2 Component: Runtime System | Version: 7.4.1 Keywords: rts, strange closure, internal error, os x | Os: MacOS X Architecture: x86_64 (amd64) | Failure: Runtime crash Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | -----------------------------------------------------------+---------------- Comment(by Irene): Well, we can indeed do it with an order file, but it's unwieldy to have to construct one that encompasses every single module being linked, and then it breaks again if linked again, as for example happens if we build a Haskell library that an innocent and well-meaning author tries to link into a C program without GHC's involvement. Actually, I'm not sure how we can make that scenario work even with some sort of way to tell LLVM explicitly about TNTC, since the Mach-O format doesn't have any way to express that constraint, so it will never survive to a second linking. But the main reason to not use an order file is that the reordering probably actually does provide a good benefit, since (I assume but nobody's actually explained it that I've seen) it does things such as providing additional code locality so as to keep things within the processor's instruction cache more often. It can also do whole-program dead-code removal. This sort of feature, which the LLVM people call link- time optimization (LTO), is defeated if we tell it it can't actually do anything. -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5899#comment:26> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list [hidden email] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs |
|
In reply to this post by GHC
#5899: RTS crash w/ strange closure type 603975781 on OS X 10.8
-----------------------------------------------------------+---------------- Reporter: dylukes | Owner: Type: bug | Status: new Priority: high | Milestone: 7.4.2 Component: Runtime System | Version: 7.4.1 Keywords: rts, strange closure, internal error, os x | Os: MacOS X Architecture: x86_64 (amd64) | Failure: Runtime crash Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | -----------------------------------------------------------+---------------- Comment(by simonmar): Regarding the documentation, the documentation for `-no_order_inits` says When the -order_file option is not used, the linker lays out functions in object file order and it moves all initializer routines to the start of the __text section and terminator routines to the end. Use this option to disable the automatic rearrangement of initializers and terminators. So this explicitly says that functions are laid out in "object file order" when `-order_file` is ''not'' used. Either the documentation is wrong, or the implementation has a bug. In principle we could use `-order_file`, but as Irene says it is difficult to arrange. We don't know the list of symbols before linking because they come from libraries, so we would have to link the program twice: once to find the list of object files, then construct the symbol list by looking up the object files in the libraries, and then link again with `-order_file` and the constructed list of symbols. This could all be quite slow. Irene: I don't think reordering is gaining us anything. The linker doesn't have any locality information that it could use to do a sensible reordering. I suspect that all it is doing is filling in gaps caused by alignment with small symbols to reduce the size of the linked binary a tiny bit. -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5899#comment:27> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list [hidden email] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs |
|
In reply to this post by GHC
#5899: RTS crash w/ strange closure type 603975781 on OS X 10.8
-----------------------------------------------------------+---------------- Reporter: dylukes | Owner: Type: bug | Status: new Priority: high | Milestone: 7.4.2 Component: Runtime System | Version: 7.4.1 Keywords: rts, strange closure, internal error, os x | Os: MacOS X Architecture: x86_64 (amd64) | Failure: Runtime crash Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | -----------------------------------------------------------+---------------- Changes (by simonpj): * cc: gdr@… (added) Comment: We seem stuck here. Mabye it's even a linker bug. * It is documented not to do this * Surely other systems also rely on the linker not randomly re-laying out code We could do with help from a linker expert. Gaby dos Reis perhaps? Simon -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5899#comment:28> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list [hidden email] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs |
|
In reply to this post by GHC
#5899: RTS crash w/ strange closure type 603975781 on OS X 10.8
-----------------------------------------------------------+---------------- Reporter: dylukes | Owner: Type: bug | Status: new Priority: high | Milestone: 7.4.2 Component: Runtime System | Version: 7.4.1 Keywords: rts, strange closure, internal error, os x | Os: MacOS X Architecture: x86_64 (amd64) | Failure: Runtime crash Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | -----------------------------------------------------------+---------------- Comment(by lukexi): Hi guys, I'm very happy to report that this seems to be fixed using the new Haskell Platform release 2012.2.0.0! The test program above runs perfectly, and my multithreaded server I originally ran into the 'strange closure type' issue with runs wonderfully as well. Hurray! I'm on ML DP3 (Build 12A206j), with Xcode 4.4 DP4. {{{ lukexi@Luke-Ianninis-MacBook-Air:~/ghctest2$ echo 'main = print $ reverse [1,2,3]' > Main.hs lukexi@Luke-Ianninis-MacBook-Air:~/ghctest2$ ghc Main [1 of 1] Compiling Main ( Main.hs, Main.o ) Linking Main ... lukexi@Luke-Ianninis-MacBook-Air:~/ghctest2$ ./Main [3,2,1] lukexi@Luke-Ianninis-MacBook-Air:~/ghctest2$ }}} {{{ lukexi@Luke-Ianninis-MacBook-Air:~/ghctest2$ ghc --version The Glorious Glasgow Haskell Compilation System, version 7.4.1 lukexi@Luke-Ianninis-MacBook-Air:~/ghctest2$ ld -v @(#)PROGRAM:ld PROJECT:ld64-132.11 configured to support archs: armv6 armv7 i386 x86_64 LTO support using: LLVM version 3.1svn, from Apple Clang 4.0 (build 421.0.31) lukexi@Luke-Ianninis-MacBook-Air:~/ghctest2$ gcc --version i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00) Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. }}} -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5899#comment:29> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list [hidden email] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs |
|
In reply to this post by GHC
#5899: RTS crash w/ strange closure type 603975781 on OS X 10.8
-----------------------------------------------------------+---------------- Reporter: dylukes | Owner: Type: bug | Status: new Priority: high | Milestone: 7.4.2 Component: Runtime System | Version: 7.4.1 Keywords: rts, strange closure, internal error, os x | Os: MacOS X Architecture: x86_64 (amd64) | Failure: Runtime crash Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | -----------------------------------------------------------+---------------- Comment(by simonmar): That's good news. However we don't know what made the problem go away, so it's possible it might re-emerge. Let's keep the ticket open until we can verify whether our 7.4.2 distributions work on 10.8. -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5899#comment:30> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list [hidden email] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs |
|
In reply to this post by GHC
#5899: RTS crash w/ strange closure type 603975781 on OS X 10.8
-----------------------------------------------------------+---------------- Reporter: dylukes | Owner: Type: bug | Status: new Priority: high | Milestone: 7.4.2 Component: Runtime System | Version: 7.4.1 Keywords: rts, strange closure, internal error, os x | Os: MacOS X Architecture: x86_64 (amd64) | Failure: Runtime crash Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | -----------------------------------------------------------+---------------- Comment(by igloo): But the HP contains exactly the same GHC that didn't work, doesn't it? Isn't it more likely that the newer versions of OS X stuff fixed the linker? -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5899#comment:31> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list [hidden email] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs |
|
In reply to this post by GHC
#5899: RTS crash w/ strange closure type 603975781 on OS X 10.8
-----------------------------------------------------------+---------------- Reporter: dylukes | Owner: Type: bug | Status: new Priority: high | Milestone: 7.4.2 Component: Runtime System | Version: 7.4.1 Keywords: rts, strange closure, internal error, os x | Os: MacOS X Architecture: x86_64 (amd64) | Failure: Runtime crash Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | -----------------------------------------------------------+---------------- Comment(by simonmar): I've been updating my Mac to the latest 10.8 and XCode, so hopefully I'll be able to answer that soon. -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5899#comment:32> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list [hidden email] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs |
|
In reply to this post by GHC
#5899: RTS crash w/ strange closure type 603975781 on OS X 10.8
-----------------------------+---------------------------------------------- Reporter: dylukes | Owner: Type: bug | Status: closed Priority: high | Milestone: 7.4.2 Component: Runtime System | Version: 7.4.1 Resolution: worksforme | Keywords: rts, strange closure, internal error, os x Os: MacOS X | Architecture: x86_64 (amd64) Failure: Runtime crash | Difficulty: Unknown Testcase: | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Changes (by simonmar): * status: new => closed * resolution: => worksforme Comment: I just did a validate using an existing installation of GHC 7.0.3 on OS X 10.8 DP3 with XCode 4.4 DP5. There are a few test failures that need to be cleaned up, but the crashes now seem to be gone. So I presume this was a bug in the linker after all, and Apple fixed it. -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5899#comment:33> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list [hidden email] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs |
|
In reply to this post by GHC
#5899: RTS crash w/ strange closure type 603975781 on OS X 10.8
-----------------------------+---------------------------------------------- Reporter: dylukes | Owner: Type: bug | Status: closed Priority: high | Milestone: 7.4.2 Component: Runtime System | Version: 7.4.1 Resolution: worksforme | Keywords: rts, strange closure, internal error, os x Os: MacOS X | Architecture: x86_64 (amd64) Failure: Runtime crash | Difficulty: Unknown Testcase: | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Comment(by chak): For what it is worth, I just validated the HEAD with GHC 7.4.1 on ML DP4 with Xcode 4.5 DP. Seems to be fine. -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5899#comment:34> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list [hidden email] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs |
| Powered by Nabble | Edit this page |
