Opened 11 years ago

Closed 11 years ago

#2830 closed bug (fixed)

undefined reference to `base_DataziTuple_Z63T_con_info' when using instances with context

Reported by: nomeata Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.8.2
Keywords: Cc:
Operating System: Linux Architecture: x86
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:



I came across this bug when using HAppS, but it is not related to HAppS, it seems.

I have attached the files test4.hs and test5. They differ only in that the former one uses

instance (Serialize Method1) => UpdateEvent Method1 ()

while the second use uses

instance UpdateEvent Method1 ()

I can not tell any difference in the effect (in my real app, the example file does not have any senisble meaning), but that’s not the point: I can compile test5.hs without problems, but

$ ghc --make test4.hs 
[1 of 1] Compiling Main             ( test4.hs, test4.o )
Linking test4 ...
test4.o: In function `r1c1_info':
(.text+0x639): undefined reference to `base_DataziTuple_Z63T_con_info'
collect2: ld returned 1 exit status

It seems that ghc internally creates a large tuple (63 elements) with the Serialize instances – or something. The dumped core has some clues, I just can’t read them.

Sorry for not testing this with a more up-to-date compiler, but I don’t have one handy.

Attachments (2)

test4.hs (14.2 KB) - added by nomeata 11 years ago.
Test case with bug
test5.hs (12.7 KB) - added by nomeata 11 years ago.
Modified test4.hs, without the bug

Download all attachments as: .zip

Change History (3)

Changed 11 years ago by nomeata

Attachment: test4.hs added

Test case with bug

Changed 11 years ago by nomeata

Attachment: test5.hs added

Modified test4.hs, without the bug

comment:1 Changed 11 years ago by simonpj

difficulty: Unknown
Resolution: fixed
Status: newclosed

Happily this works fine in 6.8.3, 6.10.1, and HEAD.


Note: See TracTickets for help on using tickets.