On Wed, Nov 19, 2008 at 3:45 PM, Bernd Eidenschink <[EMAIL PROTECTED]> wrote:
>> > But the results on my local box are... a little bit scary right now.
>>
>> ... scary is relative. So, how scary is your "scary", really?
>
> Scary for me, the ignorant :-)
>
>
> ==3781== ERROR SUMMARY: 18 errors from 9 contexts (suppressed: 106 from 1)


This is the important bit. There should be no errors. Scroll back up
the log output and you should see details of the errors. Unlike the
summary, valgrind outputs these as they happen.

I haven't tested against 8.5 in a long time, so I just tried it.

I always compile Tcl for testing with --enable-symbols=mem, which you
would think would interact badly with valgrind, but I've found it's
like a pig sniffing out truffles when it comes to buffer over runs and
depending on uninitialized memory. These are the kinds of errors
valgrind is talking about, in contrast to plain memory leaks which you
might expect to find.

Anyway, won't even run with 8.5.5 here:

[19/Nov/2008:16:48:33][26547.b7ff46c0][-main-] Fatal: expected to
create new entry for object map

Program received signal SIGABRT, Aborted.
0x00110416 in __kernel_vsyscall ()
Missing separate debuginfos, use: debuginfo-install gcc.i386 glibc.i686
(gdb) bt
#0  0x00110416 in __kernel_vsyscall ()
#1  0x00b42660 in raise () from /lib/libc.so.6
#2  0x00b44028 in abort () from /lib/libc.so.6
#3  0x00144f18 in Panic (fmt=0x2b0760 "expected to create new entry
for object map") at log.c:617
#4  0x0025fec7 in Tcl_PanicVA (format=0x2b0760 "expected to create new
entry for object map",
    argList=0xbfc06694 "") at
/home/sd/src/tcl8.5.5/unix/../generic/tclPanic.c:93
#5  0x0025ffca in Tcl_Panic (format=0x2b0760 "expected to create new
entry for object map")
    at /home/sd/src/tcl8.5.5/unix/../generic/tclPanic.c:132
#6  0x0025c7b6 in TclDbInitNewObj (objPtr=0x96b7220) at
/home/sd/src/tcl8.5.5/unix/../generic/tclObj.c:637
#7  0x0024b919 in Tcl_DbNewListObj (objc=1, objv=0xbfc06700,
    file=0x2ac234
"/home/sd/src/tcl8.5.5/unix/../generic/tclFileName.c", line=787)
    at /home/sd/src/tcl8.5.5/unix/../generic/tclListObj.c:239
#8  0x00227d72 in Tcl_FSJoinToPath (pathPtr=0x96e4b50, objc=0, objv=0x0)
    at /home/sd/src/tcl8.5.5/unix/../generic/tclFileName.c:787
#9  0x0026639d in SetFsPathFromAny (interp=0x0, pathPtr=0x96e4b50)
    at /home/sd/src/tcl8.5.5/unix/../generic/tclPathObj.c:2441
#10 0x00265e4b in TclFSSetPathDetails (pathPtr=0x96e4b50,
fsRecPtr=0x96b4640, clientData=0x0)
    at /home/sd/src/tcl8.5.5/unix/../generic/tclPathObj.c:2203
#11 0x0024a1c3 in Tcl_FSGetFileSystemForPath (pathPtr=0x96e4b50)
    at /home/sd/src/tcl8.5.5/unix/../generic/tclIOUtil.c:4437
#12 0x00248a63 in Tcl_FSGetCwd (interp=0x0) at
/home/sd/src/tcl8.5.5/unix/../generic/tclIOUtil.c:2736
#13 0x00148603 in SetCwd (path=0x96f53c8
"/home/sd/ns-scratch-hg/tests") at nsmain.c:1063
#14 0x00147c24 in Ns_Main (argc=8, argv=0xbfc06b74, initProc=0x8048636
<ServerInit>) at nsmain.c:504
#15 0x0804862c in main (argc=Cannot access memory at address 0x67b3
) at main.c:64


Seems innocuous enough:

nsd/nsmain.c:

char *
SetCwd(char *path)
{
    Tcl_Obj *pathObj;

    pathObj = Tcl_NewStringObj(path, -1);
    Tcl_IncrRefCount(pathObj);
    if (Tcl_FSChdir(pathObj) == -1) {
        Ns_Fatal("nsmain: chdir(%s) failed: '%s'", path,
strerror(Tcl_GetErrno()));
    }
    Tcl_DecrRefCount(pathObj);
    pathObj = Tcl_FSGetCwd(NULL);
    if (pathObj == NULL) {
        Ns_Fatal("nsmain: can't resolve home directory path");
    }

    return (char *)Tcl_FSGetTranslatedStringPath(NULL, pathObj);
}


Is this a bug though?  Can Tcl really expect to have never seen this
pointer before:

tcl8.5.5/generic/tclObj.c:

void
TclDbInitNewObj(
    register Tcl_Obj *objPtr)
{
    objPtr->refCount = 0;
    objPtr->bytes = tclEmptyStringRep;
    objPtr->length = 0;
    objPtr->typePtr = NULL;

#ifdef TCL_THREADS
    /*
     * Add entry to a thread local map used to check if a Tcl_Obj was
     * allocated by the currently executing thread.
     */

    if (!TclInExit()) {
        Tcl_HashEntry *hPtr;
        Tcl_HashTable *tablePtr;
        int isNew;
        ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);

        if (tsdPtr->objThreadMap == NULL) {
            tsdPtr->objThreadMap = (Tcl_HashTable *)
                    ckalloc(sizeof(Tcl_HashTable));
            Tcl_InitHashTable(tsdPtr->objThreadMap, TCL_ONE_WORD_KEYS);
        }
        tablePtr = tsdPtr->objThreadMap;
        hPtr = Tcl_CreateHashEntry(tablePtr, (char *) objPtr, &isNew);
        if (!isNew) {
            Tcl_Panic("expected to create new entry for object map");
        }
        Tcl_SetHashValue(hPtr, NULL);
    }
#endif /* TCL_THREADS */
}

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to