[GHC] #9938: cryptarithm2 fails with undefined reference to `transzuH9c1w14lEUN3zzdWCTsn8jG_ControlziMonadziTransziStateziLazzy_zdwzdcp0Alternative_info'

#9938: cryptarithm2 fails with undefined reference to
`transzuH9c1w14lEUN3zzdWCTsn8jG_ControlziMonadziTransziStateziLazzy_zdwzdcp0Alternative_info'
-------------------------------------+-------------------------------------
Reporter: nomeata | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.11
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: Compile-time
Unknown/Multiple | crash
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Revisions: |
-------------------------------------+-------------------------------------
I am observing this right now:
{{{
==nofib== cryptarithm2: size of Main.o follows...
text data bss dec hex filename
25423 1304 0 26727 6867 Main.o
==nofib== cryptarithm2: time to link cryptarithm2 follows...
Main.o: In Funktion `c79k_info':
(.text+0x1a5b): Nicht definierter Verweis auf
`transzuH9c1w14lEUN3zzdWCTsn8jG_ControlziMonadziTransziStateziLazzy_zdwzdcp0Alternative_info'
Main.o: In Funktion `c7cP_info':
(.text+0x2283): Nicht definierter Verweis auf
`transzuH9c1w14lEUN3zzdWCTsn8jG_ControlziMonadziTransziStateziLazzy_zdwzdcp0Alternative_info'
Main.o: In Funktion `c7ll_info':
(.text+0x2f53): Nicht definierter Verweis auf
`transzuH9c1w14lEUN3zzdWCTsn8jG_ControlziMonadziTransziStateziLazzy_zdwzdcp0Alternative_info'
Main.o: In Funktion `c7p2_info':
(.text+0x37cb): Nicht definierter Verweis auf
`transzuH9c1w14lEUN3zzdWCTsn8jG_ControlziMonadziTransziStateziLazzy_zdwzdcp0Alternative_info'
collect2: error: ld returned 1 exit status
<

#9938: cryptarithm2 fails with undefined reference to
`transzuH9c1w14lEUN3zzdWCTsn8jG_ControlziMonadziTransziStateziLazzy_zdwzdcp0Alternative_info'
-------------------------------------+-------------------------------------
Reporter: nomeata | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.11
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Compile-time | Unknown/Multiple
crash | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by Joachim Breitner

#9938: cryptarithm2 fails with undefined reference to `transzuH9c1w14lEUN3zzdWCTsn8jG_ControlziMonadziTransziStateziLazzy_zdwzdcp0Alternative_info' -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by rwbarton): I'm confused, isn't your minimized test case showing the expected behavior? GHC doesn't really know what's in `Main.o` and that it needs to link against transformers, so you have to specify `-package transformers` at link time. I don't understand how changing the order of the cases in `solve` could affect anything, and I also can't reproduce it here. Not sure what is going on with cryptarithm2 then, did it somehow gain a link-time dependency on transformers (whereas previously, perhaps, all the functions in transformers had been inlined)? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9938#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9938: cryptarithm2 fails with undefined reference to
`transzuH9c1w14lEUN3zzdWCTsn8jG_ControlziMonadziTransziStateziLazzy_zdwzdcp0Alternative_info'
-------------------------------------+-------------------------------------
Reporter: nomeata | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.11
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Compile-time | Unknown/Multiple
crash | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by Joachim Breitner

#9938: cryptarithm2 fails with undefined reference to `transzuH9c1w14lEUN3zzdWCTsn8jG_ControlziMonadziTransziStateziLazzy_zdwzdcp0Alternative_info' -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by nomeata):
I don't understand how changing the order of the cases in solve could affect anything, and I also can't reproduce it here.
Right, I can’t either. But when I pass `-O2`, I can! I added the other variant as a separate test case. Maybe the successful compilation of that is the bug? I hope that successful linking should not depend on the particular optimizations that went through. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9938#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9938: GHC's link step needs to be told which packages to link -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by simonpj): Replying to [comment:4 nomeata]:
I hope that successful linking should not depend on the particular optimizations that went through.
I'm afraid I suspect it does! * When compiling a source module, GHC can find imports from any exposed packages, in this case `transformers`. * But when linking `.o` files, GHC doesn't know which packages to link. So you mus specify on the command line; e.g. `-package transformers`. * If you inline enough things so that there are no remaining references to things from a package, then you don't need to include that package in the link command. This is pretty unusual. The Right Thing is, I guess, when given a `.o` file on the command line, to read its interface file, to find what packages it needs, and include those in any link step. Patch welcome! Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9938#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9938: GHC's link step needs to be told which packages to link
-------------------------------------+-------------------------------------
Reporter: nomeata | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.11
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Compile-time | Unknown/Multiple
crash | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by Joachim Breitner

#9938: GHC's link step needs to be told which packages to link -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by simonpj): It fails on my laptop. I don't understand why it (now) passes on the regression suite but fail on on my laptop. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9938#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9938: GHC's link step needs to be told which packages to link -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by nomeata): That’s strange. T9938 passes on Travis reliable now (four builds since that commit). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9938#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9938: GHC's link step needs to be told which packages to link
-------------------------------------+-------------------------------------
Reporter: nomeata | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.11
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Compile-time | Unknown/Multiple
crash | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones

The Right Thing is, I guess, when given a `.o` file on the command line, to read its interface file, to find what packages it needs, and include
#9938: GHC's link step needs to be told which packages to link -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by rwbarton): * type: bug => feature request Comment: Replying to [comment:5 simonpj]: those in any link step. A `.o` file on the command line could have come from anywhere, though; it might have been produced by compiling a C file and not have an associated interface file at all. We could record dependency information in the `.o` file in a special section, but that's a bit difficult and nonportable, and doing it just for this purpose seems a bit overkill. I believe GHC is behaving as expected here, and its behavior seems fine to me, so I turned this into a feature request ticket. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9938#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9938: GHC's link step needs to be told which packages to link -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by rwbarton): T9938 is acting up (unexpectedly passing) again, presumably due to some optimizer change. I don't really see the value in a test that verifies the absence of a feature that we know GHC does not have (tracking dependencies of `.o` files that were produced by GHC), though I suppose it means we have already done the work of creating the test if the feature gets added (but that doesn't look too likely to happen in the near future). But if we want to keep the test, can we find a dependency that we can count on not getting inlined away? Something that involves a global variable would be a good bet, but the only ones I can think of are in base (always linked in anyways) and random (not necessarily always built?) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9938#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9938: GHC's link step needs to be told which packages to link -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by thoughtpolice): We can actually make the test contain a package and use that with whatever hacks we need, can't we? There are several Cabal based tests in the build system. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9938#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9938: GHC's link step needs to be told which packages to link -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by rwbarton): Right, we definitely could do that too, just a bit more heavyweight, but if nothing simpler suggests itself then perhaps best. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9938#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9938: GHC's link step needs to be told which packages to link
-------------------------------------+-------------------------------------
Reporter: nomeata | Owner:
Type: feature request | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.11
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Compile-time | Unknown/Multiple
crash | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by Austin Seipp

#9938: GHC's link step needs to be told which packages to link -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by thoughtpolice): As I said to Reid on IRC: I'm fine with either doing the cabal test thing, or just deleting this test outright. I see Reid marked it as feature request, and the history is in the ticket references. So I don't think we'll lose much here if we just remove it. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9938#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC