Re: [Pharo-dev] need some help with NBCallback related crashes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] need some help with NBCallback related crashes

Eliot Miranda-2
 
cc'ing vm-dev cuz /this is a vm-dev issue/.


On Wed, Feb 12, 2014 at 4:40 AM, Danil Osipchuk <[hidden email]> wrote:
Hello all

I'm currently playing with NativeBoost  (a great thing to have) and pharo consistently crashes after running for a while. My impression is that crashes happen during GCs as if something moves under the installed callback. This may be also related to the libpcap itself, but how can I know for sure. I've tried everything newest (vm+image+libpcap) and I also migrated into a much more rigid scheme of storing and passing callback. Now I've run of ideas where to look further.

So, it is like this. NBPCapHandlerCallback  is a procedure which is called by libpcap for every packet it has in its internal buffer after the application calls pcap_dispatch(). pcap_dispatch receives the callback as a parameter.  I have to repeatedly call pcap_dispatch in so called nonblocking mode (and pass the callback each time) every 5 milliseconds to collect packets - we are single threaded. This amounts to awful whole 200 callback installations per second, may be libpcap was not well tested in this scenario (I suppose pcap_loop runs in separated thread in wireshark and callback installation happens several times per session at most) - hence my doubts. But also - could it be something with NB?

Any hints how to proceed with it are greatly appreciated. This is amazing how one can quickly assemble something that emulates thousands of dhcp-clients (this is what the app does) with current Pharo.  But the thing dies off after 10-15 minutes.

There is a leak checker in the VM that you can use.  Use -leakcheck 3 to run the leak checker before each full GC (1) and incremental GC (2, 1 + 2 = 3).  Use -leakcheck 7 to run it before each become as well.  This should at least print an error before the crash.  If you then use gdb to stop in the warning function you can use facilities such as printOop to find out which object is crapping out.

HTH

and please bring issues like this up on vm-dev.




best wishes,
  Danil


=========
Generic failure
NBNativeCodeGen class>>signalError:
NBNativeCodeGen class>>handleFailureIn:nativeCode:
NBNativeCodeGen class>>methodAssembly:
LargePositiveInteger(NBFFICallback)>>primLeave:stackPtr:contextOop:returnValue:primitiveMethod:
NBPCapHandlerCallback(NBFFICallback)>>pvtEnter:stackPointer:primitiveMethod: in Block:
Segmentation fault Wed Feb 12 16:17:25 2014


pharo VM version: 3.9-7 #1 Fri Feb  7 16:55:52 CET 2014 gcc 4.6.3 [Production ITHB VM]
Built from: NBCoInterpreter NativeBoost-CogPlugin-GuillermoPolito.19 uuid: acc98e51-2fba-4841-a965-2975997bba66 Feb  7 2014
With: NBCogit NativeBoost-CogPlugin-GuillermoPolito.19 uuid: acc98e51-2fba-4841-a965-2975997bba66 Feb  7 2014
Revision: https://github.com/pharo-project/pharo-vm.git Commit: ef5832e6f70e5b24e8b9b1f4b8509a62b6c88040 Date: 2014-01-26 15:34:28 +0100 By: Esteban Lorenzano <[hidden email]> Jenkins build #14797
Build host: Linux pharo-linux 3.2.0-31-generic-pae #50-Ubuntu SMP Fri Sep 7 16:39:45 UTC 2012 i686 i686 i386 GNU/Linux
plugin path: /home/Pharo/ [default: /home/Pharo/]


C stack backtrace:
./pharo[0x809bc4c]
./pharo[0x809bf66]
linux-gate.so.1(__kernel_rt_sigreturn+0x0)[0xb76e640c]
./pharo(incrementalGC+0x18a)[0x80859da]
./pharo[0x808655a]
./pharo[0x808cbb7]
./pharo[0x808ccba]
./pharo(ceStackOverflow+0x59)[0x808f5f9]
[0x770f5260]
[0x771017e0]
[0x770fb11e]
[0x770fa939]
[0x770f9813]
[0x770f5700]
[0x770f55c0]


Smalltalk stack dump:
0xbf8b6144 M BlockClosure>ensure: 0x7c429d44: a(n) BlockClosure
0xbf8b6164 M Semaphore>critical: 0x772901d8: a(n) Semaphore
0xbf8b6180 M SmallInteger(Integer)>atRandom       0x13=9
0xbf8b61a8 M NLDHCPClientInit>enter 0x7c3be76c: a(n) NLDHCPClientInit
0xbf8b61c0 M [] in NLDHCPHost>changeStateTo: 0x793e816c: a(n) NLDHCPHost
0xbf8b61e0 I [] in BlockClosure>newProcess 0x7c3be828: a(n) BlockClosure

Most recent primitives
at:put:
at:put:
at:put:
at:put:
basicNew:
basicNew
class
class
replaceFrom:to:with:startingAt:
basicNew:
basicNew
class
class
replaceFrom:to:with:startingAt:
species
species
at:put:
at:put:
class
class
replaceFrom:to:with:startingAt:
species
species
at:put:
at:put:
class
class
replaceFrom:to:with:startingAt:
at:put:
species
basicNew:
replaceFrom:to:with:startingAt:
class
class
species
basicNew:
replaceFrom:to:with:startingAt:
replaceFrom:to:with:startingAt:
basicNew:
atAllPut:
class
class
replaceFrom:to:with:startingAt:
species
basicNew:
replaceFrom:to:with:startingAt:
at:put:
at:put:
class
at:put:
at:put:
at:put:
species
basicNew:
replaceFrom:to:with:startingAt:
species
basicNew:
replaceFrom:to:with:startingAt:
basicNew:
basicNew
class
class
replaceFrom:to:with:startingAt:
class
class
species
basicNew:
replaceFrom:to:with:startingAt:
replaceFrom:to:with:startingAt:
species
basicNew:
replaceFrom:to:with:startingAt:
basicNew:
basicNew
class
class
replaceFrom:to:with:startingAt:
class
class
replaceFrom:to:with:startingAt:
class
class
replaceFrom:to:with:startingAt:
basicNew:
at:put:
at:put:
class
class
replaceFrom:to:with:startingAt:
class
class
replaceFrom:to:with:startingAt:
class
class
replaceFrom:to:with:startingAt:
species
basicNew:
replaceFrom:to:with:startingAt:
new
at:put:
at:put:
class
stringHash:initialHash:
class
stringHash:initialHash:
class
stringHash:initialHash:
basicNew
objectAt:
basicNew:
stackp:
basicNew
primitiveResume
basicNew
basicNew
new:
basicNew
new:
objectAt:
basicNew:
stackp:
basicNew
primitiveResume
findNextUnwindContextUpTo:
terminateTo:
suspend
species
basicNew:
replaceFrom:to:with:startingAt:
species
species
class
class
basicNew
shallowCopy
shallowCopy
basicNew:
basicNew
species
basicNew:
replaceFrom:to:with:startingAt:
class
class
replaceFrom:to:with:startingAt:
species
basicNew:
replaceFrom:to:with:startingAt:
species
basicNew:
replaceFrom:to:with:startingAt:
replaceFrom:to:with:startingAt:
basicNew:
basicNew
species
basicNew:
replaceFrom:to:with:startingAt:
class
class
replaceFrom:to:with:startingAt:
species
basicNew:
replaceFrom:to:with:startingAt:
species
basicNew:
replaceFrom:to:with:startingAt:
replaceFrom:to:with:startingAt:
replaceFrom:to:with:startingAt:
wait
truncated
truncated
signal
at:put:
at:put:
at:put:
at:put:
at:put:
at:put:
new
at:put:
at:put:
class
at:put:
at:put:
class
stringHash:initialHash:
class
stringHash:initialHash:
class
stringHash:initialHash:
class
stringHash:initialHash:
class
stringHash:initialHash:
class
stringHash:initialHash:
species
basicNew:
replaceFrom:to:with:startingAt:
species
basicNew:
replaceFrom:to:with:startingAt:
species
basicNew:
replaceFrom:to:with:startingAt:
species
basicNew:
replaceFrom:to:with:startingAt:
class
species
hashBytes:startingWith:
species
species
class
class
class
stringHash:initialHash:
class
stringHash:initialHash:
class
stringHash:initialHash:
basicNew:
basicNew
class
class
replaceFrom:to:with:startingAt:
basicNew:
basicNew
class
class
replaceFrom:to:with:startingAt:
class
class
species
basicNew:
replaceFrom:to:with:startingAt:
replaceFrom:to:with:startingAt:
species
basicNew:
replaceFrom:to:with:startingAt:
class
class
species
basicNew:
replaceFrom:to:with:startingAt:
replaceFrom:to:with:startingAt:
species
basicNew:
replaceFrom:to:with:startingAt:
pcapSendPacket:size:
findNextUnwindContextUpTo:
terminateTo:
suspend
basicNew
basicNew
wait
**IncrementalGC**

stack page bytes 4096 available headroom 3300 minimum unused headroom 3480

        (Segmentation fault)




--
best,
Eliot