Pharo-dev
By thread
pharo-dev@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
December 2010
- 122 participants
- 2061 messages
Re: [Pharo-project] Cog VM app icon
by Igor Stasenko
Ok, i found one
http://daniel.lanovaz.org/Site/Blog/Blog.html
but there is no icons of any sort , just an animation :(
On 24 December 2010 16:31, Igor Stasenko <siguctua(a)gmail.com> wrote:
> Hello,
>
> i almost done with generating an app bundle for Cog VM , and i found
> that it is using
> a Croquet Icon.
> Which doesn't seems right to me.
> I remember there was a guy , who presented a nice cog icon and other graphics..
> anyone knows where i can find them?
>
>
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>
--
Best regards,
Igor Stasenko AKA sig.
Dec. 24, 2010
Re: [Pharo-project] FFI crashes VM on Linux (was: Z3950 on OSX: module yaz3 not found)
by Hernán Morales Durand
This is the one found in the Pharo OneClick 1.1.1 with standard VM.
4.0.3-2202 #1 XShm Tue Apr 13 11:56:47 PDT 2010 gcc 4.3.2
Linux vps2.piumarta.com 2.6.18-028stab053.10-ent #1 SMP Thu Feb 28
20:34:08 MSK 2008 i686 GNU/Linux
As the same situation happens with the CogVM, this is the version information:
3.9-7 #5 Sat Sep 18 22:06:50 PDT 2010 gcc 4.1.2
Croquet Closure Cog VM [CoInterpreter VMMaker-oscog.29]
Linux mcqfes 2.6.18-128.el5 #1 SMP Wed Jan 21 10:44:23 EST 2009 i686
i686 i386 GNU/Linux
with the corresponding Segfault trace:
Segmentation fault
Smalltalk stack dump:
0xbfcb6bcc M MethodContext(ContextPart)>doPrimitive:method:receiver:args:
-1377623896: a(n) MethodContext
0xbfcb6bf8 M MethodContext(ContextPart)>tryPrimitiveFor:receiver:args:
-1377623896: a(n) MethodContext
0xbfcb6c28 M MethodContext(ContextPart)>send:to:with:super:
-1377623896: a(n) MethodContext
0xbfcb6c60 M MethodContext(ContextPart)>send:super:numArgs:
-1377623896: a(n) MethodContext
0xbfcb6c98 M MethodContext(InstructionStream)>interpretExtension:in:for:
-1377623896: a(n) MethodContext
0xbfcb6ccc M MethodContext(InstructionStream)>interpretNextInstructionFor:
-1377623896: a(n) MethodContext
0xbfcb6ce8 M MethodContext(ContextPart)>step -1377623896: a(n) MethodContext
0xbfcb6d00 M Process>step -1377787784: a(n) Process
0xbfcb6d1c M Process>completeStep: -1377787784: a(n) Process
0xbfcb6d40 M Debugger>doStep -1377787748: a(n) Debugger
0xbfcb6d58 M PluggableButtonMorph>performAction -1377774712: a(n)
PluggableButtonMorph
0xbfcb6d74 M [] in PluggableButtonMorph>mouseUp: -1377774712: a(n)
PluggableButtonMorph
0xbfcb6d98 M Array(SequenceableCollection)>do: -1376378232: a(n) Array
0xbfcb6db8 M PluggableButtonMorph>mouseUp: -1377774712: a(n)
PluggableButtonMorph
0xbfcb6dd4 M PluggableButtonMorph(Morph)>handleMouseUp: -1377774712:
a(n) PluggableButtonMorph
0xbfcb6df0 M MouseButtonEvent>sentTo: -1376378272: a(n) MouseButtonEvent
0xbfcb6e0c M PluggableButtonMorph(Morph)>handleEvent: -1377774712:
a(n) PluggableButtonMorph
0xbfcb6e28 M PluggableButtonMorph(Morph)>handleFocusEvent:
-1377774712: a(n) PluggableButtonMorph
0xbfcb6e50 M [] in HandMorph>sendFocusEvent:to:clear: -1401331780:
a(n) HandMorph
0xbfcb6e6c M [] in PasteUpMorph>becomeActiveDuring: -1401044432: a(n)
PasteUpMorph
0xbfcb6e88 M BlockClosure>on:do: -1376378324: a(n) BlockClosure
0xbfcb6eb4 M PasteUpMorph>becomeActiveDuring: -1401044432: a(n) PasteUpMorph
0xbfcb6ed8 M HandMorph>sendFocusEvent:to:clear: -1401331780: a(n) HandMorph
0xbfcb6f00 M HandMorph>sendEvent:focus:clear: -1401331780: a(n) HandMorph
0xbfcb6f24 M HandMorph>sendMouseEvent: -1401331780: a(n) HandMorph
0xbfcb6f48 M HandMorph>handleEvent: -1401331780: a(n) HandMorph
0xbfcb6f74 M HandMorph>processEvents -1401331780: a(n) HandMorph
0xbfcb6f8c M [] in WorldState>doOneCycleNowFor: -1400414096: a(n) WorldState
0xbfcb6fb0 M Array(SequenceableCollection)>do: -1402762152: a(n) Array
0xbfcb6fcc M WorldState>handsDo: -1400414096: a(n) WorldState
0xbfcb6fe8 M WorldState>doOneCycleNowFor: -1400414096: a(n) WorldState
0xbfcb7004 M WorldState>doOneCycleFor: -1400414096: a(n) WorldState
0xbfcb7020 M PasteUpMorph>doOneCycle -1401044432: a(n) PasteUpMorph
0xbfcb7040 I [] in Project class>spawnNewProcess -1400334588: a(n) Project class
-1381481244 s [] in BlockClosure>newProcess
Most recent primitives
millisecondClockValue
signal
at:put:
at:put:
primSignal:atMilliseconds:
millisecondClockValue
wait
primGetNextEvent:
shallowCopy
wait
at:put:
wait
signal
signal
primGetNextEvent:
millisecondClockValue
wait
signal
at:put:
at:put:
millisecondClockValue
primSignal:atMilliseconds:
millisecondClockValue
wait
signal
wait
relinquishProcessorForMicroseconds:
relinquishProcessorForMicroseconds:
relinquishProcessorForMicroseconds:
millisecondClockValue
signal
at:put:
at:put:
primSignal:atMilliseconds:
millisecondClockValue
wait
millisecondClockValue
@
actualScreenSize
species
species
millisecondClockValue
basicNew
new:
at:put:
at:put:
at:put:
at:put:
new:
basicNew
basicNew
basicNew
shallowCopy
at:put:
at:put:
at:put:
at:put:
at:put:
at:put:
species
new:
basicNew
at:put:
at:put:
at:put:
species
new:
replaceFrom:to:with:startingAt:
shallowCopy
at:put:
at:put:
at:put:
shallowCopy
species
new:
replaceFrom:to:with:startingAt:
species
new:
replaceFrom:to:with:startingAt:
basicNew
new:
basicNew
basicNew
wait
signal
wait
at:put:
signal
at:put:
at:put:
@
@
basicNew
species
species
shallowCopy
shallowCopy
perform:
stringHash:initialHash:
stringHash:initialHash:
stringHash:initialHash:
stringHash:initialHash:
basicNew
stringHash:initialHash:
stringHash:initialHash:
stringHash:initialHash:
stringHash:initialHash:
basicNew
new:
at:put:
at:put:
at:put:
at:put:
at:put:
at:put:
at:put:
at:put:
at:put:
basicNew
new:
basicNew
@
@
@
at:put:
basicNew
@
@
@
at:put:
basicNew
@
@
@
@
@
@
at:put:
basicNew
@
@
@
at:put:
basicNew
basicNew:
at:put:
at:put:
at:put:
at:put:
@
@
@
@
@
@
@
at:put:
basicNew
@
@
@
@
at:put:
basicNew
@
@
@
@
@
@
at:put:
basicNew
@
@
@
@
at:put:
basicNew
@
@
@
@
@
at:put:
basicNew
basicNew
new:
@
@
basicNew
pointsTo:
pointsTo:
pointsTo:
pointsTo:
shallowCopy
shallowCopy
@
@
basicNew
@
@
basicNew
@
perform:with:
@
@
perform:with:
@
basicNew
@
@
basicNew
@
perform:with:
@
@
perform:with:
@
basicNew
@
@
basicNew
@
@
basicNew
basicNew
at:put:
findSubstring:in:startingAt:matchTable:
indexOfAscii:inString:startingAt:
perform:
objectAt:
new:
at:
stackp:
at:put:
at:
stackp:
at:put:
at:
stackp:
at:put:
at:
stackp:
pointsTo:
objectAt:
objectAt:
new:
objectAt:
at:put:
objectAt:
at:put:
objectAt:
at:put:
objectAt:
at:put:
tryInvokeWithArguments:
Aborted
Cheers,
Hernán
2010/12/24 laurent laffont <laurent.laffont(a)gmail.com>:
> Which VM have you used ?
> I cross post to vm-dev list.
> Laurent.
> On Fri, Dec 24, 2010 at 3:54 AM, Hernán Morales Durand
> <hernan.morales(a)gmail.com> wrote:
>>
>> Laurent, not much progress here :(
>> I just reproduced the Unix VM crash. First I've linked the library so
>> we do not have to change every module name call
>>
>> user@ubuntu:/usr/lib$ ln -T -s /usr/lib/libyaz.so.3.0.0 yaz
>>
>> and I've tried to execute the library tracer in the shell script
>>
>> ltrace -f -l /usr/lib/libyaz.so.3.0.0 -o out.txt "$BASE/squeakvm" \
>> Â Â Â Â -plugins "$BASE" \
>> Â Â Â Â -encoding latin1 \
>> Â Â Â Â -vm-display-X11 \
>> Â Â Â Â "$ROOT/Contents/Resources/pharo.image"
>>
>> but it crash the VM too with an unhandled exception even before the
>> GUI is displayed.
>> What I've observed is that every FFI call which receives an
>> ExternalStructure as parameter kills the VM. This is weird because
>> this doesn't happen in the Windows VM. I ran this little script I use
>> to debug the library
>>
>> | conn lib rs rsSize records |
>> lib := Z3950FFILibrary default.
>> conn := lib
>> Â Â Â Â createConnectionTo: #Alabama asZ3950Server hostName
>> Â Â Â Â port: 7090.
>> lib createOptions.
>> lib
>> Â Â Â Â setConnection: conn
>> Â Â Â Â optionName: 'preferredRecordSyntax'
>> Â Â Â Â optionValue: 'USMARC'.
>> rs := lib
>> Â Â Â Â searchPqf: conn
>> Â Â Â Â query: Â '@attr 1=1003 collins'.
>> rsSize := lib resultSetSize: rs.
>> rsSize > 0
>> Â Â Â Â ifFalse: Â [ 'no results' ].
>> records := Array new: rsSize.
>> 0 to: rsSize - 1 do: [: pos |
>> Â Â Â Â record := lib resultSetRecord: rs position: pos.
>> Â Â Â Â record isNil not
>> Â Â Â Â Â Â Â Â ifTrue: Â [
>> Â Â Â Â Â Â Â Â Â Â Â Â records
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â at: pos + 1
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â put: ( lib
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â getRecord: record
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â function: 'render; charset=marc8,
>> iso8859-1'
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â length: nil ). ] ].
>> records
>>
>> and the the doIt just hangs the VM, the console output going through
>> the Debugger is the following:
>>
>> Segmentation fault
>>
>> -1370902312 ContextPart>doPrimitive:method:receiver:args:
>> -1370902404 ContextPart>tryPrimitiveFor:receiver:args:
>> -1370902788 ContextPart>send:to:with:super:
>> -1370902896 ContextPart>send:super:numArgs:
>> -1370902988 InstructionStream>interpretExtension:in:for:
>> -1370903080 InstructionStream>interpretNextInstructionFor:
>> -1370903172 ContextPart>step
>> -1370903280 Process>step
>> -1370903372 Process>step:
>> -1370920392 Debugger>send
>> -1370937720 PluggableButtonMorph>performAction
>> -1370937812 PluggableButtonMorph>mouseUp:
>> -1370937996 SequenceableCollection>do:
>> -1370957140 PluggableButtonMorph>mouseUp:
>> -1370957232 Morph>handleMouseUp:
>> -1370957324 MouseButtonEvent>sentTo:
>> -1370957416 Morph>handleEvent:
>> -1370957584 Morph>handleFocusEvent:
>> -1370957676 HandMorph>sendFocusEvent:to:clear:
>> -1370957768 PasteUpMorph>becomeActiveDuring:
>> -1370957860 BlockClosure>on:do:
>> -1370957992 PasteUpMorph>becomeActiveDuring:
>> -1370958084 HandMorph>sendFocusEvent:to:clear:
>> -1370958260 HandMorph>sendEvent:focus:clear:
>> -1370958352 HandMorph>sendMouseEvent:
>> -1370958444 HandMorph>handleEvent:
>> -1370966728 HandMorph>processEvents
>> -1370966836 WorldState>doOneCycleNowFor:
>> -1370966952 SequenceableCollection>do:
>> -1370967044 WorldState>handsDo:
>> -1370967136 WorldState>doOneCycleNowFor:
>> -1370969680 WorldState>doOneCycleFor:
>> -1370969772 PasteUpMorph>doOneCycle
>> -1383611064 >spawnNewProcess
>> -1383611192 BlockClosure>newProcess
>> Aborted
>>
>> it would be nice if someone could tell something about debugging FFI
>> calls, or just any idea to try.
>> Cheers,
>>
>> Hernán
>>
>> 2010/12/23 laurent laffont <laurent.laffont(a)gmail.com>:
>> > Hi,
>> > I have unmangled all function names. Image also crashes when evaluating
>> > the
>> > Kant test. (but this time I get ILLEGAL INSTRUCTION on strace). I've
>> > tried
>> > with Cog and the VM in the Seaside OneClick.
>> > I've uploaded the modified packages on squeaksource
>> > here: http://www.squeaksource.com/LaurentLSandbox.html  (you can use
>> > Z3950Slice to load all at once).
>> > Laurent
>> >
>> >
>> >
>> > On Thu, Dec 23, 2010 at 1:57 AM, Hernán Morales Durand
>> > <hernan.morales(a)gmail.com> wrote:
>> >>
>> >> Hi Laurent,
>> >>
>> >> Thanks for the feedback, I've uploaded the repository with the missing
>> >> method but I cannot reproduce the crash in Windows. Have you unmangled
>> >> every function name tested? Are you running just the
>> >> Z3950FFILibraryTest? Notice the Z3950FFIServerLibraryTest tests are
>> >> performed against a Z39.50 server running in local host, otherwise
>> >> will fail (however that shouldn't crash the VM), so you may want to
>> >> run only the Z3950FFILibraryTest suite. If you or anyone want a local
>> >> Zebra server for Win32 - although most configuration files should work
>> >> with other platforms - for testing purposes please let me know.
>> >>
>> >> Does the Kant test crash the VM too?
>> >>
>> >> Z3950Client new
>> >> Â server: #Acadia;
>> >> Â query: ( Z3950Query new author: 'Kant' ).
>> >>
>> >> (see http://67.222.12.200:8889/WebOpus/52 for sample successful
>> >> results)
>> >>
>> >> I will set up a Linux box tomorrow and try to reproduce there.
>> >> Cheers,
>> >>
>> >> 2010/12/22 laurent laffont <laurent.laffont(a)gmail.com>:
>> >> > Hi Hernan,
>> >> > finally I switch back to Linux to make it work, OSX gives me
>> >> > headaches.
>> >> > So on linux the yaz module is found. I get the "Unable to find
>> >> > function
>> >> > address" but I found that writing:
>> >> > <cdecl: ZOOMOptions 'ZOOM_options_create' (void) module: 'yaz'>
>> >> > instead of
>> >> > <cdecl: ZOOMOptions '_ZOOM_options_create@0' (void) module: 'yaz3'>
>> >> > works. If I understand, function names are not mangled when compiling
>> >> > with
>> >> > gcc on Linux.
>> >> >
>> >> > Trying to run tests I've also had a "could not coerce arguments" in
>> >> > Z3950FFILibrary>>createConnectionTo:port because
>> >> > Z3950TestCase>>portNumber
>> >> > answers a String and
>> >> > <cdecl: ZOOMConnection 'ZOOM_connection_new' (char* short) module:
>> >> > 'yaz'>
>> >> > so it's waiting for a short. I've replaced portNumber to answer a
>> >> > SmallInteger.
>> >> > And now the image crashes on connectionIsIdle call:
>> >> > write(1, "\ncreateConnectionTo:port:", 25) = 25
>> >> > write(1, "\nconnectionIsIdle:", 18) Â Â = 18
>> >> > rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
>> >> > write(1, "\n", 1) Â Â Â Â Â Â Â Â Â Â Â = 1
>> >> > tgkill(25830, 25830, SIGABRT) Â Â Â Â Â = 0
>> >> > --- SIGABRT (Aborted) @ 0 (0) ---
>> >> >
>> >> > Any idea ?
>> >> >
>> >> > Laurent Laffont
>> >> >
>> >> > On Tue, Dec 21, 2010 at 7:58 AM, laurent laffont
>> >> > <laurent.laffont(a)gmail.com>
>> >> > wrote:
>> >> >>
>> >> >> The module is found ! How:
>> >> >> - Using VM Squeak 5.8b12 2 Â (instead of Cog or the VM provided in
>> >> >> Seaside
>> >> >> One-Click image)
>> >> >> - go in Squeak\ 5.8b12\ 2.app/Contents/Resources/, then ln -s
>> >> >> /usr/local/lib/libyaz.3.dylib .
>> >> >> Now I have the "Unable to find function address" you have talked
>> >> >> earlier
>> >> >> :) I will look at the mangled function names.
>> >> >>
>> >> >> Laurent  --- on the road to the FFI mountain.
>> >> >>
>> >> >> On Tue, Dec 21, 2010 at 6:59 AM, Hernán Morales Durand
>> >> >> <hernan.morales(a)gmail.com> wrote:
>> >> >>>
>> >> >>> Laurent,
>> >> >>> I forward this e-mail to the squeak mailing list, may be someone
>> >> >>> there
>> >> >>> have a better idea how the OSX VM works. BTW there are more
>> >> >>> commentaries here
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>> http://forum.world.st/squeak-dev-Alien-amp-Squeak-FFI-issues-on-Snow-Leopar…
>> >> >>> Cheers,
>> >> >>>
>> >> >>> Hernán
>> >> >>>
>> >> >>> 2010/12/20 laurent laffont <laurent.laffont(a)gmail.com>:
>> >> >>> > Hi Hernan,
>> >> >>> > the strace equivalent on OSX seems to be dtruss (yes I'm learning
>> >> >>> > OSX
>> >> >>> > too :)
>> >> >>> > sudo dtruss -p [pid of process]
>> >> >>> > in the trace I have this:
>> >> >>> >
>> >> >>> >
>> >> >>> >
>> >> >>> > stat("/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3.bundle/Contents/MacOS/yaz3\0",
>> >> >>> > 0xBFF59440, 0xBFF5AB28) = -1 Err#2
>> >> >>> >
>> >> >>> >
>> >> >>> >
>> >> >>> > stat64("/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3.bundle/Contents/MacOS/yaz3\0",
>> >> >>> > 0xBFF5892C, 0xBFF5AB28) = -1 Err#2
>> >> >>> >
>> >> >>> >
>> >> >>> >
>> >> >>> > stat("/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3\0",
>> >> >>> > 0xBFF59440, 0xBFF5AB28) = 0 0
>> >> >>> >
>> >> >>> >
>> >> >>> >
>> >> >>> > stat64("/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3\0",
>> >> >>> > 0xBFF5892C, 0xBFF5AB28) = 0 0
>> >> >>> >
>> >> >>> >
>> >> >>> >
>> >> >>> > open("/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3\0",
>> >> >>> > 0x0, 0x0) = 12 0
>> >> >>> > pread(0xC, "\317\372\355\376\a\0", 0x1000, 0x0) = 4096 0
>> >> >>> > close(0xC) = 0 0
>> >> >>> >
>> >> >>> >
>> >> >>> >
>> >> >>> > stat("/Users/laurentlaffont/Downloads/Plugins/yaz3.bundle/Contents/MacOS/yaz3\0",
>> >> >>> > 0xBFF59440, 0x1000) = -1 Err#2
>> >> >>> >
>> >> >>> >
>> >> >>> >
>> >> >>> > stat64("/Users/laurentlaffont/Downloads/Plugins/yaz3.bundle/Contents/MacOS/yaz3\0",
>> >> >>> > 0xBFF5892C, 0x1000) = -1 Err#2
>> >> >>> > stat("/Users/laurentlaffont/Downloads/Plugins/yaz3\0",
>> >> >>> > 0xBFF59440,
>> >> >>> > 0x1000) =
>> >> >>> > -1 Err#2
>> >> >>> > stat64("/Users/laurentlaffont/Downloads/Plugins/yaz3\0",
>> >> >>> > 0xBFF5892C,
>> >> >>> > 0x1000)
>> >> >>> > = -1 Err#2
>> >> >>> >
>> >> >>> > so it looks like the VM is trying to find yaz3 at non standard
>> >> >>> > Unix
>> >> >>> > places
>> >> >>> > (I don't know if it's SqueakVM or OSX related).
>> >> >>> > I've created Contents/Resources/yaz3.bundle/Contents/MacOS/, put
>> >> >>> > yaz
>> >> >>> > lib
>> >> >>> > there, ln -s libyaz.3.dylib yaz3 but no success.
>> >> >>> >
>> >> >>> > I've read good
>> >> >>> > post http://forum.world.st/FFI-Documentation-td2225150.html :
>> >> >>> >
>> >> >>> > Module Location - where the external library file lives
>> >> >>> > Â Â Â - depends on the platform
>> >> >>> > Â Â Â Â Â Â Â - Mac
>> >> >>> > Â Â Â Â Â Â Â Â Â Â Â - pre Snow Leopard
>> >> >>> > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â - checks VM path and common library
>> >> >>> > paths
>> >> >>> > Â Â Â Â Â Â Â Â Â Â Â - Snow Leopard
>> >> >>> > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â - only looks in VM bundle's
>> >> >>> > Resources
>> >> >>> > file, you must either [5]:
>> >> >>> > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â - store all external
>> >> >>> > libraries
>> >> >>> > there
>> >> >>> > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â - ln -s path/to/library
>> >> >>> > path/to/VM/Resources/library_name
>> >> >>> > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â - Change the VM's
>> >> >>> > Info.plist
>> >> >>> > "SqueakPluginsBuiltInOrLocalOnly" key from
>> >> >>> > "true" to "false."
>> >> >>> >
>> >> >>> > For this SqueakPluginsBuiltInOrLocalOnly I suppose I need to
>> >> >>> > compile
>> >> >>> > a
>> >> >>> > VM ?
>> >> >>> > Cheers,
>> >> >>> > Laurent Laffont
>> >> >>> >
>> >> >>> >
>> >> >>> > On Mon, Dec 20, 2010 at 4:12 PM, Hernán Morales Durand
>> >> >>> > <hernan.morales(a)gmail.com> wrote:
>> >> >>> >>
>> >> >>> >> Hi Laurent
>> >> >>> >>
>> >> >>> >> I've read there is a couple of system calll monitors in MacOS,
>> >> >>> >> ktrace
>> >> >>> >> and dtrace (http://en.wikipedia.org/wiki/Ktrace ,
>> >> >>> >> http://en.wikipedia.org/wiki/DTrace) so you may attach to the VM
>> >> >>> >> and
>> >> >>> >> see what's missing?
>> >> >>> >> Cheers,
>> >> >>> >>
>> >> >>> >> Hernán
>> >> >>> >>
>> >> >>> >> 2010/12/20 laurent laffont <laurent.laffont(a)gmail.com>:
>> >> >>> >> > Thanks Hernan.
>> >> >>> >> > It still doesn't work. I've also tried to play with
>> >> >>> >> > LD_LOAD_PATH
>> >> >>> >> > /
>> >> >>> >> > LD_LIBRARY_PATH no success.... I want to make it work so I
>> >> >>> >> > need
>> >> >>> >> > to
>> >> >>> >> > learn
>> >> >>> >> > :)
>> >> >>> >> >
>> >> >>> >> > For the mangled function names, on Linux and OSX there's nm.
>> >> >>> >> > Here's what I get:
>> >> >>> >> > $ nm -g libyaz.3.dylib | grep ZOOM_connection_create
>> >> >>> >> > 0000000000046a30 T _ZOOM_connection_create
>> >> >>> >> > Cheers,
>> >> >>> >> > Laurent
>> >> >>> >> >
>> >> >>> >> > On Sun, Dec 19, 2010 at 6:23 PM, Hernán Morales Durand
>> >> >>> >> > <hernan.morales(a)gmail.com> wrote:
>> >> >>> >> >>
>> >> >>> >> >> Hi Laurent,
>> >> >>> >> >>
>> >> >>> >> >> Thanks for reporting. The correct #moduleName for MacOS was
>> >> >>> >> >> missing,
>> >> >>> >> >> I've uploaded a new version answering 'libyaz.3.dylib' which
>> >> >>> >> >> I
>> >> >>> >> >> guess
>> >> >>> >> >> is the corresponding for 'yaz3.dll' (according to
>> >> >>> >> >> http://en.wikipedia.org/wiki/Dynamic_library#Naming ).
>> >> >>> >> >>
>> >> >>> >> >> I haven't access to a MacOS, but in Windows I've had to find
>> >> >>> >> >> the
>> >> >>> >> >> mangled function names (i.e. _ZOOM_connection_create@4) so
>> >> >>> >> >> FFI
>> >> >>> >> >> can
>> >> >>> >> >> find the function addresses and you don't get the classic
>> >> >>> >> >> "Error:
>> >> >>> >> >> Unable to find function address". I don't know if it's
>> >> >>> >> >> related
>> >> >>> >> >> since
>> >> >>> >> >> talks about C++, but you may want to check
>> >> >>> >> >> http://wiki.squeak.org/squeak/3735
>> >> >>> >> >>
>> >> >>> >> >> The tool I've used to find the mangled function names in
>> >> >>> >> >> Windows
>> >> >>> >> >> is
>> >> >>> >> >> the Steve Miller's Dependency Walker
>> >> >>> >> >> http://www.dependencywalker.com/
>> >> >>> >> >>
>> >> >>> >> >> 2010/12/19 laurent laffont <laurent.laffont(a)gmail.com>:
>> >> >>> >> >> > Hi,
>> >> >>> >> >> >
>> >> >>> >> >> > I want to use http://www.squeaksource.com/Z3950
>> >> >>> >> >> > Following install instructions, I've dowloaded yaz sources
>> >> >>> >> >> > (I've
>> >> >>> >> >> > tried
>> >> >>> >> >> > 4.1.2
>> >> >>> >> >> > and 3.0.52) as it seems there's no binary for OSX,
>> >> >>> >> >> > ./configure
>> >> >>> >> >> > &&Â make
>> >> >>> >> >> > &&
>> >> >>> >> >> > make install.
>> >> >>> >> >> > Then using latest Seaside One Click image I've copied
>> >> >>> >> >> > /usr/local/lib/*yaz*
>> >> >>> >> >> > Â in Seaside.app/Contents/MacOS
>> >> >>> >> >> > $ ls ~/Downloads/Seaside.app/Contents/MacOS/
>> >> >>> >> >> > Squeak VM Opt     libyaz.a        libyaz.la
>> >> >>> >> >> > libyaz_icu.a      libyaz_icu.la     libyaz_server.a
>> >> >>> >> >> > libyaz_server.la libyaz.3.dylib     libyaz.dylib
>> >> >>> >> >> >  libyaz_icu.3.dylib   libyaz_icu.dylib
>> >> >>> >> >> > Â libyaz_server.3.dylib
>> >> >>> >> >> > libyaz_server.dylib
>> >> >>> >> >> >
>> >> >>> >> >> >
>> >> >>> >> >> > But then I have a External Module Not Found on
>> >> >>> >> >> > YAZPQFFFILibrary>>createParser
>> >> >>> >> >> > " YAZPQDFFILibrary default createParser "
>> >> >>> >> >> > <cdecl: YAZPQFParser 'yaz_pqf_create' (void) module:
>> >> >>> >> >> > 'yaz3'>
>> >> >>> >> >> > ^ self externalCallFailed
>> >> >>> >> >> >
>> >> >>> >> >> > Any hint ?
>> >> >>> >> >> > Cheers,
>> >> >>> >> >> > Laurent Laffont -- FFI newbie
>> >> >>> >> >> >
>> >> >>> >> >> > Pharo Smalltalk Screencasts: http://www.pharocasts.com/
>> >> >>> >> >> > Blog: http://magaloma.blogspot.com/
>> >> >>> >> >> >
>> >> >>> >> >>
>> >> >>> >> >> --
>> >> >>> >> >> Hernán Morales
>> >> >>> >> >> Information Technology Manager,
>> >> >>> >> >> Institute of Veterinary Genetics.
>> >> >>> >> >> National Scientific and Technical Research Council (CONICET).
>> >> >>> >> >> La Plata (1900), Buenos Aires, Argentina.
>> >> >>> >> >> Telephone: +54 (0221) 421-1799.
>> >> >>> >> >> Internal: 422
>> >> >>> >> >> Fax: 425-7980 or 421-1799.
>> >> >>> >> >
>
>
Dec. 24, 2010
[Pharo-project] Cog VM app icon
by Igor Stasenko
Hello,
i almost done with generating an app bundle for Cog VM , and i found
that it is using
a Croquet Icon.
Which doesn't seems right to me.
I remember there was a guy , who presented a nice cog icon and other graphics..
anyone knows where i can find them?
--
Best regards,
Igor Stasenko AKA sig.
Dec. 24, 2010
Re: [Pharo-project] Z3950 on OSX: module yaz3 not found
by Stéphane Ducasse
may be send this mail in the vm mailing-list
Stef
On Dec 24, 2010, at 3:54 AM, Hernán Morales Durand wrote:
> Laurent, not much progress here :(
> I just reproduced the Unix VM crash. First I've linked the library so
> we do not have to change every module name call
>
> user@ubuntu:/usr/lib$ ln -T -s /usr/lib/libyaz.so.3.0.0 yaz
>
> and I've tried to execute the library tracer in the shell script
>
> ltrace -f -l /usr/lib/libyaz.so.3.0.0 -o out.txt "$BASE/squeakvm" \
> -plugins "$BASE" \
> -encoding latin1 \
> -vm-display-X11 \
> "$ROOT/Contents/Resources/pharo.image"
>
> but it crash the VM too with an unhandled exception even before the
> GUI is displayed.
> What I've observed is that every FFI call which receives an
> ExternalStructure as parameter kills the VM. This is weird because
> this doesn't happen in the Windows VM. I ran this little script I use
> to debug the library
>
> | conn lib rs rsSize records |
> lib := Z3950FFILibrary default.
> conn := lib
> createConnectionTo: #Alabama asZ3950Server hostName
> port: 7090.
> lib createOptions.
> lib
> setConnection: conn
> optionName: 'preferredRecordSyntax'
> optionValue: 'USMARC'.
> rs := lib
> searchPqf: conn
> query: '@attr 1=1003 collins'.
> rsSize := lib resultSetSize: rs.
> rsSize > 0
> ifFalse: [ 'no results' ].
> records := Array new: rsSize.
> 0 to: rsSize - 1 do: [: pos |
> record := lib resultSetRecord: rs position: pos.
> record isNil not
> ifTrue: [
> records
> at: pos + 1
> put: ( lib
> getRecord: record
> function: 'render; charset=marc8, iso8859-1'
> length: nil ). ] ].
> records
>
> and the the doIt just hangs the VM, the console output going through
> the Debugger is the following:
>
> Segmentation fault
>
> -1370902312 ContextPart>doPrimitive:method:receiver:args:
> -1370902404 ContextPart>tryPrimitiveFor:receiver:args:
> -1370902788 ContextPart>send:to:with:super:
> -1370902896 ContextPart>send:super:numArgs:
> -1370902988 InstructionStream>interpretExtension:in:for:
> -1370903080 InstructionStream>interpretNextInstructionFor:
> -1370903172 ContextPart>step
> -1370903280 Process>step
> -1370903372 Process>step:
> -1370920392 Debugger>send
> -1370937720 PluggableButtonMorph>performAction
> -1370937812 PluggableButtonMorph>mouseUp:
> -1370937996 SequenceableCollection>do:
> -1370957140 PluggableButtonMorph>mouseUp:
> -1370957232 Morph>handleMouseUp:
> -1370957324 MouseButtonEvent>sentTo:
> -1370957416 Morph>handleEvent:
> -1370957584 Morph>handleFocusEvent:
> -1370957676 HandMorph>sendFocusEvent:to:clear:
> -1370957768 PasteUpMorph>becomeActiveDuring:
> -1370957860 BlockClosure>on:do:
> -1370957992 PasteUpMorph>becomeActiveDuring:
> -1370958084 HandMorph>sendFocusEvent:to:clear:
> -1370958260 HandMorph>sendEvent:focus:clear:
> -1370958352 HandMorph>sendMouseEvent:
> -1370958444 HandMorph>handleEvent:
> -1370966728 HandMorph>processEvents
> -1370966836 WorldState>doOneCycleNowFor:
> -1370966952 SequenceableCollection>do:
> -1370967044 WorldState>handsDo:
> -1370967136 WorldState>doOneCycleNowFor:
> -1370969680 WorldState>doOneCycleFor:
> -1370969772 PasteUpMorph>doOneCycle
> -1383611064 >spawnNewProcess
> -1383611192 BlockClosure>newProcess
> Aborted
>
> it would be nice if someone could tell something about debugging FFI
> calls, or just any idea to try.
> Cheers,
>
> Hernán
>
> 2010/12/23 laurent laffont <laurent.laffont(a)gmail.com>:
>> Hi,
>> I have unmangled all function names. Image also crashes when evaluating the
>> Kant test. (but this time I get ILLEGAL INSTRUCTION on strace). I've tried
>> with Cog and the VM in the Seaside OneClick.
>> I've uploaded the modified packages on squeaksource
>> here: http://www.squeaksource.com/LaurentLSandbox.html (you can use
>> Z3950Slice to load all at once).
>> Laurent
>>
>>
>>
>> On Thu, Dec 23, 2010 at 1:57 AM, Hernán Morales Durand
>> <hernan.morales(a)gmail.com> wrote:
>>>
>>> Hi Laurent,
>>>
>>> Thanks for the feedback, I've uploaded the repository with the missing
>>> method but I cannot reproduce the crash in Windows. Have you unmangled
>>> every function name tested? Are you running just the
>>> Z3950FFILibraryTest? Notice the Z3950FFIServerLibraryTest tests are
>>> performed against a Z39.50 server running in local host, otherwise
>>> will fail (however that shouldn't crash the VM), so you may want to
>>> run only the Z3950FFILibraryTest suite. If you or anyone want a local
>>> Zebra server for Win32 - although most configuration files should work
>>> with other platforms - for testing purposes please let me know.
>>>
>>> Does the Kant test crash the VM too?
>>>
>>> Z3950Client new
>>> server: #Acadia;
>>> query: ( Z3950Query new author: 'Kant' ).
>>>
>>> (see http://67.222.12.200:8889/WebOpus/52 for sample successful results)
>>>
>>> I will set up a Linux box tomorrow and try to reproduce there.
>>> Cheers,
>>>
>>> 2010/12/22 laurent laffont <laurent.laffont(a)gmail.com>:
>>>> Hi Hernan,
>>>> finally I switch back to Linux to make it work, OSX gives me headaches.
>>>> So on linux the yaz module is found. I get the "Unable to find function
>>>> address" but I found that writing:
>>>> <cdecl: ZOOMOptions 'ZOOM_options_create' (void) module: 'yaz'>
>>>> instead of
>>>> <cdecl: ZOOMOptions '_ZOOM_options_create@0' (void) module: 'yaz3'>
>>>> works. If I understand, function names are not mangled when compiling
>>>> with
>>>> gcc on Linux.
>>>>
>>>> Trying to run tests I've also had a "could not coerce arguments" in
>>>> Z3950FFILibrary>>createConnectionTo:port because
>>>> Z3950TestCase>>portNumber
>>>> answers a String and
>>>> <cdecl: ZOOMConnection 'ZOOM_connection_new' (char* short) module:
>>>> 'yaz'>
>>>> so it's waiting for a short. I've replaced portNumber to answer a
>>>> SmallInteger.
>>>> And now the image crashes on connectionIsIdle call:
>>>> write(1, "\ncreateConnectionTo:port:", 25) = 25
>>>> write(1, "\nconnectionIsIdle:", 18) = 18
>>>> rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
>>>> write(1, "\n", 1) = 1
>>>> tgkill(25830, 25830, SIGABRT) = 0
>>>> --- SIGABRT (Aborted) @ 0 (0) ---
>>>>
>>>> Any idea ?
>>>>
>>>> Laurent Laffont
>>>>
>>>> On Tue, Dec 21, 2010 at 7:58 AM, laurent laffont
>>>> <laurent.laffont(a)gmail.com>
>>>> wrote:
>>>>>
>>>>> The module is found ! How:
>>>>> - Using VM Squeak 5.8b12 2 (instead of Cog or the VM provided in
>>>>> Seaside
>>>>> One-Click image)
>>>>> - go in Squeak\ 5.8b12\ 2.app/Contents/Resources/, then ln -s
>>>>> /usr/local/lib/libyaz.3.dylib .
>>>>> Now I have the "Unable to find function address" you have talked
>>>>> earlier
>>>>> :) I will look at the mangled function names.
>>>>>
>>>>> Laurent --- on the road to the FFI mountain.
>>>>>
>>>>> On Tue, Dec 21, 2010 at 6:59 AM, Hernán Morales Durand
>>>>> <hernan.morales(a)gmail.com> wrote:
>>>>>>
>>>>>> Laurent,
>>>>>> I forward this e-mail to the squeak mailing list, may be someone there
>>>>>> have a better idea how the OSX VM works. BTW there are more
>>>>>> commentaries here
>>>>>>
>>>>>>
>>>>>> http://forum.world.st/squeak-dev-Alien-amp-Squeak-FFI-issues-on-Snow-Leopar…
>>>>>> Cheers,
>>>>>>
>>>>>> Hernán
>>>>>>
>>>>>> 2010/12/20 laurent laffont <laurent.laffont(a)gmail.com>:
>>>>>>> Hi Hernan,
>>>>>>> the strace equivalent on OSX seems to be dtruss (yes I'm learning
>>>>>>> OSX
>>>>>>> too :)
>>>>>>> sudo dtruss -p [pid of process]
>>>>>>> in the trace I have this:
>>>>>>>
>>>>>>>
>>>>>>> stat("/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3.bundle/Contents/MacOS/yaz3\0",
>>>>>>> 0xBFF59440, 0xBFF5AB28) = -1 Err#2
>>>>>>>
>>>>>>>
>>>>>>> stat64("/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3.bundle/Contents/MacOS/yaz3\0",
>>>>>>> 0xBFF5892C, 0xBFF5AB28) = -1 Err#2
>>>>>>>
>>>>>>>
>>>>>>> stat("/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3\0",
>>>>>>> 0xBFF59440, 0xBFF5AB28) = 0 0
>>>>>>>
>>>>>>>
>>>>>>> stat64("/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3\0",
>>>>>>> 0xBFF5892C, 0xBFF5AB28) = 0 0
>>>>>>>
>>>>>>>
>>>>>>> open("/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3\0",
>>>>>>> 0x0, 0x0) = 12 0
>>>>>>> pread(0xC, "\317\372\355\376\a\0", 0x1000, 0x0) = 4096 0
>>>>>>> close(0xC) = 0 0
>>>>>>>
>>>>>>>
>>>>>>> stat("/Users/laurentlaffont/Downloads/Plugins/yaz3.bundle/Contents/MacOS/yaz3\0",
>>>>>>> 0xBFF59440, 0x1000) = -1 Err#2
>>>>>>>
>>>>>>>
>>>>>>> stat64("/Users/laurentlaffont/Downloads/Plugins/yaz3.bundle/Contents/MacOS/yaz3\0",
>>>>>>> 0xBFF5892C, 0x1000) = -1 Err#2
>>>>>>> stat("/Users/laurentlaffont/Downloads/Plugins/yaz3\0", 0xBFF59440,
>>>>>>> 0x1000) =
>>>>>>> -1 Err#2
>>>>>>> stat64("/Users/laurentlaffont/Downloads/Plugins/yaz3\0", 0xBFF5892C,
>>>>>>> 0x1000)
>>>>>>> = -1 Err#2
>>>>>>>
>>>>>>> so it looks like the VM is trying to find yaz3 at non standard Unix
>>>>>>> places
>>>>>>> (I don't know if it's SqueakVM or OSX related).
>>>>>>> I've created Contents/Resources/yaz3.bundle/Contents/MacOS/, put yaz
>>>>>>> lib
>>>>>>> there, ln -s libyaz.3.dylib yaz3 but no success.
>>>>>>>
>>>>>>> I've read good
>>>>>>> post http://forum.world.st/FFI-Documentation-td2225150.html :
>>>>>>>
>>>>>>> Module Location - where the external library file lives
>>>>>>> - depends on the platform
>>>>>>> - Mac
>>>>>>> - pre Snow Leopard
>>>>>>> - checks VM path and common library
>>>>>>> paths
>>>>>>> - Snow Leopard
>>>>>>> - only looks in VM bundle's Resources
>>>>>>> file, you must either [5]:
>>>>>>> - store all external libraries
>>>>>>> there
>>>>>>> - ln -s path/to/library
>>>>>>> path/to/VM/Resources/library_name
>>>>>>> - Change the VM's Info.plist
>>>>>>> "SqueakPluginsBuiltInOrLocalOnly" key from
>>>>>>> "true" to "false."
>>>>>>>
>>>>>>> For this SqueakPluginsBuiltInOrLocalOnly I suppose I need to compile
>>>>>>> a
>>>>>>> VM ?
>>>>>>> Cheers,
>>>>>>> Laurent Laffont
>>>>>>>
>>>>>>>
>>>>>>> On Mon, Dec 20, 2010 at 4:12 PM, Hernán Morales Durand
>>>>>>> <hernan.morales(a)gmail.com> wrote:
>>>>>>>>
>>>>>>>> Hi Laurent
>>>>>>>>
>>>>>>>> I've read there is a couple of system calll monitors in MacOS,
>>>>>>>> ktrace
>>>>>>>> and dtrace (http://en.wikipedia.org/wiki/Ktrace ,
>>>>>>>> http://en.wikipedia.org/wiki/DTrace) so you may attach to the VM
>>>>>>>> and
>>>>>>>> see what's missing?
>>>>>>>> Cheers,
>>>>>>>>
>>>>>>>> Hernán
>>>>>>>>
>>>>>>>> 2010/12/20 laurent laffont <laurent.laffont(a)gmail.com>:
>>>>>>>>> Thanks Hernan.
>>>>>>>>> It still doesn't work. I've also tried to play with LD_LOAD_PATH
>>>>>>>>> /
>>>>>>>>> LD_LIBRARY_PATH no success.... I want to make it work so I need
>>>>>>>>> to
>>>>>>>>> learn
>>>>>>>>> :)
>>>>>>>>>
>>>>>>>>> For the mangled function names, on Linux and OSX there's nm.
>>>>>>>>> Here's what I get:
>>>>>>>>> $ nm -g libyaz.3.dylib | grep ZOOM_connection_create
>>>>>>>>> 0000000000046a30 T _ZOOM_connection_create
>>>>>>>>> Cheers,
>>>>>>>>> Laurent
>>>>>>>>>
>>>>>>>>> On Sun, Dec 19, 2010 at 6:23 PM, Hernán Morales Durand
>>>>>>>>> <hernan.morales(a)gmail.com> wrote:
>>>>>>>>>>
>>>>>>>>>> Hi Laurent,
>>>>>>>>>>
>>>>>>>>>> Thanks for reporting. The correct #moduleName for MacOS was
>>>>>>>>>> missing,
>>>>>>>>>> I've uploaded a new version answering 'libyaz.3.dylib' which I
>>>>>>>>>> guess
>>>>>>>>>> is the corresponding for 'yaz3.dll' (according to
>>>>>>>>>> http://en.wikipedia.org/wiki/Dynamic_library#Naming ).
>>>>>>>>>>
>>>>>>>>>> I haven't access to a MacOS, but in Windows I've had to find the
>>>>>>>>>> mangled function names (i.e. _ZOOM_connection_create@4) so FFI
>>>>>>>>>> can
>>>>>>>>>> find the function addresses and you don't get the classic
>>>>>>>>>> "Error:
>>>>>>>>>> Unable to find function address". I don't know if it's related
>>>>>>>>>> since
>>>>>>>>>> talks about C++, but you may want to check
>>>>>>>>>> http://wiki.squeak.org/squeak/3735
>>>>>>>>>>
>>>>>>>>>> The tool I've used to find the mangled function names in Windows
>>>>>>>>>> is
>>>>>>>>>> the Steve Miller's Dependency Walker
>>>>>>>>>> http://www.dependencywalker.com/
>>>>>>>>>>
>>>>>>>>>> 2010/12/19 laurent laffont <laurent.laffont(a)gmail.com>:
>>>>>>>>>>> Hi,
>>>>>>>>>>>
>>>>>>>>>>> I want to use http://www.squeaksource.com/Z3950
>>>>>>>>>>> Following install instructions, I've dowloaded yaz sources
>>>>>>>>>>> (I've
>>>>>>>>>>> tried
>>>>>>>>>>> 4.1.2
>>>>>>>>>>> and 3.0.52) as it seems there's no binary for OSX, ./configure
>>>>>>>>>>> && make
>>>>>>>>>>> &&
>>>>>>>>>>> make install.
>>>>>>>>>>> Then using latest Seaside One Click image I've copied
>>>>>>>>>>> /usr/local/lib/*yaz*
>>>>>>>>>>> in Seaside.app/Contents/MacOS
>>>>>>>>>>> $ ls ~/Downloads/Seaside.app/Contents/MacOS/
>>>>>>>>>>> Squeak VM Opt libyaz.a libyaz.la
>>>>>>>>>>> libyaz_icu.a libyaz_icu.la libyaz_server.a
>>>>>>>>>>> libyaz_server.la libyaz.3.dylib libyaz.dylib
>>>>>>>>>>> libyaz_icu.3.dylib libyaz_icu.dylib
>>>>>>>>>>> libyaz_server.3.dylib
>>>>>>>>>>> libyaz_server.dylib
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> But then I have a External Module Not Found on
>>>>>>>>>>> YAZPQFFFILibrary>>createParser
>>>>>>>>>>> " YAZPQDFFILibrary default createParser "
>>>>>>>>>>> <cdecl: YAZPQFParser 'yaz_pqf_create' (void) module: 'yaz3'>
>>>>>>>>>>> ^ self externalCallFailed
>>>>>>>>>>>
>>>>>>>>>>> Any hint ?
>>>>>>>>>>> Cheers,
>>>>>>>>>>> Laurent Laffont -- FFI newbie
>>>>>>>>>>>
>>>>>>>>>>> Pharo Smalltalk Screencasts: http://www.pharocasts.com/
>>>>>>>>>>> Blog: http://magaloma.blogspot.com/
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Hernán Morales
>>>>>>>>>> Information Technology Manager,
>>>>>>>>>> Institute of Veterinary Genetics.
>>>>>>>>>> National Scientific and Technical Research Council (CONICET).
>>>>>>>>>> La Plata (1900), Buenos Aires, Argentina.
>>>>>>>>>> Telephone: +54 (0221) 421-1799.
>>>>>>>>>> Internal: 422
>>>>>>>>>> Fax: 425-7980 or 421-1799.
>>>>>>>>>
>
Dec. 24, 2010
Re: [Pharo-project] Pharo 2010 - Thank you!
by Stéphane Ducasse
sorry suixo
http://gsoc2010.esug.org/projects/suixo-enhance
Context
Suixo is an open source Smalltalk Seaside application framework used to build a.o. a vertical market solution for healthcare. The healthcare solution is currently used daily by about 80 users. Suixo is an application level framework and currently features:
⢠Workflow engine
⢠Generic party model (company / person)
⢠Role based access control
⢠Time tracking
⢠Content management system
So I was wrong.
On Dec 24, 2010, at 10:19 AM, Dario Trussardi wrote:
> Dear Stef
>
>> dario did you look at (I always forget the name) suiza?
>> Because this is a start of that?
>>
>
> I don't understand your reference.
>
> What is suiza ?
>
> Can you add some information about it ?
>
>
>> Stef
>>
>>
>>> +1
>>>
>>> Good Christmas to you and your family.
>>>
>>>
>>> About:
>>>
>>> do you think that a good open-source ERP in Smalltalk would help you?
>>>
>>>
>>> I'm interesting to ERP in Smalltalk.
>>>
>>> I think it with:
>>>
>>> - Seaside interface
>>>
>>> - Gemstone OODB ( GLASS )
>>>
>>> - Magritte for meta data base description
>>>
>>>
>>> Ciao,
>>>
>>> Dario
>>>
>>
>
> Thank,
>
> Dario
>
Dec. 24, 2010
Re: [Pharo-project] Alien + Cog VM
by Patricio Plaza A.
Hi Eliot,
Nowadays I'm working on Alien in Pharo 1.1 and I'd like to know how to work in Pharo 1.2 running Cog VM, do you have some example using Alien/AlienOpenGL?
Merry Christmas,
Patricio
El 10-11-2010, a las 22:40, Eliot Miranda escribió:
> Hi Ken,
>
> On Wed, Nov 10, 2010 at 10:20 AM, Ken Treis <ken(a)miriamtech.com> wrote:
> What's the status of Alien in the new Cog VM? I was able to load Alien into Pharo 1.1.1 running Cog, and some simple callouts worked (e.g. `CRLibrary libraryVersionString` in CairoGraphics. But every callout with arguments failed in primFFICallResult:.
>
> Alien works perfectly for me in Pharo 1.1 using JMM's VMs when I load the Pharo 1.1 version from ConfigurationOfAlien, but I admit I haven't tried 1.1.1 in this arrangement.
>
> Is there something that's changed in Cog's Alien primitive implementation?
>
> IIRC, the Alien callout code is written assuming stacks grow up (in MethodContext instances) whereas in the Cog Stack and JIT VMs stacks grow down. So the glue in platforms/Cross/plugins/IA32ABI/dabusiness.h needs rewriting. Specifically the second loop over the arguments at line 45 needs to mimic the code at line 17. (I know, insane; why have two different loops in the first place? counting down towards zero can generate slightly faster code than counting up towards a limit; you need one less register).
>
> But I'm hoping that the ALien callouts will die the death soon. I have Alien callbacks integrated with the FFI and of course the ALien data manipulation code works fine. So if you're eager to have Alien callouts work see whether the above change fixes things, in which case I can integrate the fix. But if you're not so eager you could wait for me to push out the FFI changes, but that could take a few weeks.
>
> HTH
> Eliot
>
> --
> Ken Treis
> Miriam Technologies, Inc.
>
>
>
Dec. 24, 2010
Re: [Pharo-project] Pharo 2010 - Thank you!
by Dario Trussardi
Dear Stef
> dario did you look at (I always forget the name) suiza?
> Because this is a start of that?
>
I don't understand your reference.
What is suiza ?
Can you add some information about it ?
> Stef
>
>
>> +1
>>
>> Good Christmas to you and your family.
>>
>>
>> About:
>>
>> do you think that a good open-source ERP in Smalltalk would help you?
>>
>>
>> I'm interesting to ERP in Smalltalk.
>>
>> I think it with:
>>
>> - Seaside interface
>>
>> - Gemstone OODB ( GLASS )
>>
>> - Magritte for meta data base description
>>
>>
>> Ciao,
>>
>> Dario
>>
>
Thank,
Dario
Dec. 24, 2010
Re: [Pharo-project] FFI crashes VM on Linux (was: Z3950 on OSX: module yaz3 not found)
by laurent laffont
Which VM have you used ?
I cross post to vm-dev list.
Laurent.
On Fri, Dec 24, 2010 at 3:54 AM, Hernán Morales Durand <
hernan.morales(a)gmail.com> wrote:
> Laurent, not much progress here :(
> I just reproduced the Unix VM crash. First I've linked the library so
> we do not have to change every module name call
>
> user@ubuntu:/usr/lib$ ln -T -s /usr/lib/libyaz.so.3.0.0 yaz
>
> and I've tried to execute the library tracer in the shell script
>
> ltrace -f -l /usr/lib/libyaz.so.3.0.0 -o out.txt "$BASE/squeakvm" \
> -plugins "$BASE" \
> -encoding latin1 \
> -vm-display-X11 \
> "$ROOT/Contents/Resources/pharo.image"
>
> but it crash the VM too with an unhandled exception even before the
> GUI is displayed.
> What I've observed is that every FFI call which receives an
> ExternalStructure as parameter kills the VM. This is weird because
> this doesn't happen in the Windows VM. I ran this little script I use
> to debug the library
>
> | conn lib rs rsSize records |
> lib := Z3950FFILibrary default.
> conn := lib
> createConnectionTo: #Alabama asZ3950Server hostName
> port: 7090.
> lib createOptions.
> lib
> setConnection: conn
> optionName: 'preferredRecordSyntax'
> optionValue: 'USMARC'.
> rs := lib
> searchPqf: conn
> query: '@attr 1=1003 collins'.
> rsSize := lib resultSetSize: rs.
> rsSize > 0
> ifFalse: [ 'no results' ].
> records := Array new: rsSize.
> 0 to: rsSize - 1 do: [: pos |
> record := lib resultSetRecord: rs position: pos.
> record isNil not
> ifTrue: [
> records
> at: pos + 1
> put: ( lib
> getRecord: record
> function: 'render; charset=marc8,
> iso8859-1'
> length: nil ). ] ].
> records
>
> and the the doIt just hangs the VM, the console output going through
> the Debugger is the following:
>
> Segmentation fault
>
> -1370902312 ContextPart>doPrimitive:method:receiver:args:
> -1370902404 ContextPart>tryPrimitiveFor:receiver:args:
> -1370902788 ContextPart>send:to:with:super:
> -1370902896 ContextPart>send:super:numArgs:
> -1370902988 InstructionStream>interpretExtension:in:for:
> -1370903080 InstructionStream>interpretNextInstructionFor:
> -1370903172 ContextPart>step
> -1370903280 Process>step
> -1370903372 Process>step:
> -1370920392 Debugger>send
> -1370937720 PluggableButtonMorph>performAction
> -1370937812 PluggableButtonMorph>mouseUp:
> -1370937996 SequenceableCollection>do:
> -1370957140 PluggableButtonMorph>mouseUp:
> -1370957232 Morph>handleMouseUp:
> -1370957324 MouseButtonEvent>sentTo:
> -1370957416 Morph>handleEvent:
> -1370957584 Morph>handleFocusEvent:
> -1370957676 HandMorph>sendFocusEvent:to:clear:
> -1370957768 PasteUpMorph>becomeActiveDuring:
> -1370957860 BlockClosure>on:do:
> -1370957992 PasteUpMorph>becomeActiveDuring:
> -1370958084 HandMorph>sendFocusEvent:to:clear:
> -1370958260 HandMorph>sendEvent:focus:clear:
> -1370958352 HandMorph>sendMouseEvent:
> -1370958444 HandMorph>handleEvent:
> -1370966728 HandMorph>processEvents
> -1370966836 WorldState>doOneCycleNowFor:
> -1370966952 SequenceableCollection>do:
> -1370967044 WorldState>handsDo:
> -1370967136 WorldState>doOneCycleNowFor:
> -1370969680 WorldState>doOneCycleFor:
> -1370969772 PasteUpMorph>doOneCycle
> -1383611064 >spawnNewProcess
> -1383611192 BlockClosure>newProcess
> Aborted
>
> it would be nice if someone could tell something about debugging FFI
> calls, or just any idea to try.
> Cheers,
>
> Hernán
>
> 2010/12/23 laurent laffont <laurent.laffont(a)gmail.com>:
> > Hi,
> > I have unmangled all function names. Image also crashes when evaluating
> the
> > Kant test. (but this time I get ILLEGAL INSTRUCTION on strace). I've
> tried
> > with Cog and the VM in the Seaside OneClick.
> > I've uploaded the modified packages on squeaksource
> > here: http://www.squeaksource.com/LaurentLSandbox.html (you can use
> > Z3950Slice to load all at once).
> > Laurent
> >
> >
> >
> > On Thu, Dec 23, 2010 at 1:57 AM, Hernán Morales Durand
> > <hernan.morales(a)gmail.com> wrote:
> >>
> >> Hi Laurent,
> >>
> >> Thanks for the feedback, I've uploaded the repository with the missing
> >> method but I cannot reproduce the crash in Windows. Have you unmangled
> >> every function name tested? Are you running just the
> >> Z3950FFILibraryTest? Notice the Z3950FFIServerLibraryTest tests are
> >> performed against a Z39.50 server running in local host, otherwise
> >> will fail (however that shouldn't crash the VM), so you may want to
> >> run only the Z3950FFILibraryTest suite. If you or anyone want a local
> >> Zebra server for Win32 - although most configuration files should work
> >> with other platforms - for testing purposes please let me know.
> >>
> >> Does the Kant test crash the VM too?
> >>
> >> Z3950Client new
> >> server: #Acadia;
> >> query: ( Z3950Query new author: 'Kant' ).
> >>
> >> (see http://67.222.12.200:8889/WebOpus/52 for sample successful
> results)
> >>
> >> I will set up a Linux box tomorrow and try to reproduce there.
> >> Cheers,
> >>
> >> 2010/12/22 laurent laffont <laurent.laffont(a)gmail.com>:
> >> > Hi Hernan,
> >> > finally I switch back to Linux to make it work, OSX gives me
> headaches.
> >> > So on linux the yaz module is found. I get the "Unable to find
> function
> >> > address" but I found that writing:
> >> > <cdecl: ZOOMOptions 'ZOOM_options_create' (void) module: 'yaz'>
> >> > instead of
> >> > <cdecl: ZOOMOptions '_ZOOM_options_create@0' (void) module: 'yaz3'>
> >> > works. If I understand, function names are not mangled when compiling
> >> > with
> >> > gcc on Linux.
> >> >
> >> > Trying to run tests I've also had a "could not coerce arguments" in
> >> > Z3950FFILibrary>>createConnectionTo:port because
> >> > Z3950TestCase>>portNumber
> >> > answers a String and
> >> > <cdecl: ZOOMConnection 'ZOOM_connection_new' (char* short) module:
> >> > 'yaz'>
> >> > so it's waiting for a short. I've replaced portNumber to answer a
> >> > SmallInteger.
> >> > And now the image crashes on connectionIsIdle call:
> >> > write(1, "\ncreateConnectionTo:port:", 25) = 25
> >> > write(1, "\nconnectionIsIdle:", 18) = 18
> >> > rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
> >> > write(1, "\n", 1) = 1
> >> > tgkill(25830, 25830, SIGABRT) = 0
> >> > --- SIGABRT (Aborted) @ 0 (0) ---
> >> >
> >> > Any idea ?
> >> >
> >> > Laurent Laffont
> >> >
> >> > On Tue, Dec 21, 2010 at 7:58 AM, laurent laffont
> >> > <laurent.laffont(a)gmail.com>
> >> > wrote:
> >> >>
> >> >> The module is found ! How:
> >> >> - Using VM Squeak 5.8b12 2 (instead of Cog or the VM provided in
> >> >> Seaside
> >> >> One-Click image)
> >> >> - go in Squeak\ 5.8b12\ 2.app/Contents/Resources/, then ln -s
> >> >> /usr/local/lib/libyaz.3.dylib .
> >> >> Now I have the "Unable to find function address" you have talked
> >> >> earlier
> >> >> :) I will look at the mangled function names.
> >> >>
> >> >> Laurent --- on the road to the FFI mountain.
> >> >>
> >> >> On Tue, Dec 21, 2010 at 6:59 AM, Hernán Morales Durand
> >> >> <hernan.morales(a)gmail.com> wrote:
> >> >>>
> >> >>> Laurent,
> >> >>> I forward this e-mail to the squeak mailing list, may be someone
> there
> >> >>> have a better idea how the OSX VM works. BTW there are more
> >> >>> commentaries here
> >> >>>
> >> >>>
> >> >>>
> http://forum.world.st/squeak-dev-Alien-amp-Squeak-FFI-issues-on-Snow-Leopar…
> >> >>> Cheers,
> >> >>>
> >> >>> Hernán
> >> >>>
> >> >>> 2010/12/20 laurent laffont <laurent.laffont(a)gmail.com>:
> >> >>> > Hi Hernan,
> >> >>> > the strace equivalent on OSX seems to be dtruss (yes I'm learning
> >> >>> > OSX
> >> >>> > too :)
> >> >>> > sudo dtruss -p [pid of process]
> >> >>> > in the trace I have this:
> >> >>> >
> >> >>> >
> >> >>> >
> stat("/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3.bundle/Contents/MacOS/yaz3\0",
> >> >>> > 0xBFF59440, 0xBFF5AB28) = -1 Err#2
> >> >>> >
> >> >>> >
> >> >>> >
> stat64("/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3.bundle/Contents/MacOS/yaz3\0",
> >> >>> > 0xBFF5892C, 0xBFF5AB28) = -1 Err#2
> >> >>> >
> >> >>> >
> >> >>> >
> stat("/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3\0",
> >> >>> > 0xBFF59440, 0xBFF5AB28) = 0 0
> >> >>> >
> >> >>> >
> >> >>> >
> stat64("/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3\0",
> >> >>> > 0xBFF5892C, 0xBFF5AB28) = 0 0
> >> >>> >
> >> >>> >
> >> >>> >
> open("/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3\0",
> >> >>> > 0x0, 0x0) = 12 0
> >> >>> > pread(0xC, "\317\372\355\376\a\0", 0x1000, 0x0) = 4096 0
> >> >>> > close(0xC) = 0 0
> >> >>> >
> >> >>> >
> >> >>> >
> stat("/Users/laurentlaffont/Downloads/Plugins/yaz3.bundle/Contents/MacOS/yaz3\0",
> >> >>> > 0xBFF59440, 0x1000) = -1 Err#2
> >> >>> >
> >> >>> >
> >> >>> >
> stat64("/Users/laurentlaffont/Downloads/Plugins/yaz3.bundle/Contents/MacOS/yaz3\0",
> >> >>> > 0xBFF5892C, 0x1000) = -1 Err#2
> >> >>> > stat("/Users/laurentlaffont/Downloads/Plugins/yaz3\0", 0xBFF59440,
> >> >>> > 0x1000) =
> >> >>> > -1 Err#2
> >> >>> > stat64("/Users/laurentlaffont/Downloads/Plugins/yaz3\0",
> 0xBFF5892C,
> >> >>> > 0x1000)
> >> >>> > = -1 Err#2
> >> >>> >
> >> >>> > so it looks like the VM is trying to find yaz3 at non standard
> Unix
> >> >>> > places
> >> >>> > (I don't know if it's SqueakVM or OSX related).
> >> >>> > I've created Contents/Resources/yaz3.bundle/Contents/MacOS/, put
> yaz
> >> >>> > lib
> >> >>> > there, ln -s libyaz.3.dylib yaz3 but no success.
> >> >>> >
> >> >>> > I've read good
> >> >>> > post http://forum.world.st/FFI-Documentation-td2225150.html :
> >> >>> >
> >> >>> > Module Location - where the external library file lives
> >> >>> > - depends on the platform
> >> >>> > - Mac
> >> >>> > - pre Snow Leopard
> >> >>> > - checks VM path and common library
> >> >>> > paths
> >> >>> > - Snow Leopard
> >> >>> > - only looks in VM bundle's
> Resources
> >> >>> > file, you must either [5]:
> >> >>> > - store all external
> libraries
> >> >>> > there
> >> >>> > - ln -s path/to/library
> >> >>> > path/to/VM/Resources/library_name
> >> >>> > - Change the VM's Info.plist
> >> >>> > "SqueakPluginsBuiltInOrLocalOnly" key from
> >> >>> > "true" to "false."
> >> >>> >
> >> >>> > For this SqueakPluginsBuiltInOrLocalOnly I suppose I need to
> compile
> >> >>> > a
> >> >>> > VM ?
> >> >>> > Cheers,
> >> >>> > Laurent Laffont
> >> >>> >
> >> >>> >
> >> >>> > On Mon, Dec 20, 2010 at 4:12 PM, Hernán Morales Durand
> >> >>> > <hernan.morales(a)gmail.com> wrote:
> >> >>> >>
> >> >>> >> Hi Laurent
> >> >>> >>
> >> >>> >> I've read there is a couple of system calll monitors in MacOS,
> >> >>> >> ktrace
> >> >>> >> and dtrace (http://en.wikipedia.org/wiki/Ktrace ,
> >> >>> >> http://en.wikipedia.org/wiki/DTrace) so you may attach to the VM
> >> >>> >> and
> >> >>> >> see what's missing?
> >> >>> >> Cheers,
> >> >>> >>
> >> >>> >> Hernán
> >> >>> >>
> >> >>> >> 2010/12/20 laurent laffont <laurent.laffont(a)gmail.com>:
> >> >>> >> > Thanks Hernan.
> >> >>> >> > It still doesn't work. I've also tried to play with
> LD_LOAD_PATH
> >> >>> >> > /
> >> >>> >> > LD_LIBRARY_PATH no success.... I want to make it work so I need
> >> >>> >> > to
> >> >>> >> > learn
> >> >>> >> > :)
> >> >>> >> >
> >> >>> >> > For the mangled function names, on Linux and OSX there's nm.
> >> >>> >> > Here's what I get:
> >> >>> >> > $ nm -g libyaz.3.dylib | grep ZOOM_connection_create
> >> >>> >> > 0000000000046a30 T _ZOOM_connection_create
> >> >>> >> > Cheers,
> >> >>> >> > Laurent
> >> >>> >> >
> >> >>> >> > On Sun, Dec 19, 2010 at 6:23 PM, Hernán Morales Durand
> >> >>> >> > <hernan.morales(a)gmail.com> wrote:
> >> >>> >> >>
> >> >>> >> >> Hi Laurent,
> >> >>> >> >>
> >> >>> >> >> Thanks for reporting. The correct #moduleName for MacOS was
> >> >>> >> >> missing,
> >> >>> >> >> I've uploaded a new version answering 'libyaz.3.dylib' which I
> >> >>> >> >> guess
> >> >>> >> >> is the corresponding for 'yaz3.dll' (according to
> >> >>> >> >> http://en.wikipedia.org/wiki/Dynamic_library#Naming ).
> >> >>> >> >>
> >> >>> >> >> I haven't access to a MacOS, but in Windows I've had to find
> the
> >> >>> >> >> mangled function names (i.e. _ZOOM_connection_create@4) so
> FFI
> >> >>> >> >> can
> >> >>> >> >> find the function addresses and you don't get the classic
> >> >>> >> >> "Error:
> >> >>> >> >> Unable to find function address". I don't know if it's related
> >> >>> >> >> since
> >> >>> >> >> talks about C++, but you may want to check
> >> >>> >> >> http://wiki.squeak.org/squeak/3735
> >> >>> >> >>
> >> >>> >> >> The tool I've used to find the mangled function names in
> Windows
> >> >>> >> >> is
> >> >>> >> >> the Steve Miller's Dependency Walker
> >> >>> >> >> http://www.dependencywalker.com/
> >> >>> >> >>
> >> >>> >> >> 2010/12/19 laurent laffont <laurent.laffont(a)gmail.com>:
> >> >>> >> >> > Hi,
> >> >>> >> >> >
> >> >>> >> >> > I want to use http://www.squeaksource.com/Z3950
> >> >>> >> >> > Following install instructions, I've dowloaded yaz sources
> >> >>> >> >> > (I've
> >> >>> >> >> > tried
> >> >>> >> >> > 4.1.2
> >> >>> >> >> > and 3.0.52) as it seems there's no binary for OSX,
> ./configure
> >> >>> >> >> > && make
> >> >>> >> >> > &&
> >> >>> >> >> > make install.
> >> >>> >> >> > Then using latest Seaside One Click image I've copied
> >> >>> >> >> > /usr/local/lib/*yaz*
> >> >>> >> >> > in Seaside.app/Contents/MacOS
> >> >>> >> >> > $ ls ~/Downloads/Seaside.app/Contents/MacOS/
> >> >>> >> >> > Squeak VM Opt libyaz.a libyaz.la
> >> >>> >> >> > libyaz_icu.a libyaz_icu.la libyaz_server.a
> >> >>> >> >> > libyaz_server.la libyaz.3.dylib libyaz.dylib
> >> >>> >> >> > libyaz_icu.3.dylib libyaz_icu.dylib
> >> >>> >> >> > libyaz_server.3.dylib
> >> >>> >> >> > libyaz_server.dylib
> >> >>> >> >> >
> >> >>> >> >> >
> >> >>> >> >> > But then I have a External Module Not Found on
> >> >>> >> >> > YAZPQFFFILibrary>>createParser
> >> >>> >> >> > " YAZPQDFFILibrary default createParser "
> >> >>> >> >> > <cdecl: YAZPQFParser 'yaz_pqf_create' (void) module: 'yaz3'>
> >> >>> >> >> > ^ self externalCallFailed
> >> >>> >> >> >
> >> >>> >> >> > Any hint ?
> >> >>> >> >> > Cheers,
> >> >>> >> >> > Laurent Laffont -- FFI newbie
> >> >>> >> >> >
> >> >>> >> >> > Pharo Smalltalk Screencasts: http://www.pharocasts.com/
> >> >>> >> >> > Blog: http://magaloma.blogspot.com/
> >> >>> >> >> >
> >> >>> >> >>
> >> >>> >> >> --
> >> >>> >> >> Hernán Morales
> >> >>> >> >> Information Technology Manager,
> >> >>> >> >> Institute of Veterinary Genetics.
> >> >>> >> >> National Scientific and Technical Research Council (CONICET).
> >> >>> >> >> La Plata (1900), Buenos Aires, Argentina.
> >> >>> >> >> Telephone: +54 (0221) 421-1799.
> >> >>> >> >> Internal: 422
> >> >>> >> >> Fax: 425-7980 or 421-1799.
> >> >>> >> >
>
Dec. 24, 2010
Re: [Pharo-project] Z3950 on OSX: module yaz3 not found
by Hernán Morales Durand
Laurent, not much progress here :(
I just reproduced the Unix VM crash. First I've linked the library so
we do not have to change every module name call
user@ubuntu:/usr/lib$ ln -T -s /usr/lib/libyaz.so.3.0.0 yaz
and I've tried to execute the library tracer in the shell script
ltrace -f -l /usr/lib/libyaz.so.3.0.0 -o out.txt "$BASE/squeakvm" \
-plugins "$BASE" \
-encoding latin1 \
-vm-display-X11 \
"$ROOT/Contents/Resources/pharo.image"
but it crash the VM too with an unhandled exception even before the
GUI is displayed.
What I've observed is that every FFI call which receives an
ExternalStructure as parameter kills the VM. This is weird because
this doesn't happen in the Windows VM. I ran this little script I use
to debug the library
| conn lib rs rsSize records |
lib := Z3950FFILibrary default.
conn := lib
createConnectionTo: #Alabama asZ3950Server hostName
port: 7090.
lib createOptions.
lib
setConnection: conn
optionName: 'preferredRecordSyntax'
optionValue: 'USMARC'.
rs := lib
searchPqf: conn
query: '@attr 1=1003 collins'.
rsSize := lib resultSetSize: rs.
rsSize > 0
ifFalse: [ 'no results' ].
records := Array new: rsSize.
0 to: rsSize - 1 do: [: pos |
record := lib resultSetRecord: rs position: pos.
record isNil not
ifTrue: [
records
at: pos + 1
put: ( lib
getRecord: record
function: 'render; charset=marc8, iso8859-1'
length: nil ). ] ].
records
and the the doIt just hangs the VM, the console output going through
the Debugger is the following:
Segmentation fault
-1370902312 ContextPart>doPrimitive:method:receiver:args:
-1370902404 ContextPart>tryPrimitiveFor:receiver:args:
-1370902788 ContextPart>send:to:with:super:
-1370902896 ContextPart>send:super:numArgs:
-1370902988 InstructionStream>interpretExtension:in:for:
-1370903080 InstructionStream>interpretNextInstructionFor:
-1370903172 ContextPart>step
-1370903280 Process>step
-1370903372 Process>step:
-1370920392 Debugger>send
-1370937720 PluggableButtonMorph>performAction
-1370937812 PluggableButtonMorph>mouseUp:
-1370937996 SequenceableCollection>do:
-1370957140 PluggableButtonMorph>mouseUp:
-1370957232 Morph>handleMouseUp:
-1370957324 MouseButtonEvent>sentTo:
-1370957416 Morph>handleEvent:
-1370957584 Morph>handleFocusEvent:
-1370957676 HandMorph>sendFocusEvent:to:clear:
-1370957768 PasteUpMorph>becomeActiveDuring:
-1370957860 BlockClosure>on:do:
-1370957992 PasteUpMorph>becomeActiveDuring:
-1370958084 HandMorph>sendFocusEvent:to:clear:
-1370958260 HandMorph>sendEvent:focus:clear:
-1370958352 HandMorph>sendMouseEvent:
-1370958444 HandMorph>handleEvent:
-1370966728 HandMorph>processEvents
-1370966836 WorldState>doOneCycleNowFor:
-1370966952 SequenceableCollection>do:
-1370967044 WorldState>handsDo:
-1370967136 WorldState>doOneCycleNowFor:
-1370969680 WorldState>doOneCycleFor:
-1370969772 PasteUpMorph>doOneCycle
-1383611064 >spawnNewProcess
-1383611192 BlockClosure>newProcess
Aborted
it would be nice if someone could tell something about debugging FFI
calls, or just any idea to try.
Cheers,
Hernán
2010/12/23 laurent laffont <laurent.laffont(a)gmail.com>:
> Hi,
> I have unmangled all function names. Image also crashes when evaluating the
> Kant test. (but this time I get ILLEGAL INSTRUCTION on strace). I've tried
> with Cog and the VM in the Seaside OneClick.
> I've uploaded the modified packages on squeaksource
> here: http://www.squeaksource.com/LaurentLSandbox.html  (you can use
> Z3950Slice to load all at once).
> Laurent
>
>
>
> On Thu, Dec 23, 2010 at 1:57 AM, Hernán Morales Durand
> <hernan.morales(a)gmail.com> wrote:
>>
>> Hi Laurent,
>>
>> Thanks for the feedback, I've uploaded the repository with the missing
>> method but I cannot reproduce the crash in Windows. Have you unmangled
>> every function name tested? Are you running just the
>> Z3950FFILibraryTest? Notice the Z3950FFIServerLibraryTest tests are
>> performed against a Z39.50 server running in local host, otherwise
>> will fail (however that shouldn't crash the VM), so you may want to
>> run only the Z3950FFILibraryTest suite. If you or anyone want a local
>> Zebra server for Win32 - although most configuration files should work
>> with other platforms - for testing purposes please let me know.
>>
>> Does the Kant test crash the VM too?
>>
>> Z3950Client new
>> Â server: #Acadia;
>> Â query: ( Z3950Query new author: 'Kant' ).
>>
>> (see http://67.222.12.200:8889/WebOpus/52 for sample successful results)
>>
>> I will set up a Linux box tomorrow and try to reproduce there.
>> Cheers,
>>
>> 2010/12/22 laurent laffont <laurent.laffont(a)gmail.com>:
>> > Hi Hernan,
>> > finally I switch back to Linux to make it work, OSX gives me headaches.
>> > So on linux the yaz module is found. I get the "Unable to find function
>> > address" but I found that writing:
>> > <cdecl: ZOOMOptions 'ZOOM_options_create' (void) module: 'yaz'>
>> > instead of
>> > <cdecl: ZOOMOptions '_ZOOM_options_create@0' (void) module: 'yaz3'>
>> > works. If I understand, function names are not mangled when compiling
>> > with
>> > gcc on Linux.
>> >
>> > Trying to run tests I've also had a "could not coerce arguments" in
>> > Z3950FFILibrary>>createConnectionTo:port because
>> > Z3950TestCase>>portNumber
>> > answers a String and
>> > <cdecl: ZOOMConnection 'ZOOM_connection_new' (char* short) module:
>> > 'yaz'>
>> > so it's waiting for a short. I've replaced portNumber to answer a
>> > SmallInteger.
>> > And now the image crashes on connectionIsIdle call:
>> > write(1, "\ncreateConnectionTo:port:", 25) = 25
>> > write(1, "\nconnectionIsIdle:", 18) Â Â = 18
>> > rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
>> > write(1, "\n", 1) Â Â Â Â Â Â Â Â Â Â Â = 1
>> > tgkill(25830, 25830, SIGABRT) Â Â Â Â Â = 0
>> > --- SIGABRT (Aborted) @ 0 (0) ---
>> >
>> > Any idea ?
>> >
>> > Laurent Laffont
>> >
>> > On Tue, Dec 21, 2010 at 7:58 AM, laurent laffont
>> > <laurent.laffont(a)gmail.com>
>> > wrote:
>> >>
>> >> The module is found ! How:
>> >> - Using VM Squeak 5.8b12 2 Â (instead of Cog or the VM provided in
>> >> Seaside
>> >> One-Click image)
>> >> - go in Squeak\ 5.8b12\ 2.app/Contents/Resources/, then ln -s
>> >> /usr/local/lib/libyaz.3.dylib .
>> >> Now I have the "Unable to find function address" you have talked
>> >> earlier
>> >> :) I will look at the mangled function names.
>> >>
>> >> Laurent  --- on the road to the FFI mountain.
>> >>
>> >> On Tue, Dec 21, 2010 at 6:59 AM, Hernán Morales Durand
>> >> <hernan.morales(a)gmail.com> wrote:
>> >>>
>> >>> Laurent,
>> >>> I forward this e-mail to the squeak mailing list, may be someone there
>> >>> have a better idea how the OSX VM works. BTW there are more
>> >>> commentaries here
>> >>>
>> >>>
>> >>> http://forum.world.st/squeak-dev-Alien-amp-Squeak-FFI-issues-on-Snow-Leopar…
>> >>> Cheers,
>> >>>
>> >>> Hernán
>> >>>
>> >>> 2010/12/20 laurent laffont <laurent.laffont(a)gmail.com>:
>> >>> > Hi Hernan,
>> >>> > the strace equivalent on OSX seems to be dtruss (yes I'm learning
>> >>> > OSX
>> >>> > too :)
>> >>> > sudo dtruss -p [pid of process]
>> >>> > in the trace I have this:
>> >>> >
>> >>> >
>> >>> > stat("/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3.bundle/Contents/MacOS/yaz3\0",
>> >>> > 0xBFF59440, 0xBFF5AB28) = -1 Err#2
>> >>> >
>> >>> >
>> >>> > stat64("/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3.bundle/Contents/MacOS/yaz3\0",
>> >>> > 0xBFF5892C, 0xBFF5AB28) = -1 Err#2
>> >>> >
>> >>> >
>> >>> > stat("/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3\0",
>> >>> > 0xBFF59440, 0xBFF5AB28) = 0 0
>> >>> >
>> >>> >
>> >>> > stat64("/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3\0",
>> >>> > 0xBFF5892C, 0xBFF5AB28) = 0 0
>> >>> >
>> >>> >
>> >>> > open("/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3\0",
>> >>> > 0x0, 0x0) = 12 0
>> >>> > pread(0xC, "\317\372\355\376\a\0", 0x1000, 0x0) = 4096 0
>> >>> > close(0xC) = 0 0
>> >>> >
>> >>> >
>> >>> > stat("/Users/laurentlaffont/Downloads/Plugins/yaz3.bundle/Contents/MacOS/yaz3\0",
>> >>> > 0xBFF59440, 0x1000) = -1 Err#2
>> >>> >
>> >>> >
>> >>> > stat64("/Users/laurentlaffont/Downloads/Plugins/yaz3.bundle/Contents/MacOS/yaz3\0",
>> >>> > 0xBFF5892C, 0x1000) = -1 Err#2
>> >>> > stat("/Users/laurentlaffont/Downloads/Plugins/yaz3\0", 0xBFF59440,
>> >>> > 0x1000) =
>> >>> > -1 Err#2
>> >>> > stat64("/Users/laurentlaffont/Downloads/Plugins/yaz3\0", 0xBFF5892C,
>> >>> > 0x1000)
>> >>> > = -1 Err#2
>> >>> >
>> >>> > so it looks like the VM is trying to find yaz3 at non standard Unix
>> >>> > places
>> >>> > (I don't know if it's SqueakVM or OSX related).
>> >>> > I've created Contents/Resources/yaz3.bundle/Contents/MacOS/, put yaz
>> >>> > lib
>> >>> > there, ln -s libyaz.3.dylib yaz3 but no success.
>> >>> >
>> >>> > I've read good
>> >>> > post http://forum.world.st/FFI-Documentation-td2225150.html :
>> >>> >
>> >>> > Module Location - where the external library file lives
>> >>> > Â Â Â - depends on the platform
>> >>> > Â Â Â Â Â Â Â - Mac
>> >>> > Â Â Â Â Â Â Â Â Â Â Â - pre Snow Leopard
>> >>> > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â - checks VM path and common library
>> >>> > paths
>> >>> > Â Â Â Â Â Â Â Â Â Â Â - Snow Leopard
>> >>> > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â - only looks in VM bundle's Resources
>> >>> > file, you must either [5]:
>> >>> > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â - store all external libraries
>> >>> > there
>> >>> > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â - ln -s path/to/library
>> >>> > path/to/VM/Resources/library_name
>> >>> > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â - Change the VM's Info.plist
>> >>> > "SqueakPluginsBuiltInOrLocalOnly" key from
>> >>> > "true" to "false."
>> >>> >
>> >>> > For this SqueakPluginsBuiltInOrLocalOnly I suppose I need to compile
>> >>> > a
>> >>> > VM ?
>> >>> > Cheers,
>> >>> > Laurent Laffont
>> >>> >
>> >>> >
>> >>> > On Mon, Dec 20, 2010 at 4:12 PM, Hernán Morales Durand
>> >>> > <hernan.morales(a)gmail.com> wrote:
>> >>> >>
>> >>> >> Hi Laurent
>> >>> >>
>> >>> >> I've read there is a couple of system calll monitors in MacOS,
>> >>> >> ktrace
>> >>> >> and dtrace (http://en.wikipedia.org/wiki/Ktrace ,
>> >>> >> http://en.wikipedia.org/wiki/DTrace) so you may attach to the VM
>> >>> >> and
>> >>> >> see what's missing?
>> >>> >> Cheers,
>> >>> >>
>> >>> >> Hernán
>> >>> >>
>> >>> >> 2010/12/20 laurent laffont <laurent.laffont(a)gmail.com>:
>> >>> >> > Thanks Hernan.
>> >>> >> > It still doesn't work. I've also tried to play with LD_LOAD_PATH
>> >>> >> > /
>> >>> >> > LD_LIBRARY_PATH no success.... I want to make it work so I need
>> >>> >> > to
>> >>> >> > learn
>> >>> >> > :)
>> >>> >> >
>> >>> >> > For the mangled function names, on Linux and OSX there's nm.
>> >>> >> > Here's what I get:
>> >>> >> > $ nm -g libyaz.3.dylib | grep ZOOM_connection_create
>> >>> >> > 0000000000046a30 T _ZOOM_connection_create
>> >>> >> > Cheers,
>> >>> >> > Laurent
>> >>> >> >
>> >>> >> > On Sun, Dec 19, 2010 at 6:23 PM, Hernán Morales Durand
>> >>> >> > <hernan.morales(a)gmail.com> wrote:
>> >>> >> >>
>> >>> >> >> Hi Laurent,
>> >>> >> >>
>> >>> >> >> Thanks for reporting. The correct #moduleName for MacOS was
>> >>> >> >> missing,
>> >>> >> >> I've uploaded a new version answering 'libyaz.3.dylib' which I
>> >>> >> >> guess
>> >>> >> >> is the corresponding for 'yaz3.dll' (according to
>> >>> >> >> http://en.wikipedia.org/wiki/Dynamic_library#Naming ).
>> >>> >> >>
>> >>> >> >> I haven't access to a MacOS, but in Windows I've had to find the
>> >>> >> >> mangled function names (i.e. _ZOOM_connection_create@4) so FFI
>> >>> >> >> can
>> >>> >> >> find the function addresses and you don't get the classic
>> >>> >> >> "Error:
>> >>> >> >> Unable to find function address". I don't know if it's related
>> >>> >> >> since
>> >>> >> >> talks about C++, but you may want to check
>> >>> >> >> http://wiki.squeak.org/squeak/3735
>> >>> >> >>
>> >>> >> >> The tool I've used to find the mangled function names in Windows
>> >>> >> >> is
>> >>> >> >> the Steve Miller's Dependency Walker
>> >>> >> >> http://www.dependencywalker.com/
>> >>> >> >>
>> >>> >> >> 2010/12/19 laurent laffont <laurent.laffont(a)gmail.com>:
>> >>> >> >> > Hi,
>> >>> >> >> >
>> >>> >> >> > I want to use http://www.squeaksource.com/Z3950
>> >>> >> >> > Following install instructions, I've dowloaded yaz sources
>> >>> >> >> > (I've
>> >>> >> >> > tried
>> >>> >> >> > 4.1.2
>> >>> >> >> > and 3.0.52) as it seems there's no binary for OSX, ./configure
>> >>> >> >> > &&Â make
>> >>> >> >> > &&
>> >>> >> >> > make install.
>> >>> >> >> > Then using latest Seaside One Click image I've copied
>> >>> >> >> > /usr/local/lib/*yaz*
>> >>> >> >> > Â in Seaside.app/Contents/MacOS
>> >>> >> >> > $ ls ~/Downloads/Seaside.app/Contents/MacOS/
>> >>> >> >> > Squeak VM Opt     libyaz.a        libyaz.la
>> >>> >> >> > libyaz_icu.a      libyaz_icu.la     libyaz_server.a
>> >>> >> >> > libyaz_server.la libyaz.3.dylib     libyaz.dylib
>> >>> >> >> >  libyaz_icu.3.dylib   libyaz_icu.dylib
>> >>> >> >> > Â libyaz_server.3.dylib
>> >>> >> >> > libyaz_server.dylib
>> >>> >> >> >
>> >>> >> >> >
>> >>> >> >> > But then I have a External Module Not Found on
>> >>> >> >> > YAZPQFFFILibrary>>createParser
>> >>> >> >> > " YAZPQDFFILibrary default createParser "
>> >>> >> >> > <cdecl: YAZPQFParser 'yaz_pqf_create' (void) module: 'yaz3'>
>> >>> >> >> > ^ self externalCallFailed
>> >>> >> >> >
>> >>> >> >> > Any hint ?
>> >>> >> >> > Cheers,
>> >>> >> >> > Laurent Laffont -- FFI newbie
>> >>> >> >> >
>> >>> >> >> > Pharo Smalltalk Screencasts: http://www.pharocasts.com/
>> >>> >> >> > Blog: http://magaloma.blogspot.com/
>> >>> >> >> >
>> >>> >> >>
>> >>> >> >> --
>> >>> >> >> Hernán Morales
>> >>> >> >> Information Technology Manager,
>> >>> >> >> Institute of Veterinary Genetics.
>> >>> >> >> National Scientific and Technical Research Council (CONICET).
>> >>> >> >> La Plata (1900), Buenos Aires, Argentina.
>> >>> >> >> Telephone: +54 (0221) 421-1799.
>> >>> >> >> Internal: 422
>> >>> >> >> Fax: 425-7980 or 421-1799.
>> >>> >> >
Dec. 24, 2010
[Pharo-project] Redline: 'Small talks' - Message in a bottle
by James Ladd
The next in the series is out: Redline: Smalltalk in 'small talks' - Message in a bottle - Part 1
http://bit.ly/dNlK7d
We are parsing Smalltalk source now. Going to be executing it in next post.
Rgs, James.
Dec. 24, 2010