[Vm-dev] Bug in unix/vm/sqUnixExternalPrims.c

Stefan Marr squeak at stefan-marr.de
Mon Oct 10 12:48:50 UTC 2011


Hi Ian:

On 10 Oct 2011, at 14:16, Ian Piumarta wrote:
> On Oct 10, 2011, at 04:49 , Stefan Marr wrote:
> 
>> I belief there is a small bug in ioLoadModule as it is currently in the SVN:
> 
> I believe you are wrong.
Well, perhaps, the agreement that the current logic is not the simplest was reached before, leading to the situation that the code is now in the else branch of an `#if 1` in the SVN.

> What was your test case, expected outcome, and observed incorrect result?

I had the Tilera Linux barking at me, and was wondering why.
(The actual reasons are things I attribute to Tilera compiler bugs, which made me investigate those warnings in the first place. But I wanted to be sure.)
So, I do not have a test case.

The problem is that currently, the heuristic makes up path names in line 221:

   sprintf(libName, "%s%s%s%s", dirName, *prefix, moduleName, *suffix);

and when we do the tryLoading("", path), then we get all the variations of:

   sprintf(libName, "%s%s%s%s", "", *prefix, path, *suffix);


The value of path in my case was a real path:
    tryLoading (dirName=0x35d6c0 "", 
    moduleName=0xbfddd65c "/users/smarr/Projects/RoarVM-master/vm/build/")

And for that particular example, adding the prefixes/suffixes makes that OS bark.

Based on that barking, and my naive inspection of the code, I concluded that it is broken.

Best regards
Stefan 


-- 
Stefan Marr
Software Languages Lab
Vrije Universiteit Brussel
Pleinlaan 2 / B-1050 Brussels / Belgium
http://soft.vub.ac.be/~smarr
Phone: +32 2 629 2974
Fax:   +32 2 629 3525



More information about the Vm-dev mailing list