From: simonmar Date: Wed, 10 Sep 2003 14:45:25 +0000 (+0000) Subject: [project @ 2003-09-10 14:45:24 by simonmar] X-Git-Tag: Approx_11550_changesets_converted~477 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=868973ac573282c71d4b2661e2ffa418840168d7 [project @ 2003-09-10 14:45:24 by simonmar] Quick hack to work around the dynamic exception crashes in GHCi. The problem is this: the Data.Typeable library (Data.Dymamic in previous versions of GHC) maintains an internal cache mapping type names to unique numbers, and this cache is used for fast comparisons on TypeReps. In GHCi, there are actually two versions of the Data.Typeable library loaded: one linked to GHCi itself, and the other dynamically loaded, so there are two copies of the hash tables. The problem is that if we have a Dynamic value generated using one set of hash tables, it will erroneously appear to be of a different type when the other hash tables are used. The hack I've instigated is to use the central RTS genSym (which already exists) to generate the unique Ids, so that the two copies of the dynamic library will be using distinct Ids, and Dynamics from one will never be recognisable to the other. --- diff --git a/ghc/rts/Linker.c b/ghc/rts/Linker.c index 15ea803..fdf0a19 100644 --- a/ghc/rts/Linker.c +++ b/ghc/rts/Linker.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Linker.c,v 1.127 2003/08/29 16:00:26 simonmar Exp $ + * $Id: Linker.c,v 1.128 2003/09/10 14:45:25 simonmar Exp $ * * (c) The GHC Team, 2000-2003 * @@ -374,6 +374,7 @@ typedef struct _RtsSymbolVal { SymX(gcdIntegerzh_fast) \ SymX(gcdIntegerIntzh_fast) \ SymX(gcdIntzh_fast) \ + SymX(genSymZh) \ SymX(getProgArgv) \ SymX(getStablePtr) \ SymX(int2Integerzh_fast) \