theseion / libgit2-pharo-bindings

libgit2 bindings for Pharo
http://theseion.github.io/libgit2-pharo-bindings
7 stars 29 forks source link

Error on libgit2_init #28

Closed tinchodias closed 9 years ago

tinchodias commented 9 years ago

In Pharo 40583, the load raises an error. I don't know of NB, but I find suspicious that in NBFFICallout>>generateCall:module:, the argument moduleNameOrHandle is 0.

Stack trace:

NativeBoostMac32(Object)>>error:
NativeBoostMac32(NativeBoostLinux32)>>getGlobalSymbolPointer:
NativeBoostMac32(NativeBoostLinux32)>>loadSymbol:fromModule:
NativeBoost class>>loadSymbol:fromModule:
Metaclass(Object)>>nbGetSymbolAddress:module:
NBFFICallout>>generateCall:module:
[ :gen | 
gen
    callType: conv;
    sender: context;
    parseOptions: options;
    generateCall: functionSignature module: moduleNameOrHandle ] in NBFFICalloutAPI>>function:module: in Block: [ :gen | ...
[ bytes := aBlock value: (self newForMethod: method) ] in NBFFICallout class(NBNativeCodeGen class)>>generateCode:andRetry: in Block: [ bytes := aBlock value: (self newForMethod: metho...etc...
BlockClosure>>on:do:
NBRecursionDetect class>>in:during:
NBFFICallout class(NBNativeCodeGen class)>>generateCode:andRetry:
NBFFICallout class(NBNativeCodeGen class)>>handleFailureIn:nativeCode:
NBFFICalloutAPI>>function:module:
[ 
LGitFunctionReturn
    methodSelector: sender method selector
    value:
        ((self nbCalloutIn: sender)
            cdecl;
            options: options;
            function: fnSpec module: LGitGlobal libraryNameOrHandle) ] in LGitGlobal class>>call:options: in Block: [ ...
BlockClosure>>cull:
Context(ProtoObject)>>ifNotNil:
LGitGlobal class>>runSequence:
LGitGlobal class>>call:options:
LGitGlobal class>>libgit2_init
LGitGlobal class>>initializeLibGit2
[ 
self initializeLibGit2.
aBlock value ] in [ 
[ 
self initializeLibGit2.
aBlock value ]
    ensure: [ self shutdownLibGit2 ] ] in LGitGlobal class>>runSequence: in Block: [ ...
BlockClosure>>ensure:
[ 
[ 
self initializeLibGit2.
aBlock value ]
    ensure: [ self shutdownLibGit2 ] ] in LGitGlobal class>>runSequence: in Block: [ ...
[ 
p psValueAt: index put: anObject.
aBlock value ] in LGitActionSequence(DynamicVariable)>>value:during: in Block: [ ...
BlockClosure>>ensure:
LGitActionSequence(DynamicVariable)>>value:during:
LGitActionSequence class(DynamicVariable class)>>value:during:
LGitGlobal class>>runSequence:
MCGitRepository>>createCloneRepository
MCGitRepository>>ensureDirectory
theseion commented 9 years ago

Thanks Martin. If the library can't be opened, the primitive returns 0, which is what you see. I'll take a look.

theseion commented 9 years ago

All good :) the current VM still has version 0.21.1 but I upgraded to 0.22.1. You need to copy the lib from https://github.com/theseion/stuff/blob/master/libgit2.0.22.0.dylib to the plugins directory until the VM has been updated.