From: Remigiusz J. A. M. <lr...@go...> - 2008-08-05 23:20:29
|
Hi, Not the first, probably not the last - problem with Tcl_EvalObjv. Now I've got this here: http://dev.lrem.net/tcldtrace/browser/trunk/generic/dtrace.c#L680 When executing this test: http://dev.lrem.net/tcldtrace/browser/trunk/tests/dtrace.test#L484 I get a segfault. This is during the second call of callback. Everything looks quite the same as in the first call. Some gdb dump: #v+ (gdb) p *objv[0] $11 = {refCount = 1, bytes = 0x81aa938 "callback", length = 8, typePtr = 0xfef9e5b8, internalRep = {longValue = 139022144, doubleValue = 6.8686065361594778e-316, otherValuePtr = 0x8494f40, wideValue = 139022144, twoPtrValue = {ptr1 = 0x8494f40, ptr2 = 0x0}}} (gdb) p *objv[1] $12 = {refCount = 3, bytes = 0x0, length = 0, typePtr = 0xfef9e498, internalRep = {longValue = 135929976, doubleValue = 6.7158331381625143e-316, otherValuePtr = 0x81a2078, wideValue = 135929976, twoPtrValue = {ptr1 = 0x81a2078, ptr2 = 0x0}}} (gdb) p *objv[2] $13 = {refCount = 1, bytes = 0xfef9e674 "", length = 0, typePtr = 0x0, internalRep = {longValue = 138565592, doubleValue = 6.8460498702854665e-316, otherValuePtr = 0x84257d8, wideValue = 138565592, twoPtrValue = {ptr1 = 0x84257d8, ptr2 = 0x0}}} (gdb) c Continuing. Program received signal SIGSEGV, Segmentation fault. 0xfef4ff59 in Tcl_NewStringObj () from /opt/tcldebug//lib/libtcl8.5.so (gdb) bt #0 0xfef4ff59 in Tcl_NewStringObj () from /opt/tcldebug//lib/libtcl8.5.so #1 0xfef52f82 in AppendPrintfToObjVA () from /opt/tcldebug//lib/libtcl8.5.so #2 0xfef531ca in Tcl_ObjPrintf () from /opt/tcldebug//lib/libtcl8.5.so #3 0xfef3adb0 in Tcl_LogCommandInfo () from /opt/tcldebug//lib/libtcl8.5.so #4 0xfeec1983 in Tcl_EvalObjv () from /opt/tcldebug//lib/libtcl8.5.so #5 0xfeb92e36 in listProbe (handle=0x84554a8, pdesc=0x8045d3c, varg=0x8045f5c) at dtrace.c:706 [and a lot more] #v+ Now, why would the refCount equal to 3? It's created just two lines before. It's the only visible difference between this and the previous instance of the function. I have no idea what to try now... Any help? The test should fire the callback two times for probes syscall::exec:entry and syscall::exec:return. BTW - how should I signalize an error within the callback? Like the failed Tcl_EvalObjv (if it would ever fail without bringing the whole thing down)? Kind regards, Remigiusz Modrzejewski |