bugDotGNU Portable.NET - Bugs: bug #13498, ilalink jumps to conclusions too...


You are not allowed to post comments on this tracker with your current authentication level.

bug #13498: ilalink jumps to conclusions too soon when auto-referencing libs that are indirectly required

Submitter:  Ron MacNeil <macro>
Submitted:  Wed 22 Jun 2005 05:49:25 AM UTC
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Thu 23 Jun 2005 03:55:29 AM UTC, comment #1: 

I've uploaded a test case demonstrating the bug.  Extract the tgz and cd into the directory.

"make bug" and watch cscc (actually ilalink) fail to find c.dll.  In this case, b.dll is referenced first, causing it to try to find c.dll via the auto-indirect-reference thing (outlined in the code snippet in the original post).  It can't find c.dll and blows up without waiting to see if we explicitly reference c.dll later (which we do).

Then, "make nobug" and watch everything work.  Why?  Look at the makefile; The only difference is the order of the -l switches are swapped so c.dll is referenced before b.dll, avoiding the auto-indirect-reference mechanism.

Thanks again,

Ron MacNeil <macro>
Wed 22 Jun 2005 05:49:25 AM UTC, original submission:  

When processing a referenced lib A, ilalink tries to be helpful by auto-referencing libs B that A requires but which might not be directly required.

The problem is, if B isn't in one of the lib paths (-L) ilalink gives up right away, EVEN IF that lib might be directly referenced in a subsequent -l/path/to/lib switch.

Maybe the auto-indirect-referencing should be done in a separate pass, after all direct references have been processed?

Regardless, neither Mono's mcs nor Microsoft's csc exhibit the same problem.

Kudos on the great work, guys.

Starting point:
This block at line 814'ish of ilalink/link_library.c, in function ILLinkerAddLibrary(), which recursively calls itself straight away for each indirectly-referenced lib without waiting to see if it's referenced manually later on:

/* Add assemblies that were referenced by this library, because
   this library may contain TypeRef's in its public signatures
   to some other assembly, and we need to import them too */
assem = 0;
while((assem = (ILAssembly *)ILImageNextToken
(image, IL_META_TOKEN_ASSEMBLY_REF, (void *)assem)) != 0)
if(!ILLinkerAddLibrary(linker, ILAssembly_Name(assem)))
result = 0;

Ron MacNeil <macro>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #3114:  pnet-bug-testcase.tgz added by macro (709B - application/x-tgz - Test case demonstrating the bug)


Depends on the following items: None found

Items that depend on this one: None found


CC list is empty


There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.


Follows 1 latest change.

Date Changed by Updated Field Previous Value => Replaced by
2005-06-23 macro Attached File- Added pnet-bug-testcase.tgz, #2622

Back to the top

Powered by Savane 3.13-b921.
Corresponding source code