Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#5336 closed bug (fixed)

Annotations aren't working

Reported by: simonmar Owned by: igloo
Priority: highest Milestone: 7.2.1
Component: Compiler Version: 7.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

Some annotations tests are failing, e.g.:

=====> annrun01(normal) 1718 of 2892 [0, 16, 0]
cd ./annotations/should_run && $MAKE -s config
make[1]: Entering directory `/64playpen/simonmar/nightly/HEAD-cam-04-unx/x86_64-unknown-linux/testsuite/tests/ghc-regress/annotations/should_run'
Creating Config.hs ... 
make[1]: Leaving directory `/64playpen/simonmar/nightly/HEAD-cam-04-unx/x86_64-unknown-linux/testsuite/tests/ghc-regress/annotations/should_run'
cd ./annotations/should_run && '/64playpen/simonmar/nightly/HEAD-cam-04-unx/x86_64-unknown-linux/inplace/bin/ghc-stage2' -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-conf -rtsopts  --make -o annrun01 annrun01  -package ghc  >annrun01.comp.stderr 2>&1
cd ./annotations/should_run && ./annrun01    </dev/null >annrun01.run.stdout 2>annrun01.run.stderr
Actual stdout output differs from expected:
--- ./annotations/should_run/annrun01.stdout	2011-07-20 18:00:41.838228896 +0100
+++ ./annotations/should_run/annrun01.run.stdout	2011-07-20 23:21:18.978853712 +0100
@@ -4,10 +4,10 @@
 Finding Module
 Getting Module Info
 Showing Details For Module
-([10],[],["Rock!!!!","Annotations","Module"],[])
+([],[],[],[])
 Showing Details For Exports
-([],[Just True],["Type Annotation"],[Annrun01_Help.Baz])
 ([],[],[],[])
-([1],[],["Hello World Again!"],[Annrun01_Help.bar,Annrun01_Help.foo])
 ([],[],[],[])
-([],[],["World!","Hello"],[])
+([],[],[],[])
+([],[],[],[])
+([],[],[],[])
*** unexpected failure for annrun01(normal)

This looks like it might be related to the recent Typeable changes, but I'm not at all familiar with this code.

Change History (5)

comment:1 Changed 9 years ago by simonpj

Owner: set to batterseapower

Max, might you look at this? Say if not.

comment:2 Changed 9 years ago by igloo

Owner: changed from batterseapower to igloo

I've worked out what's going on.

mkTyCon3 calls fingerprintString, which takes the md5 of the 3 strings in utf8.

However, derived instances use computeFingerprint, which takes the md5 of the 3 strings in the GHC binary format (which is an encoding of the length of the string, followed by essentially one of the utf32 representations).

I'll make them both use the same function.

comment:3 Changed 9 years ago by igloo

Status: newmerge

Fixed by ghc:

commit 725e6ee47e9f4b1deba5db740aa19c450bec1519
Author: Ian Lynagh <igloo@earth.li>
Date:   Fri Jul 22 23:17:56 2011 +0100

    Tweak the typeable fingerprinting
    
    Put spaces inbetween the values, so e.g.
        p:Foobar.baz
        p:Foo.barbaz
    will hash differently.

commit 8f57a40b4bdd0c57419ce08f75a005ef7e67563f
Author: Ian Lynagh <igloo@earth.li>
Date:   Fri Jul 22 22:57:16 2011 +0100

    Sync the typeable fingerprinting with base

and libraries/base:

commit d1fbd3b7c3d1ddfeabffe2b6afeb34ca6101443c
Author: Ian Lynagh <igloo@earth.li>
Date:   Fri Jul 22 23:01:10 2011 +0100

    Tweak the typeable fingerprinting
    
    Put spaces inbetween the values, so e.g.
        p:Foobar.baz
        p:Foo.barbaz
    will hash differently.

commit 905989a7d5e26eb15154534529d116ed1783e996
Author: Ian Lynagh <igloo@earth.li>
Date:   Fri Jul 22 22:57:19 2011 +0100

    Sync the typeable fingerprinting with GHC

comment:4 Changed 8 years ago by igloo

Resolution: fixed
Status: mergeclosed

comment:5 Changed 8 years ago by simonmar

Ian: good catch, thanks for fixing this.

Note: See TracTickets for help on using tickets.