From: Vlad S. <vl...@cr...> - 2006-04-06 23:24:13
|
This is what i discovered yesterday, i ported my application from ns_cache module to internal Tcl cache API and got SEGV crashes. Under high concurrency when inside ns_cache_eval i call another ns_cache_set C cache API crashes, using ns_cache it was working the last couple of years. It always crashes in this place. Loaded symbols for /lib/libresolv.so.2 #0 Push (ePtr=0xa92ab878) at cache.c:904 904 ePtr->cachePtr->firstEntryPtr->prevPtr = ePtr; (gdb) bt #0 Push (ePtr=0xa92ab878) at cache.c:904 #1 0xb7f59cb5 in Ns_CacheWaitCreateEntry (cache=0x839e858, key=0x867fb98 "6", newPtr=0xabc3575c, timeout=360) at cache.c:295 #2 0xb7f79a5b in CreateEntry (itPtr=0x888bcf8, cache=0x839e858, key=0x867fb98 "6", newPtr=0x8a990000, timeout=360) at tclcache.c:686 #3 0xb7f7a01c in NsTclCacheSetObjCmd (arg=0x888bcf8, interp=0x88b5120, objc=-1969684480, objv=0x8a990000) at tclcache.c:367 #4 0xb7ea9143 in TclEvalObjvInternal (interp=0x88b5120, objc=4, objv=0x88c775c, command=0x0, length=0, flags=0) at /home/vlad/src/lmbox/linux/src/tcl/src/tcl8.4.12/unix/../generic/tclBasic.c:3085 #5 0xb7ed2fa0 in TclExecuteByteCode (interp=0x88b5120, codePtr=0x891cb80) at /home/vlad/src/lmbox/linux/src/tcl/src/tcl8.4.12/unix/../generic/tclExecute.c:1419 #6 0xb7ed8ee8 in TclCompEvalObj (interp=0x88b5120, objPtr=0x888ec38) at /home/vlad/src/lmbox/linux/src/tcl/src/tcl8.4.12/unix/../generic/tclExecute.c:981 #7 0xb7eab94b in Tcl_EvalObjEx (interp=0x88b5120, objPtr=0x888ec38, flags=0) at /home/vlad/src/lmbox/linux/src/tcl/src/tcl8.4.12/unix/../generic/tclBasic.c:4049 #8 0xb7f7a521 in NsTclCacheEvalObjCmd (arg=0x888bcf8, interp=0x88b5120, objc=6, objv=0x88c7744) at tclcache.c:167 #9 0xb7ea9143 in TclEvalObjvInternal (interp=0x88b5120, objc=6, objv=0x88c7744, command=0x0, length=0, flags=0) at /home/vlad/src/lmbox/linux/src/tcl/src/tcl8.4.12/unix/../generic/tclBasic.c:3085 #10 0xb7ed2fa0 in TclExecuteByteCode (interp=0x88b5120, codePtr=0x89174e0) at /home/vlad/src/lmbox/linux/src/tcl/src/tcl8.4.12/unix/../generic/tclExecute.c:1419 #11 0xb7ed8ee8 in TclCompEvalObj (interp=0x88b5120, objPtr=0x888f2f8) at /home/vlad/src/lmbox/linux/src/tcl/src/tcl8.4.12/unix/../generic/tclExecute.c:981 #12 0xb7eab94b in Tcl_EvalObjEx (interp=0x88b5120, objPtr=0x888f2f8, flags=0) at /home/vlad/src/lmbox/linux/src/tcl/src/tcl8.4.12/unix/../generic/tclBasic.c:4049 #13 0xb7eb0dba in Tcl_ForObjCmd (dummy=0x0, interp=0x88b5120, objc=5, objv=0xabc362ac) at /home/vlad/src/lmbox/linux/src/tcl/src/tcl8.4.12/unix/../generic/tclCmdAH.c:1638 #14 0xb7ea9143 in TclEvalObjvInternal (interp=0x88b5120, objc=5, objv=0xabc362ac, command=0x840144f "for {set j 0} {$j < 1000} {incr j} {\n", ' ' <repeats 16 times>, "for {set x 0} {$x < 10000} {incr x} {set a b}\n", ' ' <repeats 16 times>, "ns_cache_eval -ttl 1 c1 k1 {\n", ' ' <repeats 18 times>, "ns_cache_set c1 $j $j\n", ' ' <repeats 16 times>..., length=276, flags=0) at /home/vlad/src/lmbox/linux/src/tcl/src/tcl8.4.12/unix/../generic/tclBasic.c:3085 #15 0xb7eaace4 in Tcl_EvalEx (interp=0x88b5120, script=0x8401440 " \n", ' ' <repeats 12 times>, "for {set j 0} {$j < 1000} {incr j} {\n", ' ' <repeats 16 times>, "for {set x 0} {$x < 10000} {incr x} {set a b}\n", ' ' <repeats 16 times>, "ns_cache_eval -ttl 1 c1 k1 {\n", ' ' <repeats 18 times>, "ns_cache_set c1 $j $j\n "..., numBytes=299, flags=0) at /home/vlad/src/lmbox/linux/src/tcl/src/tcl8.4.12/unix/../generic/tclBasic.c:3687 #16 0xb7f7f58e in Ns_TclEval (dsPtr=0x0, server=0x8a990000 <Address 0x8a990000 out of bounds>, script=0x8a990000 <Address 0x8a990000 out of bounds>) at tclinit.c:227 #17 0xb7f8c48f in NsTclThread (arg=0x8401438) at tclthread.c:660 #18 0xb7f3c524 in NsThreadMain (arg=0x82ac7e8) at thread.c:224 #19 0xb7f3d2dd in ThreadMain (arg=0x8a990000) at pthread.c:736 #20 0xb7cd5240 in start_thread () from /lib/tls/libpthread.so.0 Vlad Seryakov wrote: > Update of /cvsroot/naviserver/naviserver/tests > In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27307 > > Modified Files: > ns_cache.test > Log Message: > Hard cache test which works in case of ns_cache modules but core dumps using ns_cache_eval > > > Index: ns_cache.test > =================================================================== > RCS file: /cvsroot/naviserver/naviserver/tests/ns_cache.test,v > retrieving revision 1.4 > retrieving revision 1.5 > diff -C2 -d -r1.4 -r1.5 > *** ns_cache.test 5 Apr 2006 18:24:57 -0000 1.4 > --- ns_cache.test 6 Apr 2006 23:20:44 -0000 1.5 > *************** > *** 300,304 **** > for {set j 0} {$j < 1000} {incr j} { > for {set x 0} {$x < 10000} {incr x} {set a b} > ! ns_cache_eval c1 k1 {return a} > ns_thread yield > } > --- 300,307 ---- > for {set j 0} {$j < 1000} {incr j} { > for {set x 0} {$x < 10000} {incr x} {set a b} > ! ns_cache_eval -ttl 1 c1 k1 { > ! ns_cache_set c1 $j $j > ! return a > ! } > ns_thread yield > } > *************** > *** 308,311 **** > --- 311,315 ---- > for {set j 0} {$j < 1000} {incr j} { > for {set x 0} {$x < 10000} {incr x} {set a b} > + ns_cache_get c1 $j > ns_cache_flush c1 > ns_thread yield > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > naviserver-commits mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-commits > -- Vlad Seryakov 571 262-8608 office vl...@cr... http://www.crystalballinc.com/vlad/ |