From: SourceForge.net <no...@so...> - 2003-12-01 14:35:19
|
Bugs item #851747, was opened at 2003-11-30 22:07 Message generated for change (Comment added) made by dkf You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=851747&group_id=10894 Category: 12. ByteArray Object Group: current: 8.4.5 Status: Open Resolution: None Priority: 9 Submitted By: Paul Obermeier (obermeier) Assigned to: Donal K. Fellows (dkf) Summary: Coredump with Tcl 8.4.X (possibly binary scan) Initial Comment: While working with the fileType function of TclLib, I encountered core dumps on both Linux and Windows with different versions of Tcl 8.4 (8.4.2, 8.4.4, 8.4.5). The same code works with Tcl 8.3 on both platforms. I succeeded to strip down the problem to the attached code. This code applied to the four (identical) image files supplied in the attachment, dumps core. You can avoid dumping core by 1. replacing the binary scan command as noted in the code or 2. by commenting out the line "set s [file size $filename]" I noticed, that if I copy the files from the FAT32 partition to a NTFS partition, it does not dump core, but still prints out different offset values, although the files are identical. Core dumps also occur on Mac OS X with Tcl 8.4, but not with Tcl 8.3. ---------------------------------------------------------------------- >Comment By: Donal K. Fellows (dkf) Date: 2003-12-01 14:35 Message: Logged In: YES user_id=79902 Minimal script (in mem-debug mode): set s aaaabbbbaaaa binary scan $s III a a a ---------------------------------------------------------------------- Comment By: Donal K. Fellows (dkf) Date: 2003-12-01 14:28 Message: Logged In: YES user_id=79902 The following script reproduces the fault for me: set s \xdf\xdf\xdb\xdf\xdf\xdb\xdf\xdf\xdb\xdf\xdf\xdb\xdf\xdf\xdb\xdf binary scan $s IIII a b a a binary scan $s IIII a b a a binary scan $s IIII a b a a In mem-debug mode (8.5a0 on UNIX), the fault happens in the first [binary scan]! ---------------------------------------------------------------------- Comment By: Donal K. Fellows (dkf) Date: 2003-12-01 13:15 Message: Logged In: YES user_id=79902 I can reproduce this with 8.4.1 on WinXP/NTFS ---------------------------------------------------------------------- Comment By: Benjamin Riefenstahl (cc_benny) Date: 2003-12-01 13:13 Message: Logged In: YES user_id=143885 The code crashes with tclsh8.4 on my Linux/PPC box and also on my Mac OS X box. No problems with tclsh8.3 on either platform. The Mac OS X version says "abort: invalid block". IOW, some routine trashes the heap. There seems to be a a buffer overwrite in that [binary scan] variant. ---------------------------------------------------------------------- Comment By: Vince Darley (vincentdarley) Date: 2003-12-01 11:57 Message: Logged In: YES user_id=32170 I can't reproduce this (I'm on Windows and only have NTFS), although I do notice some strange behaviour regarding finding the .ppm files at all... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=851747&group_id=10894 |