Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2024-08-21
13:29 • Closed ticket [0af9450e56]: test incr-1.31 fails plus 6 other changes artifact: 98635f7c4c user: sebres
2024-08-20
13:50
Fix [0af9450e56]: test incr-1.31 fails check-in: 536af5cb81 user: jan.nijtmans tags: core-8-6-branch
2024-08-17
14:29 • Ticket [0af9450e56] test incr-1.31 fails status still Open with 3 other cha... artifact: 50abd1f58e user: sebres
2024-08-14
14:25 • Ticket [0af9450e56]: 4 changes artifact: 57fe1a6770 user: jan.nijtmans
12:48 • Ticket [0af9450e56]: 4 changes artifact: ef7d901617 user: oehhar
12:36 • Ticket [0af9450e56]: 4 changes artifact: 3def008583 user: oehhar
2024-08-12
16:43 • New ticket [0af9450e56]. artifact: 07f813fcf4 user: dgp

test incr-1.31 fails

Closed / Fixed0af9450e562a5a25cb210f2de06d46957f589665Created 2 years agoUpdated 2 years ago
Descriptionplain2024-08-12 16:43:04
I see this on the 8.6 branch, not later branches.


==== incr-1.31 no overflow in TclCompileIncrCmd and Tcl_IncrObjCmd, bug [7179c6724cd38271] FAILED
==== Contents of test case:

    # TclCompileIncrCmd: compiled incr TEBC with immutable constant offs (INST_INCR_*_IMM instructions):
    lappend res [set i 0; incr i 0x7FFFFFFF]
    lappend res [set i 0; incr i 0xFFFFFF80]
    lappend res [set i 0; incr i 0xFFFFFF81]
    lappend res [set i 0; incr i 0xFFFFFFFF]
    lappend res [set i 0; incr i 0x10000007F]
    lappend res [set i 0; incr i 0x100000080]
    lappend res [set i 0; incr i 0x7FFFFFFFFFFFFFFF]
    lappend res [set i 0; incr i 0xFFFFFFFFFFFFFF80]
    lappend res [set i 0; incr i 0xFFFFFFFFFFFFFF81]
    lappend res [set i 0; incr i 0xFFFFFFFFFFFFFFFF]
    lappend res [set i 0; incr i 0x1000000000000007F]
    lappend res [set i 0; incr i 0x10000000000000080]
    # TclCompileIncrCmd: compiled incr TEBC with dynamic offs (INST_INCR_* instructions without _IMM):
    lappend res [set i 0; incr i [set x 0x7FFFFFFF]]
    lappend res [set i 0; incr i [set x 0xFFFFFF80]]
    lappend res [set i 0; incr i [set x 0xFFFFFF81]]
    lappend res [set i 0; incr i [set x 0xFFFFFFFF]]
    lappend res [set i 0; incr i [set x 0x10000007F]]
    lappend res [set i 0; incr i [set x 0x100000080]]
    lappend res [set i 0; incr i [set x 0x7FFFFFFFFFFFFFFF]]
    lappend res [set i 0; incr i [set x 0xFFFFFFFFFFFFFF80]]
    lappend res [set i 0; incr i [set x 0xFFFFFFFFFFFFFF81]]
    lappend res [set i 0; incr i [set x 0xFFFFFFFFFFFFFFFF]]
    lappend res [set i 0; incr i [set x 0x1000000000000007F]]
    lappend res [set i 0; incr i [set x 0x10000000000000080]]
    # Tcl_IncrObjCmd: non-compiled incr command (or NRE):
    set cmd incr
    lappend res [set i 0; $cmd i 0x7FFFFFFF]
    lappend res [set i 0; $cmd i 0xFFFFFF80]
    lappend res [set i 0; $cmd i 0xFFFFFF81]
    lappend res [set i 0; $cmd i 0xFFFFFFFF]
    lappend res [set i 0; $cmd i 0x10000007F]
    lappend res [set i 0; $cmd i 0x100000080]
    lappend res [set i 0; $cmd i 0x7FFFFFFFFFFFFFFF]
    lappend res [set i 0; $cmd i 0xFFFFFFFFFFFFFF80]
    lappend res [set i 0; $cmd i 0xFFFFFFFFFFFFFF81]
    lappend res [set i 0; $cmd i 0xFFFFFFFFFFFFFFFF]
    lappend res [set i 0; $cmd i 0x1000000000000007F]
    lappend res [set i 0; $cmd i 0x10000000000000080]

---- Result was:
2147483647 4294967168 -127 -1 4294967423 4294967424 9223372036854775807 18446744073709551488 18446744073709551489 18446744073709551615 18446744073709551743 18446744073709551744 2147483647 4294967168 4294967169 4294967295 4294967423 4294967424 9223372036854775807 18446744073709551488 18446744073709551489 18446744073709551615 18446744073709551743 18446744073709551744 2147483647 4294967168 4294967169 4294967295 4294967423 4294967424 9223372036854775807 18446744073709551488 18446744073709551489 18446744073709551615 18446744073709551743 18446744073709551744
---- Result should have been (exact matching):
2147483647 4294967168 4294967169 4294967295 4294967423 4294967424 9223372036854775807 18446744073709551488 18446744073709551489 18446744073709551615 18446744073709551743 18446744073709551744 2147483647 4294967168 4294967169 4294967295 4294967423 4294967424 9223372036854775807 18446744073709551488 18446744073709551489 18446744073709551615 18446744073709551743 18446744073709551744 2147483647 4294967168 4294967169 4294967295 4294967423 4294967424 9223372036854775807 18446744073709551488 18446744073709551489 18446744073709551615 18446744073709551743 18446744073709551744
==== incr-1.31 FAILED
Referenced by1
oehharwiki2024-08-14 12:36:26

Hi Don, thanks for the bug report.

Jan marked this with a knownBug attribute by commit [bcdd7f1efb].

I tried current core-8-6-branch with MS-VC6 32 bit compile on 64 bit Windows.

A new compile warning:

generic\tclProc.c(2275) : warning C4550: expression evaluates to a function which is missing an argument list

For me, the test passed. I used the following command line to also run knownBug tests (which are otherwise skipped):

nmake -f makefile.vc test TESTFLAGS="-constraints knownBug -verbose tes -file incr.test"

All tests pass.

I first thought, this issue was introduced by the fix for [7179c6724cd38271] (by magic Sergey). But I do not see the issue, sorry.

Thank you all, Harald

oehharwiki2024-08-14 12:48:35

As Jans commit note on [bcdd7f1efb] says "Not fixed on 64 bit", I tried with 64 bit MS-VS2015. All incr tests including 1-31 pass.

Perhaps, my command line is wrong. I used the same as in my last comment.

Anyway. Thank you all, Harald

jan.nijtmansplain2024-08-14 14:25:22
> Perhaps, my command line is wrong

Don't worry, you command line is OK!!!!!

I should be more accurate in my description: The testcase only fails on systems where sizeof(long) == 64. So, on 32-bit linux and on Windows (32-bit and 64-bit) everything works fine. On 64-bit Linux and MacOS, it's still not fixed.

@Sergey, you still have something to do ;-)    No high prio, because it's only on 8.6
sebreswiki2024-08-17 14:29:37

I know... Just the power supply of my PC got broken as I was worked on the next fix, the new one is ordered, I'm waiting for the delivery (may be monday).

By the way, I tend to backport my TclGetSignedIntFromObj as suggested in [7179c6724cd38271]. Basically one can almost never use Tcl?_?GetIntFromObj safely, because of its "unsafety" for overflow from wide.

sebreswiki2024-08-21 13:29:53

Seems to be fixed in [536af5cb81feb742]. Thus close now.

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