OSProcess on Solaris - all primitives failing

Julian Fitzell julian at beta4.com
Thu Feb 12 21:58:02 UTC 2004


I put some fprintf() calls (as well as the flush calls) in 
initialiseModule() as well as at the top and bottom of primitiveSizeOfInt().

I also set #define DEBUG 1 in sqUnixExternalPlugins.c

When starting up the image, I see three attempts in a row to load the 
OSProcess plugin:

tryLoading ./UnixOSProcessPlugin
tryLoading ./UnixOSProcessPlugin.so
tryLoading ./UnixOSProcessPlugin.dylib
tryLoading ./libUnixOSProcessPlugin
tryLoading ./libUnixOSProcessPlugin.so
tryLoading ./libUnixOSProcessPlugin.dylib
tryLoading 
/local/home/agile/julian/squeak/lib/squeak/3.6g-2/UnixOSProcessPlugin
tryLoading 
/local/home/agile/julian/squeak/lib/squeak/3.6g-2/UnixOSProcessPlugin.so
squeak: loaded plugin 
`/local/home/agile/julian/squeak/lib/squeak/3.6g-2/UnixOSProcessPlugin.so'
ioFindExternalFunctionIn(getModuleName, -17300132)
ioFindExternalFunctionIn(setInterpreter, -17300132)
ioFindExternalFunctionIn(initialiseModule, -17300132)
Init called
tryLoading ./UnixOSProcessPlugin
tryLoading ./UnixOSProcessPlugin.so
tryLoading ./UnixOSProcessPlugin.dylib
tryLoading ./libUnixOSProcessPlugin
tryLoading ./libUnixOSProcessPlugin.so
tryLoading ./libUnixOSProcessPlugin.dylib
tryLoading 
/local/home/agile/julian/squeak/lib/squeak/3.6g-2/UnixOSProcessPlugin
tryLoading 
/local/home/agile/julian/squeak/lib/squeak/3.6g-2/UnixOSProcessPlugin.so
squeak: loaded plugin 
`/local/home/agile/julian/squeak/lib/squeak/3.6g-2/UnixOSProcessPlugin.so'
ioFindExternalFunctionIn(getModuleName, -17300040)
ioFindExternalFunctionIn(setInterpreter, -17300040)
ioFindExternalFunctionIn(initialiseModule, -17300040)
Init called
tryLoading ./UnixOSProcessPlugin
tryLoading ./UnixOSProcessPlugin.so
tryLoading ./UnixOSProcessPlugin.dylib
tryLoading ./libUnixOSProcessPlugin
tryLoading ./libUnixOSProcessPlugin.so
tryLoading ./libUnixOSProcessPlugin.dylib
tryLoading 
/local/home/agile/julian/squeak/lib/squeak/3.6g-2/UnixOSProcessPlugin
tryLoading 
/local/home/agile/julian/squeak/lib/squeak/3.6g-2/UnixOSProcessPlugin.so
squeak: loaded plugin 
`/local/home/agile/julian/squeak/lib/squeak/3.6g-2/UnixOSProcessPlugin.so'
ioFindExternalFunctionIn(getModuleName, -17300040)
ioFindExternalFunctionIn(setInterpreter, -17300040)
ioFindExternalFunctionIn(initialiseModule, -17300040)
Init called


It looks to me like it is succeeding (the "Init called" message is my 
fprintf()).  Then if I make a call to "OSProcess accessor sizeOfInt", I get:

tryLoading ./UnixOSProcessPlugin
tryLoading ./UnixOSProcessPlugin.so
tryLoading ./UnixOSProcessPlugin.dylib
tryLoading ./libUnixOSProcessPlugin
tryLoading ./libUnixOSProcessPlugin.so
tryLoading ./libUnixOSProcessPlugin.dylib
tryLoading 
/local/home/agile/julian/squeak/lib/squeak/3.6g-2/UnixOSProcessPlugin
tryLoading 
/local/home/agile/julian/squeak/lib/squeak/3.6g-2/UnixOSProcessPlugin.so
squeak: loaded plugin 
`/local/home/agile/julian/squeak/lib/squeak/3.6g-2/UnixOSProcessPlugin.so'
ioFindExternalFunctionIn(getModuleName, -17299776)
ioFindExternalFunctionIn(setInterpreter, -17299776)
ioFindExternalFunctionIn(initialiseModule, -17299776)
Init called


So, initialization seems to be happening but the primitive function 
isn't being called since the code now looks like:
EXPORT(int) primitiveSizeOfInt(void) {
         fprintf(stderr, "start of prim\n");
         fflush(stderr);
         interpreterProxy->pop(1);
         interpreterProxy->pushInteger(sizeOfInt());
         fprintf(stderr, "End of prim\n");
         fflush(stderr);
}

Any further direction appreciated,

Julian

David T. Lewis wrote:
> On Wed, Feb 11, 2004 at 07:29:10PM -0800, Julian Fitzell wrote:
> 
>>So I have a plugin that builds and loads find, shows up as builtin, but 
>>doesn't load, fails on all its primitives, and doesn't give any error 
>>output anywhere that I can find.
>>
>>I even tried putting in some fprintf() calls to stderr in the 
>>primitiveLockFileRegion() function (the original primitive I was trying 
>>to use) -- although this was when I was still trying to load the plugin 
>>dynamically.  I didn't see any of this output which confirms, I think, 
>>my suspicion that the primitive functions aren't even being called.
> 
> 
> Be sure to follow the fprintf() with an immediate fflush(stderr) or you
> will not get the expected output. Note that initializeModule() will be
> the first thing called in the plugin, so you can reassure yourself that
> the plugin is being loaded by putting an fprintf in that function.
> I find it easier to debug these things with the plugin compiled external,
> but it should work either way.
> 
> Dave
> 
> 



More information about the Squeak-dev mailing list