From: SourceForge.net <no...@so...> - 2005-12-06 21:44:27
|
Bugs item #1374582, was opened at 2005-12-06 13:11 Message generated for change (Comment added) made by msofer You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1374582&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 14. List Object Group: current: 8.5a3 Status: Open >Resolution: None Priority: 5 Submitted By: Ulrich Ring (uring) Assigned to: miguel sofer (msofer) Summary: invalid object modification Initial Comment: (1) run the following script: proc touch {listValue} { lset listValue 1 4 5 return $listValue } set data [list a [list 1 2 3] b] puts $data touch $data puts $data (2) you get the expected output: a {1 2 3} b a {1 2 3} b ... the proc "touch" has _not_ changed the variable "data" (3) now uncomment the first "puts $data" command and rerun the script (4) the output is a {1 7 3} b BTW: This does _not_ happen with tcl8.5a2. ---------------------------------------------------------------------- >Comment By: miguel sofer (msofer) Date: 2005-12-06 18:44 Message: Logged In: YES user_id=148712 AHA! Repro succesfull with 8.5a3! It looks like a bug that has been fixed in HEAD. Could you verify with a current tclsh? My impression is that this is another aspect of Bug #1333036, fixed on 2005-10-20. PS: cvs nightly snapshots at ftp://www.tcl.tk/pub/tcl/nightly-cvs/ ---------------------------------------------------------------------- Comment By: Ulrich Ring (uring) Date: 2005-12-06 17:56 Message: Logged In: YES user_id=123371 No custom code, pure tcl. Well, it's embarassing, since I've no idea what's going on. I just ran the following script: mkdir /tmp/tcltest cd /tmp/tcltest tar zxvf /archiv/tcl/tcl8.5a3-src.tar.gz cd tcl8.5a3/unix ./configure --disable-shared make ./tclsh /tmp/test0 ./tclsh /tmp/test1 ...and could repro the misbehaviour. i.e. - no custom tclsh - no custom extensions Well, tomorrow I'll go to think about how to improve the documentation of the facts we're observing. ---------------------------------------------------------------------- Comment By: miguel sofer (msofer) Date: 2005-12-06 16:19 Message: Logged In: YES user_id=148712 Neither I nor 4 other core maintainers could repro this bug. Let me give you some questions and homework to try to narrow it down. (1) these is obviously self-compiled tclsh; what compile flags did you use? (2) Did you run 'make install'? (not necessary if --disable-shared passed to ./configure) (3) Is your tclsh linked with any custom C code, or using extensions? (4) Are you running this at the command line? Could the a {1 7 3} b just be the return value of [touch] being output to the console? Or do you see this effect when running in batch mode? (5) Please repro what I did and confirm that you get different results: cd path/to/Tcl/unix make distclean ./configure --disable-shared make ... ./tclsh path/to/test0 ... ./tclsh path/to/test1 ---------------------------------------------------------------------- Comment By: Ulrich Ring (uring) Date: 2005-12-06 15:24 Message: Logged In: YES user_id=123371 > I cannot reproduce the bug here; am I following your > instructions correctly? Your approach is perfect. On our sites the version of TCL matters. [info patchlevel] should report something >=8.5a3 We can reproduce the bug on: linux - gcc 2.95.x linux - gcc 3.3.x windows VC7 I even checked the "latest" snapshot ( actually it was of yesterday ). If you can't reproduce the bug, what can we do to give you more precise information? ---------------------------------------------------------------------- Comment By: miguel sofer (msofer) Date: 2005-12-06 13:54 Message: Logged In: YES user_id=148712 I cannot reproduce the bug here; am I following your instructions correctly? mig@uhu:/home/CVS/tcl_SF_clean/unix$ cat /tmp/test0 proc touch {listValue} { lset listValue 1 1 7 return $listValue } set data [list a [list 1 2 3] b] puts $data touch $data puts $data mig@uhu:/home/CVS/tcl_SF_clean/unix$ ./tclsh /tmp/test0 a {1 2 3} b a {1 2 3} b mig@uhu:/home/CVS/tcl_SF_clean/unix$ cat /tmp/test1 proc touch {listValue} { lset listValue 1 1 7 return $listValue } set data [list a [list 1 2 3] b] #puts $data touch $data puts $data mig@uhu:/home/CVS/tcl_SF_clean/unix$ ./tclsh /tmp/test1 a {1 2 3} b ---------------------------------------------------------------------- Comment By: Ulrich Ring (uring) Date: 2005-12-06 13:40 Message: Logged In: YES user_id=123371 oops. the command in proc touch must read: lset listValue 1 1 7 sorry; ---------------------------------------------------------------------- Comment By: miguel sofer (msofer) Date: 2005-12-06 13:26 Message: Logged In: YES user_id=148712 Something is wrong in your description: mig@uhu:/home/CVS/tcl_SF_clean/unix$ cat /tmp/test0 proc touch {listValue} { lset listValue 1 4 5 return $listValue } set data [list a [list 1 2 3] b] puts $data touch $data puts $data mig@uhu:/home/CVS/tcl_SF_clean/unix$ ./tclsh /tmp/test0 a {1 2 3} b list index out of range while executing "lset listValue 1 4 5" (procedure "touch" line 2) invoked from within "touch $data" (file "/tmp/test0" line 7) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1374582&group_id=10894 |