Skip to content
Tcl Source Code View Ticket
Login

View Ticket

latest 9-0-branch commit introduces test suite crash

Closed / Fixedf6afe6b71d26e111c7742690fe93c164a5489404Created 92 days agoUpdated 90 days ago
Descriptionplain2026-09-01 17:52:51
Testing tip of the core-9-0-branch...

$ make test-tcl TESTFLAGS="-file compile.test -match compile-18.5 -verbose bpste"
...
Tests began at 2026-09-01 13:52:16 EDT
compile.test
---- compile-18.5 start
++++ compile-18.5 PASSED
Test file error: child killed: segmentation violation
...
dgp Ticket [f6afe6b71d]: 3 changes [History diff]2026-09-01 17:53:16
dgpplain2026-09-01 18:00:46
Program received signal SIGSEGV, Segmentation fault.
0x000055555573061f in TclThreadFreeObj (objPtr=0x555555ec879000) at /home/dgp/fossil/tcl9.0/generic/tclThreadAlloc.c:595
595	    objPtr->internalRep.twoPtrValue.ptr1 = cachePtr->firstObjPtr;
(gdb) bt
#0  0x000055555573061f in TclThreadFreeObj (objPtr=0x555555ec879000)
    at /home/dgp/fossil/tcl9.0/generic/tclThreadAlloc.c:595
#1  0x00005555556faba8 in TclFreeObj (objPtr=0x555555ab478000)
    at /home/dgp/fossil/tcl9.0/generic/tclObj.c:1453
...
sebreswiki2026-09-01 19:20:01

Sorry, it is not reproducible to me, neither for linux, nor for windows (with/without debug/memory/zipfs/etc).

  1. Missed `make clean` maybe? (I'm unsure it is needed, since Proc structure is enlarged, but it is used in tclProc.c/tclCmdIL.c only, which are modified).
  2. How did you configure this?
  3. Is the thread-module present, and if so, was it created for an earlier version?

sebresmarkdown2026-09-01 20:30:52

OK, I could reproduce a crash repeated this:

timerate { set i [interp create]; $i eval { tcl::unsupported::disassemble lambda {{} {}} }; interp delete $i }
Digging further.

sebreswiki2026-09-01 21:52:16

It was a forgotten disassemble adjustment (it used the same logic as before fix for SF [e533296a92d89044] with a cmd in call stack, so it conflicted with latest fix).

Shall be fixed now for 8.6 and 9.0 (see [a8133670760aa4a8]). The code is also simplified a bit now.

jan.nijtmanswiki2026-09-02 07:51:28

oo.test
Test file error: alloc: invalid block: 0x63636cc3c890: 70 6c

We are not there yet :-(

sebreswiki2026-09-02 11:28:53

Hmm... Basically it shall have nothing with OO, but... I found one thing (absent in 8.6, so missed in 9.0) where flags of cloned proc may remain uninitialized by DuplicateProc, used in TclCopyNamespaceProcedures, used in TclOO_Object_Cloned... Fixed in [3d107522cb4253b0]. I hope that's it.

dgpplain2026-09-02 16:52:59
Branch core-9-0-branch tests clean for me now.

Thank you.
sebresmarkdown2026-09-02 17:21:06

Just for the record, in between I could reproduce the OO-test memory failure with previous commit (before the fix)...

Simplest reproduceable case shows it is oo-15.14 "OO: object cloning with target NS":

$ fossil update a8133670760aa4a8
$ ../configure --enable-symbols --disable-zipfs && make -j8 tcltest
$ ./tcltest.sh -file 'oo.test' -verbose stepm -match 'oo-15.1?'
...
Tests began at 2026-09-02 18:56:56 +0200
oo.test
---- oo-15.10 start
++++ oo-15.10 took 1 ms
++++ oo-15.10 PASSED
---- oo-15.11 start
++++ oo-15.11 took 0 ms
++++ oo-15.11 PASSED
---- oo-15.12 start
++++ oo-15.12 took 0 ms
++++ oo-15.12 PASSED
---- oo-15.14 start
Test file error: alloc: invalid block: 00000000035AEC50: 50 3

$ fossil update core-9-0-branch && make -j8 tcltest
$ ./tcltest.sh -file 'oo.test' -verbose stepm -match 'oo-15.1?'
...
---- oo-15.14 start
++++ oo-15.14 took 0 ms
++++ oo-15.14 PASSED
---- oo-15.15 start
++++ oo-15.15 took 0 ms
++++ oo-15.15 PASSED

Tests ended at 2026-09-02 18:57:39 +0200
all.tcl:        Total   388     Passed  5       Skipped 383     Failed  0
Sourced 1 Test Files.

So it was as assumed the cloning... And yes, the last (already mentioned) commit fixed that.

Strange is that this was at all not reproducible with --enable-symbols=all or --enable-symbols=mem (or even without --enable-symbols) no matter how many times I repeated that, so only --enable-symbols without parameter provides some constant reproducible constellation or corner case match causing that uninitialized flags got 0x80 bit (or free causes a memory failure).

jan.nijtmanswiki2026-09-03 15:08:17

I don't see any failures any more. Many thanks, @sebres!

Log in (anonymous is fine) to add a comment.