Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2024-08-30
19:02
Merge [5d148bf3046a8655]: Amend [ae09f6b190]: fixes SF [a7b7dd7927f3d56b] - LoadCleanupProc can be i... check-in: d582c6e30d user: pooryorick tags: unchained, INCOMPATIBLE_LICENSE
2024-07-16
15:10 • Closed ticket [a7b7dd7927]: segfault after unload-4.6 plus 6 other changes artifact: 7071633da4 user: sebres
14:54
amend to [ae09f6b190]: fixes SF [a7b7dd7927f3d56b] - LoadCleanupProc can be invoked with NULL first ... check-in: 96910cd882 user: sebres tags: core-8-branch
2024-07-15
19:49 • Ticket [ae09f6b190] Mem leak in trunk status still Closed with 6 other chang... artifact: 13c6b9f620 user: oehhar
18:30 • Ticket [a7b7dd7927] segfault after unload-4.6 status still Open with 3 other... artifact: ef8713bad4 user: dgp
18:27 • New ticket [a7b7dd7927]. artifact: f198130fe0 user: dgp

segfault after unload-4.6

Closed / Fixeda7b7dd7927f3d56b59cbe9d58491b243d85914b6Created 2 years agoUpdated 2 years ago
Descriptionplain2024-07-15 18:27:40
(gdb) run
Starting program: /local/tmp/dgp/fossil/tcl/debug/tcltest /home/dgp/fossil/tcl/tests/all.tcl -singleproc 1
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Tests running in interp:  /local/tmp/dgp/fossil/tcl/debug/tcltest
Tests located in:  /local/tmp/dgp/fossil/tcl/tests
Tests running in:  /local/tmp/dgp/fossil/tcl/debug
Temporary files stored in /local/tmp/dgp/fossil/tcl/debug
Test files sourced into current interpreter
Running tests that match:  unload-4.6
Skipping test files that match:  l.*.test
Only running test files that match:  unload.test
Tests began at Mon Jul 15 14:22:50 EDT 2024
unload.test
---- unload-4.6 start
++++ unload-4.6 PASSED

Program received signal SIGSEGV, Segmentation fault.
0x00005555556e945e in LoadCleanupProc (clientData=0x0, interp=0x555555e60fc0) at /home/dgp/fossil/tcl/generic/tclLoad.c:1200
1200		libraryPtr = ipPtr->libraryPtr;
(gdb) bt
#0  0x00005555556e945e in LoadCleanupProc (clientData=0x0, 
    interp=0x555555e60fc0) at /home/dgp/fossil/tcl/generic/tclLoad.c:1200
#1  0x00005555555a67ad in DeleteInterpProc (blockPtr=0x555555e60fc0)
    at /home/dgp/fossil/tcl/generic/tclBasic.c:1987
#2  0x000055555570a845 in Tcl_EventuallyFree (clientData=0x555555e60fc0, 
    freeProc=0x5555555a63ec <DeleteInterpProc>)
    at /home/dgp/fossil/tcl/generic/tclPreserve.c:296
#3  0x00005555555a63e7 in Tcl_DeleteInterp (interp=0x555555e60fc0)
    at /home/dgp/fossil/tcl/generic/tclBasic.c:1838
#4  0x00005555556b7b96 in ChildObjCmdDeleteProc (clientData=0x555555e60fc0)
    at /home/dgp/fossil/tcl/generic/tclInterp.c:2731
#5  0x00005555555a9372 in Tcl_DeleteCommandFromToken (interp=0x555555874c80, 
    cmd=0x555555e10d40) at /home/dgp/fossil/tcl/generic/tclBasic.c:3768
#6  0x00005555556b3ee6 in NRInterpCmd (dummy612=0x0, interp=0x555555874c80, 
    objc=3, objv=0x555555879658)
    at /home/dgp/fossil/tcl/generic/tclInterp.c:881
#7  0x00005555555aa78b in Dispatch (data=0x555555eb8318, 
    interp=0x555555874c80, dummy4603=0)
    at /home/dgp/fossil/tcl/generic/tclBasic.c:4641
#8  0x00005555555aa7f6 in TclNRRunCallbacks (interp=0x555555874c80, result=0, 
    rootPtr=0x0) at /home/dgp/fossil/tcl/generic/tclBasic.c:4657
#9  0x00005555555a9ee7 in Tcl_EvalObjv (interp=0x555555874c80, objc=3, 
    objv=0x555555879010, flags=2097168)
    at /home/dgp/fossil/tcl/generic/tclBasic.c:4396
#10 0x00005555555acc5f in TclEvalEx (interp=0x555555874c80, 
    script=0x5555558e4290 "# all.tcl --\n#\n# This file contains a top-level script to run all of the Tcl\n# tests.  Execute it by invoking \"source all.tcl\" when running tcltest\n# in this directory.\n#\n# Copyright © 1998-1999 Scri"..., numBytes=1012, flags=0, line=26, clNextOuter=0x0, 
    outerScript=0x5555558e4290 "# all.tcl --\n#\n# This file contains a top-level script to run all of the Tcl\n# tests.  Execute it by invoking \"source all.tcl\" when running tcltest\n# in this directory.\n#\n# Copyright © 1998-1999 Scri"...) at /home/dgp/fossil/tcl/generic/tclBasic.c:5496
#11 0x00005555556daf0c in Tcl_FSEvalFileEx (interp=0x555555874c80, 
    pathPtr=0x5555558b89a0, encodingName=0x5555557c7ac9 "utf-8")
    at /home/dgp/fossil/tcl/generic/tclIOUtil.c:1787
#12 0x00005555556e9e56 in Tcl_MainEx (argc=-1, argv=0x7fffffffde78, 
    appInitProc=0x55555557edec <Tcl_AppInit>, interp=0x555555874c80)
    at /home/dgp/fossil/tcl/generic/tclMain.c:404
#13 0x000055555557edec in main (argc=4, argv=0x7fffffffde78)
    at /home/dgp/fossil/tcl/unix/tclAppInit.c:94
(gdb)
Referenced by1
  • 13c6b9f620Ticket [ae09f6b190] Mem leak in trunk status still Closed with 6 other changes ticket2024-07-15 19:49:21
dgpplain2024-07-15 18:30:14
[
Appears this segfault is new in checkin [6e3e6a7896].
sebreswiki2024-07-16 15:10:28

Sorry, my mistake... Fixed now in [96910cd8822ffb8f] and merged to 9.0.

However, I have to admit, the missing tests were affected by "pkgua.dllRequired" constraint and I simply overlooked these... together with the fact that LoadCleanupProc can be surely invoked with NULL first pointer (empty list of libraries in assoc-data on interpreter deletion if everything unloaded earlier), because it'd never delete "tclLoad" assoc-data.

Any idea why "unix/dltest" (or at least this pkgua needed for the test) is only part of unix build (and therefore this is not covered for windows platform at all)?

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