Subject: [GRAIL] Re: Grail Mailing List From: Conrad Huang To: grail@python.org Date: Tue, 6 May 97 11:16:38 -0700 X-Nextstep-Mailer: Mail 3.3risc (Enhance 2.0b5) Precedence: bulk > We've received several reports of Grail hanging on DEC > Alpha hardware running some version of Linux. We don't > have a fix for this yet -- in fact we're looking for > someone who can shed light on the problem. (If your copy > of Grail works correctly on this platform, please let us > know, too!) The bug is in the tcl file handle implementation (I think). In file generic/tclFHandle.c, the FileHashKey structure is: typedef struct FileHashKey { int type; /* File handle type. */ ClientData osHandle; /* Platform specific OS file handle. */ } FileHashKey; This structure is used as a key to the generic tcl hash table routines, which needs to know the size of its keys. This size is computed in Tcl_GetFile, which calls: Tcl_InitHashTable(&fileTable, sizeof(FileHashKey)/sizeof(int)); On 32-bit systems, the size is 2. On the Alpha, the size is 4 due to the 64-bit ClientData and padding. Tcl_GetFile initializes both fields of the structure but does not touch the padding memory, resulting in identical keys not matching occasionally. Explicitly zeroing the key structure seems to fix the Grail hanging problem. Context diffs are attached below. Conrad =================================================================== RCS file: RCS/tclFHandle.c,v retrieving revision 1.1 diff -c -r1.1 tclFHandle.c *** 1.1 1997/05/06 17:43:01 --- tclFHandle.c 1997/05/06 17:44:17 *************** *** 76,81 **** --- 76,82 ---- Tcl_CreateExitHandler(FileExitProc, 0); initialized = 1; } + memset((char *) &key, 0, sizeof key); key.osHandle = osHandle; key.type = type; entryPtr = Tcl_CreateHashEntry(&fileTable, (char *) &key, &new); _______________ GRAIL - The Python Internet Browser send messages to: grail@python.org administrivia to: grail-request@python.org _______________