Tcl Source Code

View Ticket
Login
Ticket UUID: a858d95f4bfddafb85b640c3dd0d96a543b53407
Title: segmenting error of v8.7 [clock]
Type: Bug Version: 8.7
Submitter: anonymous Created on: 2024-05-07 14:37:14
Subsystem: 16. Commands A-H Assigned To: nobody
Priority: 5 Medium Severity: Important
Status: Closed Last Modified: 2024-05-07 21:39:48
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2024-05-07 21:39:48
Description:
This code snippet results in the segmenting error of Tcl v8.7:


    puts [clock format [clock seconds] -format noarr(%d)]


The error doesn't occur before and after v8.7, thus possibly needs a scrupulous attention.
User Comments: jan.nijtmans added on 2024-05-07 21:39:48:

Confirming the fix.

Many thanks to anonymous for the bug-report! Many thanks to Sergey for the fixing this so quickly!


sebres added on 2024-05-07 19:10:46:

Fixed in [c432a8b50b3de8bb] for 8.7.

Additionally I'll try to rewrite both routines a bit (to avoid unneeded realloc) and then merge it to 9.0.


jan.nijtmans added on 2024-05-07 16:52:08:

That's here


jan.nijtmans added on 2024-05-07 16:48:00:

Stacktrace:

0   libsystem_platform.dylib      	    0x7ff815c8c350 _platform_memmove$VARIANT$Haswell + 496
1   tktest                        	       0x102b3155d ClockFormat + 1645 (tclClockFmt.c:3503)
2   tktest                        	       0x102b283a9 ClockFormatObjCmd + 249 (tclClock.c:3569)
3   tktest                        	       0x102b13538 Dispatch + 120 (tclBasic.c:4608)
4   tktest                        	       0x102b0f7c6 TclNRRunCallbacks + 118 (tclBasic.c:4624)


jan.nijtmans added on 2024-05-07 16:42:35:

I see exactly the same error in wish8.7 and wish9.0


anonymous added on 2024-05-07 15:35:49:

Сергей, на тебя вся надежда:)

I can not reproduce this error with wish9.0.

So, another issue: why tclsh9.0 fails, while wish9.0 not.


jan.nijtmans added on 2024-05-07 14:52:13:

I can reproduce both in 8.7 and 9.0:

$ tclsh9.0
% puts [clock format [clock seconds] -format noarr(%d)]
Segmentation fault

$ tclsh8.7 % puts [clock format [clock seconds] -format noarr(%d)] Segmentation fault

Sergey, can you have a look, please?