[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pnet-developers] A cross-assembly bug in cscc class resolution

From: Gopal V
Subject: [Pnet-developers] A cross-assembly bug in cscc class resolution
Date: Mon, 23 Jun 2003 01:08:29 +0530
User-agent: Mutt/1.2.5i

        I ran into the wierdest bug in pnet history tonight ... This is
way beyond wierd .. Ok the bug seems to be in image/ (*shudder*)
somewhere in the hashing lookups .. Here's how you run across it.

For one , you cannot make a single file test case , this has to be
cross assembly to create problems :-).. So here's the scenario, 
there are 2 classes named 'StringCollection' one in System.dll and
other in your .dll and your StringCollection is a NESTED class ..

So whenever you compile them against each other, cscc automatically
picks the wrong StringCollection ie the nested one , even though 
that namespace is not in the 'using' section and the other namespace
IS IN 'using' ..

I tracked it down till ILClassLookupGlobal() which ends up giving a
nested class (which is not how it's supposed to work, right ?) . After
which it entered a couple of function pointer based hashing functions
and about 40 minutes later and after lots of gdb, came up on the following 
lines of code...

        /* Do we only want types at the global level? */
        if(key->wantGlobal && classInfo->scope)
                if((classInfo->scope->token & IL_META_TOKEN_MASK) !=
                        return 0;

Then what does exactly ILClassLookupGlobal do ?

AFAIK, the reason a single compilation unit is not affected is because 
the conflicting class is not added to this class hash before lookup...

To round things off before moving onto a savannah test case , I would
like to try to fix this myself  ... any advice ?

PS: this is a very real bug concerning System.dll and System.Drawing.dll
    with PrinterSettings.StringCollection nested class causing havoc 
the difference between insanity and genius is measured by success

Attachment: cross-assem-bug.tgz
Description: GNU Zip compressed data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]