Tcl Source Code

View Ticket
Login
Ticket UUID: d2a3c5f80bf47362e2a9ab02152cceadc916ba24
Title: test lseq hangs with -Os
Type: Bug Version: 9.0.1
Submitter: anonymous Created on: 2024-12-16 16:31:49
Subsystem: 34. tcltest Package Assigned To: sebres
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2024-12-26 13:53:28
Resolution: Fixed Closed By: sebres
    Closed on: 2024-12-26 13:53:28
Description:
tcl: 9.0.1
hardware : purism librem5 r4 aarch64
kernel 6.6.0-1-librem5
OS :  pureos 10 byzantium
gcc : (Debian 10.2.1-6) 10.2.1 20210110
CFLAGS : " -Os "

during make -k test
test lseq hangs seemingly forever (waited 6 days, no luck) without -Os it succeeds instantly.
User Comments: sebres added on 2024-12-26 13:53:28:

Thx!
Thus merged.


anonymous added on 2024-12-25 04:17:43:
failed tests: 0 
checkout: e133351aff81bdd1bc...

anonymous added on 2024-12-25 01:54:48:
it should have been 

project-code: 1ec9da4c469c29f4717e2a967fe6b916d9c8c06e
checkout:     e2515f05dee875d69dcada9b48f927ca5cac2217 2024-12-21 22:21:01 UTC

i'll try with an updated build next

sebres added on 2024-12-23 22:42:08:

I meant this revision - [e133351aff881bdd].


sebres added on 2024-12-23 22:39:29:

Did you update the branch?..
Paul wrote recently in core-list that the latest revision [d2a3c5f80bf47362] solved the test lseq-1.27 for his system.

Regarding lseq-4.21.2, no idea what it could be.
But if it is still there with latest version, it'd be nice to have this "some text below that".


anonymous added on 2024-12-23 21:50:12:
you're correct I misread the output of the tests -- it didn't hang and appeared to have a correct looking output but i didn't read closely enough apparently:

all.tcl total 66785 passed 61130 skipped 5644 failed 11

files with failing tests;

httpProxy.test lseq.test 

test files exiting with errors: 

binary.test

lseq-1.27 consistence, double always remains double FAILED
reslut was {} {} {} {} 1+50 1e+50
result should have been
1e+50 1e+50 1e+50 1e+50 1e+50 1e+50

lseq-4.21.2 corner case: expected inf failed

there's some text below that

sebres added on 2024-12-23 18:41:48:

looks like tests pass now.

All tests of lseq.test?

Because yesterday Paul confirmed over tclcore mailing list that it doesn't hang anymore, but this test still fails (on Debian for Arm):

==== lseq-1.27 consistence, double always remains double FAILED
---- Result was:
{} {} {} {} 1e+50 1e+50
---- Result should have been (exact matching):
1e+50 1e+50 1e+50 1e+50 1e+50 1e+50
==== lseq-1.27 FAILED

anonymous added on 2024-12-22 17:56:31:
looks like tests pass now.

sebres added on 2024-12-21 19:52:02:

There is a new branch sebres-arith-series-rework what would hopefully fix this issue too.
Can someone test it on the platform/toolchain where it was reproducible previously?


sebres added on 2024-12-20 16:40:23:

The UB is UB and that says everything... sometimes compilers behaves as the developer expects, sometimes - not. What you are calling trivial, is basically not so - the test speculates (quite rightly) that the series are small and therefore the cycles of UpdateStringOfArithSeries will be short and it runs fast. But everything changes if it gets affected by the UB (for whatever reason it happens, even by a compiler "bug" on some circumstances). Anyway, what you see is an after-effect and it is caused by failed conversion for len of doubles start - end and/or the double step. The evidence for that is there - the series with given step/len like in test [lseq {1e50+0} {1e50+1} 1] (with given step), as well as such with count argument don't cause a hang.

However as already wrote, besides this issue, I found many others, inclusive SF, panics (because of not correct type behaviour in callbacks), and possible numeric instability. And the number of them grows with almost every new test, I provide.


anonymous added on 2024-12-20 14:55:03:
> can take months to estimate the bytelength.

but then the question is: why does it do it for this test on aarch64 but not x86_64?  And why does the UB manifest itself during something as trivial as lseq testing?

sebres added on 2024-12-19 22:09:59:

There are several UBs in handling around arith-series length calculation... For instance if large doubles will be converted to wide-integer, it may become truncated, but results in unexpected large size, so an UpdateStringOfArithSeries may enter a cycle to calculate bytelengh for wrong number of elements, what by order of magnitude like 9223372036854775808 can take months to estimate the bytelength. By the way: inside the cycle of "pass 1: estimate space" the bytlen is not checked whether it is already larger than max-possible string, so the estimation cycle may continue up to the end (of enormous series).

I'll fix this and similar UBs and extend it with more tests.

However trying to find all corner cases I found another issue, what does a panic with "UpdateStringProc for type 'arithseries' failed to create a valid string rep", that also may cause sporadic segfault, where an in-place lrange from arith-series like above took place previously.

WiP.


anonymous added on 2024-12-18 22:27:58:
it does exit from generic/tclStrToD.c

it does seem to increase bytlen in UpdateStringOfArithSeries generic/tclArithSeries.c quite high though

pointsman added on 2024-12-18 21:57:18:
Happens that I have the exact same gcc compiler (gcc (Debian 10.2.1-6)
10.2.1 20210110), though on a debian 11.11 box. Build current trunk
with -Os and did not see the reported hang.

Does not seems to be a gcc version specific idiosyncrasy.

anonymous added on 2024-12-18 21:30:28:
sure looks like the loop at L3872 of generic/tclStrToD.c is not exited from

anonymous added on 2024-12-18 21:15:52:
[ oh and needless to say -Os -g *does* still hang ]

anonymous added on 2024-12-18 21:14:18:
it seems to be in some kind of loop going between a bunch of different things.  i took a couple of stack traces 

Reading symbols from /usr/lib/debug/.build-id/d8/3acfa0cca35bafd0b0777dec2e5e6187836279.debug...
0x0000ffffa8c76c50 in TclBN_mp_copy (
    a=a@entry=0xffffe5366260, 
    b=b@entry=0xffffe5366078)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_copy.c:46
46	}
[?2004h(gdb) cbt
[?2004l
#0  0x0000ffffa8c76c50 in TclBN_mp_copy (
    a=a@entry=0xffffe5366260, 
    b=b@entry=0xffffe5366078)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_copy.c:46
#1  0x0000ffffa8c7788c in TclBN_mp_init_copy (
    a=a@entry=0xffffe5366078, 
    b=b@entry=0xffffe5366260)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_init_copy.c:15
#2  0x0000ffffa8c76db0 in TclBN_mp_div (
    a=a@entry=0xffffe5366218, 
    b=b@entry=0xffffe5366260, 
    c=c@entry=0xffffe5366278, 
    d=d@entry=0xffffe5366218)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_div.c:122
#3  0x0000ffffa8c3b554 in ShorteningBignumConversion (endPtr=0xffffe5366318, decpt=0xffffe5366310, 
    ilim1=<optimized out>, ilim=<optimized out>, 
    len=<optimized out>, k=<optimized out>, 
    s5=50, s2=<optimized out>, m2minus=63, 
    m2plus=63, b2=<optimized out>, 
    bw=<optimized out>, dPtr=<synthetic pointer>)
    at /home/purism/Downloads/release.tcl/generic/tclStrToD.c:3976
[?2004h--Type <RET> for more, q to quit, c to continue without paging--
[?2004l
#4  TclDoubleDigits (dv=1.0000000000000001e+50, 
    ndigits=<optimized out>, ndigits@entry=-1, 
    flags=flags@entry=4, 
    decpt=decpt@entry=0xffffe5366310, 
    sign=sign@entry=0xffffe5366314, 
    endPtr=endPtr@entry=0xffffe5366318)
    at /home/purism/Downloads/release.tcl/generic/tclStrToD.c:4539
#5  0x0000ffffa8c47c00 in Tcl_PrintDouble (
    dummy3082=dummy3082@entry=0x0, 
    value=<optimized out>, 
    dst=dst@entry=0xffffe5366390 "")
    at /home/purism/Downloads/release.tcl/generic/tclUtil.c:3123
#6  0x0000ffffa8b6e304 in UpdateStringOfArithSeries (arithSeriesObjPtr=0xaaab1990c020)
    at /home/purism/Downloads/release.tcl/generic/tclArithSeries.c:1146
#7  0x0000ffffa8c21870 in Tcl_GetStringFromObj (
    objPtr=objPtr@entry=0xaaab1990c020, 
    lengthPtr=lengthPtr@entry=0xffffe5366440)
    at /home/purism/Downloads/release.tcl/generic/tclObj.c:1733
#8  0x0000ffffa8c1bb78 in Tcl_MainEx (
    argc=<optimized out>, argc@entry=1, 
    argv=argv@entry=0xffffe53665f8, 
[?2004h--Type <RET> for more, q to quit, c to continue without paging--
[?2004l
    appInitProc=appInitProc@entry=0xaaaade630b74 <Tcl_AppInit>, interp=0xaaab198bb100)
    at /home/purism/Downloads/release.tcl/generic/tclMain.c:536
#9  0x0000aaaade630a5c in main (
    argc=<optimized out>, argv=<optimized out>)
    at /home/purism/Downloads/release.tcl/unix/tclAppInit.c:94
[?2004h(gdb) c
[?2004l
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x0000ffffa8c3e82c in TclpAlloc (
    reqSize=reqSize@entry=32)
    at /home/purism/Downloads/release.tcl/generic/tclThreadAlloc.c:335
335		if (cachePtr->buckets[bucket].numFree || GetBlocks(cachePtr, bucket)) {
[?2004h[?2004l
[?2004h(gdb) bt
[?2004l
#0  0x0000ffffa8c3e82c in TclpAlloc (
    reqSize=reqSize@entry=32)
    at /home/purism/Downloads/release.tcl/generic/tclThreadAlloc.c:335
#1  0x0000ffffa8b7ea30 in Tcl_AttemptAlloc (
    size=size@entry=32)
    at /home/purism/Downloads/release.tcl/generic/tclCkalloc.c:1084
#2  0x0000ffffa8c77830 in TclBN_mp_init (
    a=a@entry=0xffffe5366278)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_init.c:10
#3  0x0000ffffa8c3b510 in ShorteningBignumConversion (endPtr=0xffffe5366318, decpt=0xffffe5366310, 
    ilim1=-1, ilim=<optimized out>, 
    len=<optimized out>, k=<optimized out>, 
    s5=50, s2=<optimized out>, m2minus=63, 
    m2plus=63, b2=<optimized out>, 
    bw=<optimized out>, dPtr=<synthetic pointer>)
    at /home/purism/Downloads/release.tcl/generic/tclStrToD.c:3972
#4  TclDoubleDigits (dv=1.0000000000000001e+50, 
    ndigits=<optimized out>, ndigits@entry=-1, 
    flags=flags@entry=4, 
    decpt=decpt@entry=0xffffe5366310, 
    sign=sign@entry=0xffffe5366314, 
[?2004h--Type <RET> for more, q to quit, c to continue without paging--
[?2004l
    endPtr=endPtr@entry=0xffffe5366318)
    at /home/purism/Downloads/release.tcl/generic/tclStrToD.c:4539
#5  0x0000ffffa8c47c00 in Tcl_PrintDouble (
    dummy3082=dummy3082@entry=0x0, 
    value=<optimized out>, 
    dst=dst@entry=0xffffe5366390 "")
    at /home/purism/Downloads/release.tcl/generic/tclUtil.c:3123
#6  0x0000ffffa8b6e304 in UpdateStringOfArithSeries (arithSeriesObjPtr=0xaaab1990c020)
    at /home/purism/Downloads/release.tcl/generic/tclArithSeries.c:1146
#7  0x0000ffffa8c21870 in Tcl_GetStringFromObj (
    objPtr=objPtr@entry=0xaaab1990c020, 
    lengthPtr=lengthPtr@entry=0xffffe5366440)
    at /home/purism/Downloads/release.tcl/generic/tclObj.c:1733
#8  0x0000ffffa8c1bb78 in Tcl_MainEx (
    argc=<optimized out>, argc@entry=1, 
    argv=argv@entry=0xffffe53665f8, 
    appInitProc=appInitProc@entry=0xaaaade630b74 <Tcl_AppInit>, interp=0xaaab198bb100)
    at /home/purism/Downloads/release.tcl/generic/tclMain.c:536
#9  0x0000aaaade630a5c in main (
[?2004h--Type <RET> for more, q to quit, c to continue without paging--
[?2004l
    argc=<optimized out>, argv=<optimized out>)
    at /home/purism/Downloads/release.tcl/unix/tclAppInit.c:94
[?2004h(gdb) 
(gdb) 
(gdb) kbtc
[?2004l
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x0000ffffa8c3eb80 in TclpRealloc (
    ptr=0xaaab19989bb0, reqSize=reqSize@entry=24)
    at /home/purism/Downloads/release.tcl/generic/tclThreadAlloc.c:459
459		if (size > min && size <= bucketInfo[bucket].blockSize) {
[?2004h[?2004l
[?2004h(gdb) bt
[?2004l
#0  0x0000ffffa8c3eb80 in TclpRealloc (
    ptr=0xaaab19989bb0, reqSize=reqSize@entry=24)
    at /home/purism/Downloads/release.tcl/generic/tclThreadAlloc.c:459
#1  0x0000ffffa8b7ead8 in Tcl_AttemptRealloc (
    ptr=<optimized out>, size=size@entry=24)
    at /home/purism/Downloads/release.tcl/generic/tclCkalloc.c:1153
#2  0x0000ffffa8c777dc in TclBN_mp_grow (
    a=a@entry=0xffffe5366060, size=3)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_grow.c:24
#3  0x0000ffffa8c786f8 in TclBN_mp_mul_2d (
    a=a@entry=0xffffe5366060, b=b@entry=2, 
    c=c@entry=0xffffe5366060)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_mul_2d.c:24
#4  0x0000ffffa8c76e04 in TclBN_mp_div (
    a=a@entry=0xffffe5366218, 
    b=b@entry=0xffffe5366260, 
    c=c@entry=0xffffe5366278, 
    d=d@entry=0xffffe5366218)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_div.c:132
#5  0x0000ffffa8c3b554 in ShorteningBignumConversion (endPtr=0xffffe5366318, decpt=0xffffe5366310, 
[?2004h--Type <RET> for more, q to quit, c to continue without paging--
[?2004l
    ilim1=<optimized out>, ilim=<optimized out>, 
    len=<optimized out>, k=<optimized out>, 
    s5=50, s2=<optimized out>, m2minus=63, 
    m2plus=63, b2=<optimized out>, 
    bw=<optimized out>, dPtr=<synthetic pointer>)
    at /home/purism/Downloads/release.tcl/generic/tclStrToD.c:3976
#6  TclDoubleDigits (dv=1.0000000000000001e+50, 
    ndigits=<optimized out>, ndigits@entry=-1, 
    flags=flags@entry=4, 
    decpt=decpt@entry=0xffffe5366310, 
    sign=sign@entry=0xffffe5366314, 
    endPtr=endPtr@entry=0xffffe5366318)
    at /home/purism/Downloads/release.tcl/generic/tclStrToD.c:4539
#7  0x0000ffffa8c47c00 in Tcl_PrintDouble (
    dummy3082=dummy3082@entry=0x0, 
    value=<optimized out>, 
    dst=dst@entry=0xffffe5366390 "")
    at /home/purism/Downloads/release.tcl/generic/tclUtil.c:3123
#8  0x0000ffffa8b6e304 in UpdateStringOfArithSeries (arithSeriesObjPtr=0xaaab1990c020)
    at /home/purism/Downloads/release.tcl/generic/tclArithSeries.c:1146
#9  0x0000ffffa8c21870 in Tcl_GetStringFromObj (
[?2004h--Type <RET> for more, q to quit, c to continue without paging--
[?2004l
    objPtr=objPtr@entry=0xaaab1990c020, 
    lengthPtr=lengthPtr@entry=0xffffe5366440)
    at /home/purism/Downloads/release.tcl/generic/tclObj.c:1733
#10 0x0000ffffa8c1bb78 in Tcl_MainEx (
    argc=<optimized out>, argc@entry=1, 
    argv=argv@entry=0xffffe53665f8, 
    appInitProc=appInitProc@entry=0xaaaade630b74 <Tcl_AppInit>, interp=0xaaab198bb100)
    at /home/purism/Downloads/release.tcl/generic/tclMain.c:536
#11 0x0000aaaade630a5c in main (
    argc=<optimized out>, argv=<optimized out>)
    at /home/purism/Downloads/release.tcl/unix/tclAppInit.c:94
[?2004h(gdb) c
[?2004l
Continuing.
^C
Program received signal SIGINT, Interrupt.
__memset_generic ()
    at ../sysdeps/aarch64/memset.S:65
65	../sysdeps/aarch64/memset.S: No such file or directory.
[?2004h[?2004l
[?2004h(gdb) bt
[?2004l
#0  __memset_generic ()
    at ../sysdeps/aarch64/memset.S:65
#1  0x0000ffffa8c769e0 in TclBN_mp_clear (
    a=a@entry=0xffffe53660a8)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_clear.c:12
#2  0x0000ffffa8c76f40 in TclBN_mp_div (
    a=a@entry=0xffffe5366218, 
    b=b@entry=0xffffe5366260, 
    c=c@entry=0xffffe5366278, 
    d=d@entry=0xffffe5366218)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_div.c:240
#3  0x0000ffffa8c3b554 in ShorteningBignumConversion (endPtr=0xffffe5366318, decpt=0xffffe5366310, 
    ilim1=<optimized out>, ilim=<optimized out>, 
    len=<optimized out>, k=<optimized out>, 
    s5=50, s2=<optimized out>, m2minus=63, 
    m2plus=63, b2=<optimized out>, 
    bw=<optimized out>, dPtr=<synthetic pointer>)
    at /home/purism/Downloads/release.tcl/generic/tclStrToD.c:3976
#4  TclDoubleDigits (dv=1.0000000000000001e+50, 
    ndigits=<optimized out>, ndigits@entry=-1, 
    flags=flags@entry=4, 
    decpt=decpt@entry=0xffffe5366310, 
[?2004h--Type <RET> for more, q to quit, c to continue without paging--c
[?2004l
    sign=sign@entry=0xffffe5366314, endPtr=endPtr@entry=0xffffe5366318) at /home/purism/Downloads/release.tcl/generic/tclStrToD.c:4539
#5  0x0000ffffa8c47c00 in Tcl_PrintDouble (dummy3082=dummy3082@entry=0x0, value=<optimized out>, dst=dst@entry=0xffffe5366390 "") at /home/purism/Downloads/release.tcl/generic/tclUtil.c:3123
#6  0x0000ffffa8b6e304 in UpdateStringOfArithSeries (arithSeriesObjPtr=0xaaab1990c020) at /home/purism/Downloads/release.tcl/generic/tclArithSeries.c:1146
#7  0x0000ffffa8c21870 in Tcl_GetStringFromObj (objPtr=objPtr@entry=0xaaab1990c020, lengthPtr=lengthPtr@entry=0xffffe5366440) at /home/purism/Downloads/release.tcl/generic/tclObj.c:1733
#8  0x0000ffffa8c1bb78 in Tcl_MainEx (argc=<optimized out>, argc@entry=1, argv=argv@entry=0xffffe53665f8, appInitProc=appInitProc@entry=0xaaaade630b74 <Tcl_AppInit>, interp=0xaaab198bb100) at /home/purism/Downloads/release.tcl/generic/tclMain.c:536
#9  0x0000aaaade630a5c in main (argc=<optimized out>, argv=<optimized out>) at /home/purism/Downloads/release.tcl/unix/tclAppInit.c:94
[?2004h(gdb) c
[?2004l
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x0000ffffa894bab8 in __GI___pthread_getspecific (
    key=1) at pthread_getspecific.c:30
30	pthread_getspecific.c: No such file or directory.
[?2004h[?2004l
[?2004h(gdb) Quit
[?2004l
[?2004h(gdb) 
[?2004l
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x0000ffffa8c77a10 in TclBN_mp_init_size (
    a=a@entry=0xffffe5366048, size=4)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_init_size.c:8
8	{
[?2004h[?2004l
[?2004h(gdb) bt
[?2004l
#0  0x0000ffffa8c77a10 in TclBN_mp_init_size (
    a=a@entry=0xffffe5366048, size=4)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_init_size.c:8
#1  0x0000ffffa8c76d4c in TclBN_mp_div (
    a=a@entry=0xffffe5366218, 
    b=b@entry=0xffffe5366260, 
    c=c@entry=0xffffe5366278, 
    d=d@entry=0xffffe5366218)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_div.c:111
#2  0x0000ffffa8c3b554 in ShorteningBignumConversion (endPtr=0xffffe5366318, decpt=0xffffe5366310, 
    ilim1=<optimized out>, ilim=<optimized out>, 
    len=<optimized out>, k=<optimized out>, 
    s5=50, s2=<optimized out>, m2minus=63, 
    m2plus=63, b2=<optimized out>, 
    bw=<optimized out>, dPtr=<synthetic pointer>)
    at /home/purism/Downloads/release.tcl/generic/tclStrToD.c:3976
#3  TclDoubleDigits (dv=1.0000000000000001e+50, 
    ndigits=<optimized out>, ndigits@entry=-1, 
    flags=flags@entry=4, 
    decpt=decpt@entry=0xffffe5366310, 
    sign=sign@entry=0xffffe5366314, 
    endPtr=endPtr@entry=0xffffe5366318)
[?2004h--Type <RET> for more, q to quit, c to continue without paging--
[?2004l
    at /home/purism/Downloads/release.tcl/generic/tclStrToD.c:4539
#4  0x0000ffffa8c47c00 in Tcl_PrintDouble (
    dummy3082=dummy3082@entry=0x0, 
    value=<optimized out>, 
    dst=dst@entry=0xffffe5366390 "")
    at /home/purism/Downloads/release.tcl/generic/tclUtil.c:3123
#5  0x0000ffffa8b6e304 in UpdateStringOfArithSeries (arithSeriesObjPtr=0xaaab1990c020)
    at /home/purism/Downloads/release.tcl/generic/tclArithSeries.c:1146
#6  0x0000ffffa8c21870 in Tcl_GetStringFromObj (
    objPtr=objPtr@entry=0xaaab1990c020, 
    lengthPtr=lengthPtr@entry=0xffffe5366440)
    at /home/purism/Downloads/release.tcl/generic/tclObj.c:1733
#7  0x0000ffffa8c1bb78 in Tcl_MainEx (
    argc=<optimized out>, argc@entry=1, 
    argv=argv@entry=0xffffe53665f8, 
    appInitProc=appInitProc@entry=0xaaaade630b74 <Tcl_AppInit>, interp=0xaaab198bb100)
    at /home/purism/Downloads/release.tcl/generic/tclMain.c:536
#8  0x0000aaaade630a5c in main (
    argc=<optimized out>, argv=<optimized out>)
[?2004h--Type <RET> for more, q to quit, c to continue without paging--
[?2004l
    at /home/purism/Downloads/release.tcl/unix/tclAppInit.c:94
[?2004h(gdb) 
[?2004l
[?2004h(gdb) c
[?2004l
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x0000ffffa8c76400 in TclBN_mp_mul_digs_fast (
    a=0xffffe5366260, 
    b=0xffffa8ce9900 <pow5_13+24>, 
    c=0xffffe5366260, digs=4)
    at /home/purism/Downloads/release.tcl/libtommath/bn_s_mp_mul_digs_fast.c:73
73	      _W = _W >> (mp_word)MP_DIGIT_BIT;
[?2004h[?2004l
[?2004h(gdb) bt
[?2004l
#0  0x0000ffffa8c76400 in TclBN_mp_mul_digs_fast (
    a=0xffffe5366260, 
    b=0xffffa8ce9900 <pow5_13+24>, 
    c=0xffffe5366260, digs=4)
    at /home/purism/Downloads/release.tcl/libtommath/bn_s_mp_mul_digs_fast.c:73
#1  0x0000ffffa8c785c4 in TclBN_mp_mul (
    a=<optimized out>, 
    b=b@entry=0xffffa8ce9900 <pow5_13+24>, 
    c=c@entry=0xffffe5366260)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_mul.c:45
#2  0x0000ffffa8c3a660 in MulPow5 (
    base=base@entry=0xffffe5366260, n=n@entry=50, 
    result=result@entry=0xffffe5366260)
    at /home/purism/Downloads/release.tcl/generic/tclStrToD.c:2236
#3  0x0000ffffa8c3b444 in ShorteningBignumConversion (endPtr=0xffffe5366318, decpt=0xffffe5366310, 
    ilim1=-1, ilim=-1, len=<optimized out>, 
    k=<optimized out>, s5=50, s2=0, m2minus=63, 
    m2plus=63, b2=<optimized out>, 
    bw=<optimized out>, dPtr=<synthetic pointer>)
    at /home/purism/Downloads/release.tcl/generic/tclStrToD.c:3933
#4  TclDoubleDigits (dv=1.0000000000000001e+50, 
[?2004h--Type <RET> for more, q to quit, c to continue without paging--
[?2004l
    ndigits=<optimized out>, ndigits@entry=-1, 
    flags=flags@entry=4, 
    decpt=decpt@entry=0xffffe5366310, 
    sign=sign@entry=0xffffe5366314, 
    endPtr=endPtr@entry=0xffffe5366318)
    at /home/purism/Downloads/release.tcl/generic/tclStrToD.c:4539
#5  0x0000ffffa8c47c00 in Tcl_PrintDouble (
    dummy3082=dummy3082@entry=0x0, 
    value=<optimized out>, 
    dst=dst@entry=0xffffe5366390 "")
    at /home/purism/Downloads/release.tcl/generic/tclUtil.c:3123
#6  0x0000ffffa8b6e304 in UpdateStringOfArithSeries (arithSeriesObjPtr=0xaaab1990c020)
    at /home/purism/Downloads/release.tcl/generic/tclArithSeries.c:1146
#7  0x0000ffffa8c21870 in Tcl_GetStringFromObj (
    objPtr=objPtr@entry=0xaaab1990c020, 
    lengthPtr=lengthPtr@entry=0xffffe5366440)
    at /home/purism/Downloads/release.tcl/generic/tclObj.c:1733
#8  0x0000ffffa8c1bb78 in Tcl_MainEx (
    argc=<optimized out>, argc@entry=1, 
    argv=argv@entry=0xffffe53665f8, 
    appInitProc=appInitProc@entry=0xaaaade630b74 <T[?2004h--Type <RET> for more, q to quit, c to continue without paging--
[?2004l
cl_AppInit>, interp=0xaaab198bb100)
    at /home/purism/Downloads/release.tcl/generic/tclMain.c:536
#9  0x0000aaaade630a5c in main (
    argc=<optimized out>, argv=<optimized out>)
    at /home/purism/Downloads/release.tcl/unix/tclAppInit.c:94
[?2004h(gdb) 
[?2004l
[?2004h(gdb) c
[?2004l
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x0000ffffa8a06068 in __vfprintf_internal (
    s=s@entry=0xffffe53660a8, 
    format=format@entry=0xffffa8c9a0bf "e%+d", 
    ap=..., mode_flags=mode_flags@entry=0)
    at vfprintf-internal.c:1646
1646	vfprintf-internal.c: No such file or directory.
[?2004h[?2004l
[?2004h(gdb) bt
[?2004l
#0  0x0000ffffa8a06068 in __vfprintf_internal (
    s=s@entry=0xffffe53660a8, 
    format=format@entry=0xffffa8c9a0bf "e%+d", 
    ap=..., mode_flags=mode_flags@entry=0)
    at vfprintf-internal.c:1646
#1  0x0000ffffa8a173c4 in __vsnprintf_internal (
    string=0xffffe5366391 "e+50", 
    maxlen=<optimized out>, maxlen@entry=27, 
    format=format@entry=0xffffa8c9a0bf "e%+d", 
    args=..., mode_flags=mode_flags@entry=0)
    at vsnprintf.c:114
#2  0x0000ffffa89f51c4 in __GI___snprintf (
    s=<optimized out>, maxlen=maxlen@entry=27, 
    format=format@entry=0xffffa8c9a0bf "e%+d")
    at snprintf.c:31
#3  0x0000ffffa8c47c64 in Tcl_PrintDouble (
    dummy3082=dummy3082@entry=0x0, 
    value=<optimized out>, dst=<optimized out>, 
    dst@entry=0xffffe5366390 "1e+50")
    at /home/purism/Downloads/release.tcl/generic/tclUtil.c:3144
#4  0x0000ffffa8b6e304 in UpdateStringOfArithSeries (arithSeriesObjPtr=0xaaab1990c020)
    at /home/purism/Downloads/release.tcl/generic/tclArithSeries.c:1146
#5  0x0000ffffa8c21870 in Tcl_GetStringFromObj (
[?2004h--Type <RET> for more, q to quit, c to continue without paging--
[?2004l
    objPtr=objPtr@entry=0xaaab1990c020, 
    lengthPtr=lengthPtr@entry=0xffffe5366440)
    at /home/purism/Downloads/release.tcl/generic/tclObj.c:1733
#6  0x0000ffffa8c1bb78 in Tcl_MainEx (
    argc=<optimized out>, argc@entry=1, 
    argv=argv@entry=0xffffe53665f8, 
    appInitProc=appInitProc@entry=0xaaaade630b74 <Tcl_AppInit>, interp=0xaaab198bb100)
    at /home/purism/Downloads/release.tcl/generic/tclMain.c:536
#7  0x0000aaaade630a5c in main (
    argc=<optimized out>, argv=<optimized out>)
    at /home/purism/Downloads/release.tcl/unix/tclAppInit.c:94
[?2004h(gdb) c
[?2004l
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x0000ffffa8c76a68 in TclBN_mp_clear_multi (
    mp=mp@entry=0xffffe5366218)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_clear_multi.c:15
15	      next_mp = va_arg(args, mp_int *);
[?2004h[?2004l
[?2004h(gdb) bt
[?2004l
#0  0x0000ffffa8c76a68 in TclBN_mp_clear_multi (
    mp=mp@entry=0xffffe5366218)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_clear_multi.c:15
#1  0x0000ffffa8c3b648 in ShorteningBignumConversion (endPtr=0xffffe5366318, decpt=0xffffe5366310, 
    ilim1=<optimized out>, ilim=<optimized out>, 
    len=<optimized out>, k=<optimized out>, 
    s5=<optimized out>, s2=<optimized out>, 
    m2minus=63, m2plus=63, b2=<optimized out>, 
    bw=<optimized out>, dPtr=<synthetic pointer>)
    at /home/purism/Downloads/release.tcl/generic/tclStrToD.c:4101
#2  TclDoubleDigits (dv=1.0000000000000001e+50, 
    ndigits=<optimized out>, ndigits@entry=-1, 
    flags=flags@entry=4, 
    decpt=decpt@entry=0xffffe5366310, 
    sign=sign@entry=0xffffe5366314, 
    endPtr=endPtr@entry=0xffffe5366318)
    at /home/purism/Downloads/release.tcl/generic/tclStrToD.c:4539
#3  0x0000ffffa8c47c00 in Tcl_PrintDouble (
    dummy3082=dummy3082@entry=0x0, 
    value=<optimized out>, 
    dst=dst@entry=0xffffe5366390 "")
    at /home/purism/Downloads/release.tcl/generic/t[?2004h--Type <RET> for more, q to quit, c to continue without paging--
[?2004l
clUtil.c:3123
#4  0x0000ffffa8b6e304 in UpdateStringOfArithSeries (arithSeriesObjPtr=0xaaab1990c020)
    at /home/purism/Downloads/release.tcl/generic/tclArithSeries.c:1146
#5  0x0000ffffa8c21870 in Tcl_GetStringFromObj (
    objPtr=objPtr@entry=0xaaab1990c020, 
    lengthPtr=lengthPtr@entry=0xffffe5366440)
    at /home/purism/Downloads/release.tcl/generic/tclObj.c:1733
#6  0x0000ffffa8c1bb78 in Tcl_MainEx (
    argc=<optimized out>, argc@entry=1, 
    argv=argv@entry=0xffffe53665f8, 
    appInitProc=appInitProc@entry=0xaaaade630b74 <Tcl_AppInit>, interp=0xaaab198bb100)
    at /home/purism/Downloads/release.tcl/generic/tclMain.c:536
#7  0x0000aaaade630a5c in main (
    argc=<optimized out>, argv=<optimized out>)
    at /home/purism/Downloads/release.tcl/unix/tclAppInit.c:94
[?2004h(gdb) 
[?2004l
[?2004h(gdb) c
[?2004l
Continuing.
^C
Program received signal SIGINT, Interrupt.
__memset_generic ()
    at ../sysdeps/aarch64/memset.S:37
37	../sysdeps/aarch64/memset.S: No such file or directory.
[?2004h[?2004l
[?2004h(gdb) Quit
[?2004l
[?2004h(gdb) bt
[?2004l
#0  __memset_generic ()
    at ../sysdeps/aarch64/memset.S:37
#1  0x0000ffffa8c769e0 in TclBN_mp_clear (
    a=0xffffe5366230)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_clear.c:12
#2  0x0000ffffa8c76a44 in TclBN_mp_clear_multi (
    mp=mp@entry=0xffffe5366218)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_clear_multi.c:14
#3  0x0000ffffa8c3b648 in ShorteningBignumConversion (endPtr=0xffffe5366318, decpt=0xffffe5366310, 
    ilim1=<optimized out>, ilim=<optimized out>, 
    len=<optimized out>, k=<optimized out>, 
    s5=<optimized out>, s2=<optimized out>, 
    m2minus=63, m2plus=63, b2=<optimized out>, 
    bw=<optimized out>, dPtr=<synthetic pointer>)
    at /home/purism/Downloads/release.tcl/generic/tclStrToD.c:4101
#4  TclDoubleDigits (dv=1.0000000000000001e+50, 
    ndigits=<optimized out>, ndigits@entry=-1, 
    flags=flags@entry=4, 
    decpt=decpt@entry=0xffffe5366310, 
    sign=sign@entry=0xffffe5366314, 
    endPtr=endPtr@entry=0xffffe5366318)
    at /home/purism/Downloads/release.tcl/generic/t[?2004h--Type <RET> for more, q to quit, c to continue without paging--
[?2004l
clStrToD.c:4539
#5  0x0000ffffa8c47c00 in Tcl_PrintDouble (
    dummy3082=dummy3082@entry=0x0, 
    value=<optimized out>, 
    dst=dst@entry=0xffffe5366390 "")
    at /home/purism/Downloads/release.tcl/generic/tclUtil.c:3123
#6  0x0000ffffa8b6e304 in UpdateStringOfArithSeries (arithSeriesObjPtr=0xaaab1990c020)
    at /home/purism/Downloads/release.tcl/generic/tclArithSeries.c:1146
#7  0x0000ffffa8c21870 in Tcl_GetStringFromObj (
    objPtr=objPtr@entry=0xaaab1990c020, 
    lengthPtr=lengthPtr@entry=0xffffe5366440)
    at /home/purism/Downloads/release.tcl/generic/tclObj.c:1733
#8  0x0000ffffa8c1bb78 in Tcl_MainEx (
    argc=<optimized out>, argc@entry=1, 
    argv=argv@entry=0xffffe53665f8, 
    appInitProc=appInitProc@entry=0xaaaade630b74 <Tcl_AppInit>, interp=0xaaab198bb100)
    at /home/purism/Downloads/release.tcl/generic/tclMain.c:536
#9  0x0000aaaade630a5c in main (
    argc=<optimized out>, argv=<optimized out>)
    at /home/purism/Downloads/release.tcl/unix/tclA[?2004h--Type <RET> for more, q to quit, c to continue without paging--
[?2004l
ppInit.c:94
[?2004h(gdb) c
[?2004l
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x0000ffffa8c3e808 in TclpAlloc (
    reqSize=reqSize@entry=16)
    at /home/purism/Downloads/release.tcl/generic/tclThreadAlloc.c:332
332		while (bucketInfo[bucket].blockSize < size) {
[?2004h[?2004l
[?2004h(gdb) bt
[?2004l
#0  0x0000ffffa8c3e808 in TclpAlloc (
    reqSize=reqSize@entry=16)
    at /home/purism/Downloads/release.tcl/generic/tclThreadAlloc.c:332
#1  0x0000ffffa8b7ea30 in Tcl_AttemptAlloc (
    size=size@entry=16)
    at /home/purism/Downloads/release.tcl/generic/tclCkalloc.c:1084
#2  0x0000ffffa8c77a34 in TclBN_mp_init_size (
    a=a@entry=0xffffe5366078, size=2)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_init_size.c:17
#3  0x0000ffffa8c77878 in TclBN_mp_init_copy (
    a=a@entry=0xffffe5366078, 
    b=b@entry=0xffffe5366260)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_init_copy.c:11
#4  0x0000ffffa8c76db0 in TclBN_mp_div (
    a=a@entry=0xffffe5366218, 
    b=b@entry=0xffffe5366260, 
    c=c@entry=0xffffe5366278, 
    d=d@entry=0xffffe5366218)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_div.c:122
#5  0x0000ffffa8c3b554 in ShorteningBignumConversion (endPtr=0xffffe5366318, decpt=0xffffe5366310, 
[?2004h--Type <RET> for more, q to quit, c to continue without paging--
[?2004l
    ilim1=<optimized out>, ilim=<optimized out>, 
    len=<optimized out>, k=<optimized out>, 
    s5=50, s2=<optimized out>, m2minus=63, 
    m2plus=63, b2=<optimized out>, 
    bw=<optimized out>, dPtr=<synthetic pointer>)
    at /home/purism/Downloads/release.tcl/generic/tclStrToD.c:3976
#6  TclDoubleDigits (dv=1.0000000000000001e+50, 
    ndigits=<optimized out>, ndigits@entry=-1, 
    flags=flags@entry=4, 
    decpt=decpt@entry=0xffffe5366310, 
    sign=sign@entry=0xffffe5366314, 
    endPtr=endPtr@entry=0xffffe5366318)
    at /home/purism/Downloads/release.tcl/generic/tclStrToD.c:4539
#7  0x0000ffffa8c47c00 in Tcl_PrintDouble (
    dummy3082=dummy3082@entry=0x0, 
    value=<optimized out>, 
    dst=dst@entry=0xffffe5366390 "")
    at /home/purism/Downloads/release.tcl/generic/tclUtil.c:3123
#8  0x0000ffffa8b6e304 in UpdateStringOfArithSeries (arithSeriesObjPtr=0xaaab1990c020)
    at /home/purism/Downloads/release.tcl/generic/tclArithSeries.c:1146
#9  0x0000ffffa8c21870 in Tcl_GetStringFromObj (
[?2004h--Type <RET> for more, q to quit, c to continue without paging--
[?2004l
    objPtr=objPtr@entry=0xaaab1990c020, 
    lengthPtr=lengthPtr@entry=0xffffe5366440)
    at /home/purism/Downloads/release.tcl/generic/tclObj.c:1733
#10 0x0000ffffa8c1bb78 in Tcl_MainEx (
    argc=<optimized out>, argc@entry=1, 
    argv=argv@entry=0xffffe53665f8, 
    appInitProc=appInitProc@entry=0xaaaade630b74 <Tcl_AppInit>, interp=0xaaab198bb100)
    at /home/purism/Downloads/release.tcl/generic/tclMain.c:536
#11 0x0000aaaade630a5c in main (
    argc=<optimized out>, argv=<optimized out>)
    at /home/purism/Downloads/release.tcl/unix/tclAppInit.c:94
[?2004h(gdb) 
[?2004l
[?2004h(gdb) c
[?2004l
Continuing.
^C
Program received signal SIGINT, Interrupt.
TclBN_mp_cmp_mag (a=<optimized out>, 
    b=<optimized out>)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_cmp_mag.c:33
33	      if (*tmpa < *tmpb) {
[?2004h[?2004l
[?2004h(gdb) cbt
[?2004l
#0  TclBN_mp_cmp_mag (a=<optimized out>, 
    b=<optimized out>)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_cmp_mag.c:33
#1  0x0000ffffa8c76aa8 in TclBN_mp_cmp (
    a=a@entry=0xffffe5366060, 
    b=b@entry=0xffffe5366078)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_cmp.c:23
#2  0x0000ffffa8c76e64 in TclBN_mp_div (
    a=a@entry=0xffffe5366218, 
    b=b@entry=0xffffe5366260, 
    c=c@entry=0xffffe5366278, 
    d=d@entry=0xffffe5366218)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_div.c:146
#3  0x0000ffffa8c3b554 in ShorteningBignumConversion (endPtr=0xffffe5366318, decpt=0xffffe5366310, 
    ilim1=<optimized out>, ilim=<optimized out>, 
    len=<optimized out>, k=<optimized out>, 
    s5=50, s2=<optimized out>, m2minus=63, 
    m2plus=63, b2=<optimized out>, 
    bw=<optimized out>, dPtr=<synthetic pointer>)
    at /home/purism/Downloads/release.tcl/generic/tclStrToD.c:3976
#4  TclDoubleDigits (dv=1.0000000000000001e+50, 
[?2004h--Type <RET> for more, q to quit, c to continue without paging--
[?2004l
    ndigits=<optimized out>, ndigits@entry=-1, 
    flags=flags@entry=4, 
    decpt=decpt@entry=0xffffe5366310, 
    sign=sign@entry=0xffffe5366314, 
    endPtr=endPtr@entry=0xffffe5366318)
    at /home/purism/Downloads/release.tcl/generic/tclStrToD.c:4539
#5  0x0000ffffa8c47c00 in Tcl_PrintDouble (
    dummy3082=dummy3082@entry=0x0, 
    value=<optimized out>, 
    dst=dst@entry=0xffffe5366390 "")
    at /home/purism/Downloads/release.tcl/generic/tclUtil.c:3123
#6  0x0000ffffa8b6e304 in UpdateStringOfArithSeries (arithSeriesObjPtr=0xaaab1990c020)
    at /home/purism/Downloads/release.tcl/generic/tclArithSeries.c:1146
#7  0x0000ffffa8c21870 in Tcl_GetStringFromObj (
    objPtr=objPtr@entry=0xaaab1990c020, 
    lengthPtr=lengthPtr@entry=0xffffe5366440)
    at /home/purism/Downloads/release.tcl/generic/tclObj.c:1733
#8  0x0000ffffa8c1bb78 in Tcl_MainEx (
    argc=<optimized out>, argc@entry=1, 
    argv=argv@entry=0xffffe53665f8, 
    appInitProc=appInitProc@entry=0xaaaade630b74 <T[?2004h--Type <RET> for more, q to quit, c to continue without paging--
[?2004l
cl_AppInit>, interp=0xaaab198bb100)
    at /home/purism/Downloads/release.tcl/generic/tclMain.c:536
#9  0x0000aaaade630a5c in main (
    argc=<optimized out>, argv=<optimized out>)
    at /home/purism/Downloads/release.tcl/unix/tclAppInit.c:94
[?2004h(gdb) 
[?2004l
[?2004h(gdb) c
[?2004l
Continuing.
^C
Program received signal SIGINT, Interrupt.
TclpAlloc (reqSize=reqSize@entry=32)
    at /home/purism/Downloads/release.tcl/generic/tclThreadAlloc.c:310
310	    GETCACHE(cachePtr);
[?2004h[?2004l
[?2004h(gdb) c
[?2004l
Continuing.
^C
Program received signal SIGINT, Interrupt.
__GI__IO_setb (f=f@entry=0xffffe53660a8, 
    b=b@entry=0xffffe5366391 "", 
    eb=eb@entry=0xffffe53663ab "\250\377\377", 
    a=a@entry=0) at genops.c:330
330	genops.c: No such file or directory.
[?2004h[?2004l
[?2004h(gdb) Quit
[?2004l
[?2004h(gdb) bt
[?2004l
#0  __GI__IO_setb (f=f@entry=0xffffe53660a8, 
    b=b@entry=0xffffe5366391 "", 
    eb=eb@entry=0xffffe53663ab "\250\377\377", 
    a=a@entry=0) at genops.c:330
#1  0x0000ffffa8a1e100 in _IO_str_init_static_internal (sf=sf@entry=0xffffe53660a8, 
    ptr=ptr@entry=0xffffe5366391 "", 
    size=size@entry=26, 
    pstart=pstart@entry=0xffffe5366391 "")
    at strops.c:46
#2  0x0000ffffa8a173a0 in __vsnprintf_internal (
    string=0xffffe5366391 "", 
    maxlen=<optimized out>, maxlen@entry=27, 
    format=format@entry=0xffffa8c9a0bf "e%+d", 
    args=..., mode_flags=mode_flags@entry=0)
    at vsnprintf.c:113
#3  0x0000ffffa89f51c4 in __GI___snprintf (
    s=<optimized out>, maxlen=maxlen@entry=27, 
    format=format@entry=0xffffa8c9a0bf "e%+d")
    at snprintf.c:31
#4  0x0000ffffa8c47c64 in Tcl_PrintDouble (
    dummy3082=dummy3082@entry=0x0, 
    value=<optimized out>, dst=<optimized out>, 
    dst@entry=0xffffe5366390 "1")
    at /home/purism/Downloads/release.tcl/generic/tclUtil.c:3144
[?2004h--Type <RET> for more, q to quit, c to continue without paging--
[?2004l
#5  0x0000ffffa8b6e304 in UpdateStringOfArithSeries (arithSeriesObjPtr=0xaaab1990c020)
    at /home/purism/Downloads/release.tcl/generic/tclArithSeries.c:1146
#6  0x0000ffffa8c21870 in Tcl_GetStringFromObj (
    objPtr=objPtr@entry=0xaaab1990c020, 
    lengthPtr=lengthPtr@entry=0xffffe5366440)
    at /home/purism/Downloads/release.tcl/generic/tclObj.c:1733
#7  0x0000ffffa8c1bb78 in Tcl_MainEx (
    argc=<optimized out>, argc@entry=1, 
    argv=argv@entry=0xffffe53665f8, 
    appInitProc=appInitProc@entry=0xaaaade630b74 <Tcl_AppInit>, interp=0xaaab198bb100)
    at /home/purism/Downloads/release.tcl/generic/tclMain.c:536
#8  0x0000aaaade630a5c in main (
    argc=<optimized out>, argv=<optimized out>)
    at /home/purism/Downloads/release.tcl/unix/tclAppInit.c:94
[?2004h(gdb) 
[?2004l
[?2004h(gdb) 
[?2004l
[?2004h(gdb) c
[?2004l
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x0000ffffa8c76318 in TclBN_mp_mul_digs_fast (
    a=0xffffe5366260, b=0xffffa8ce98e8 <pow5_13>, 
    c=0xffffe5366260, digs=3)
    at /home/purism/Downloads/release.tcl/libtommath/bn_s_mp_mul_digs_fast.c:41
41	   pa = MP_MIN(digs, a->used + b->used);
[?2004h[?2004l
[?2004h(gdb) bt
[?2004l
#0  0x0000ffffa8c76318 in TclBN_mp_mul_digs_fast (
    a=0xffffe5366260, b=0xffffa8ce98e8 <pow5_13>, 
    c=0xffffe5366260, digs=3)
    at /home/purism/Downloads/release.tcl/libtommath/bn_s_mp_mul_digs_fast.c:41
#1  0x0000ffffa8c785c4 in TclBN_mp_mul (
    a=<optimized out>, 
    b=b@entry=0xffffa8ce98e8 <pow5_13>, 
    c=c@entry=0xffffe5366260)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_mul.c:45
#2  0x0000ffffa8c3a660 in MulPow5 (
    base=base@entry=0xffffe5366260, n=n@entry=50, 
    result=result@entry=0xffffe5366260)
    at /home/purism/Downloads/release.tcl/generic/tclStrToD.c:2236
#3  0x0000ffffa8c3b444 in ShorteningBignumConversion (endPtr=0xffffe5366318, decpt=0xffffe5366310, 
    ilim1=-1, ilim=-1, len=<optimized out>, 
    k=<optimized out>, s5=50, s2=0, m2minus=63, 
    m2plus=63, b2=<optimized out>, 
    bw=<optimized out>, dPtr=<synthetic pointer>)
    at /home/purism/Downloads/release.tcl/generic/tclStrToD.c:3933
#4  TclDoubleDigits (dv=1.0000000000000001e+50, 
    ndigits=<optimized out>, ndigits@entry=-1, 
[?2004h--Type <RET> for more, q to quit, c to continue without paging--
[?2004l
    flags=flags@entry=4, 
    decpt=decpt@entry=0xffffe5366310, 
    sign=sign@entry=0xffffe5366314, 
    endPtr=endPtr@entry=0xffffe5366318)
    at /home/purism/Downloads/release.tcl/generic/tclStrToD.c:4539
#5  0x0000ffffa8c47c00 in Tcl_PrintDouble (
    dummy3082=dummy3082@entry=0x0, 
    value=<optimized out>, 
    dst=dst@entry=0xffffe5366390 "")
    at /home/purism/Downloads/release.tcl/generic/tclUtil.c:3123
#6  0x0000ffffa8b6e304 in UpdateStringOfArithSeries (arithSeriesObjPtr=0xaaab1990c020)
    at /home/purism/Downloads/release.tcl/generic/tclArithSeries.c:1146
#7  0x0000ffffa8c21870 in Tcl_GetStringFromObj (
    objPtr=objPtr@entry=0xaaab1990c020, 
    lengthPtr=lengthPtr@entry=0xffffe5366440)
    at /home/purism/Downloads/release.tcl/generic/tclObj.c:1733
#8  0x0000ffffa8c1bb78 in Tcl_MainEx (
    argc=<optimized out>, argc@entry=1, 
    argv=argv@entry=0xffffe53665f8, 
    appInitProc=appInitProc@entry=0xaaaade630b74 <Tcl_AppInit>, interp=0xaaab198bb100)
[?2004h--Type <RET> for more, q to quit, c to continue without paging--
[?2004l
    at /home/purism/Downloads/release.tcl/generic/tclMain.c:536
#9  0x0000aaaade630a5c in main (
    argc=<optimized out>, argv=<optimized out>)
    at /home/purism/Downloads/release.tcl/unix/tclAppInit.c:94
[?2004h(gdb) c
[?2004l
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x0000ffffa8c774a0 in TclBN_mp_div_2d (
    a=a@entry=0xffffe5366060, b=b@entry=2, 
    c=c@entry=0xffffe5366060, d=d@entry=0x0)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_div_2d.c:70
70	}
[?2004h[?2004l
[?2004h(gdb) bt
[?2004l
#0  0x0000ffffa8c774a0 in TclBN_mp_div_2d (
    a=a@entry=0xffffe5366060, b=b@entry=2, 
    c=c@entry=0xffffe5366060, d=d@entry=0x0)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_div_2d.c:70
#1  0x0000ffffa8c76f10 in TclBN_mp_div (
    a=a@entry=0xffffe5366218, 
    b=b@entry=0xffffe5366260, 
    c=c@entry=0xffffe5366278, 
    d=d@entry=0xffffe5366218)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_div.c:229
#2  0x0000ffffa8c3b554 in ShorteningBignumConversion (endPtr=0xffffe5366318, decpt=0xffffe5366310, 
    ilim1=<optimized out>, ilim=<optimized out>, 
    len=<optimized out>, k=<optimized out>, 
    s5=50, s2=<optimized out>, m2minus=63, 
    m2plus=63, b2=<optimized out>, 
    bw=<optimized out>, dPtr=<synthetic pointer>)
    at /home/purism/Downloads/release.tcl/generic/tclStrToD.c:3976
#3  TclDoubleDigits (dv=1.0000000000000001e+50, 
    ndigits=<optimized out>, ndigits@entry=-1, 
    flags=flags@entry=4, 
    decpt=decpt@entry=0xffffe5366310, 
    sign=sign@entry=0xffffe5366314, 
[?2004h--Type <RET> for more, q to quit, c to continue without paging--
[?2004l
    endPtr=endPtr@entry=0xffffe5366318)
    at /home/purism/Downloads/release.tcl/generic/tclStrToD.c:4539
#4  0x0000ffffa8c47c00 in Tcl_PrintDouble (
    dummy3082=dummy3082@entry=0x0, 
    value=<optimized out>, 
    dst=dst@entry=0xffffe5366390 "")
    at /home/purism/Downloads/release.tcl/generic/tclUtil.c:3123
#5  0x0000ffffa8b6e304 in UpdateStringOfArithSeries (arithSeriesObjPtr=0xaaab1990c020)
    at /home/purism/Downloads/release.tcl/generic/tclArithSeries.c:1146
#6  0x0000ffffa8c21870 in Tcl_GetStringFromObj (
    objPtr=objPtr@entry=0xaaab1990c020, 
    lengthPtr=lengthPtr@entry=0xffffe5366440)
    at /home/purism/Downloads/release.tcl/generic/tclObj.c:1733
#7  0x0000ffffa8c1bb78 in Tcl_MainEx (
    argc=<optimized out>, argc@entry=1, 
    argv=argv@entry=0xffffe53665f8, 
    appInitProc=appInitProc@entry=0xaaaade630b74 <Tcl_AppInit>, interp=0xaaab198bb100)
    at /home/purism/Downloads/release.tcl/generic/tclMain.c:536
#8  0x0000aaaade630a5c in main (
[?2004h--Type <RET> for more, q to quit, c to continue without paging--
[?2004l
    argc=<optimized out>, argv=<optimized out>)
    at /home/purism/Downloads/release.tcl/unix/tclAppInit.c:94
[?2004h(gdb) 
[?2004l
[?2004h(gdb) c
[?2004l
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x0000ffffa8c77838 in TclBN_mp_init (
    a=a@entry=0xffffe5366218)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_init.c:19
19	   a->sign  = MP_ZPOS;
[?2004h[?2004l
[?2004h(gdb) bt
[?2004l
#0  0x0000ffffa8c77838 in TclBN_mp_init (
    a=a@entry=0xffffe5366218)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_init.c:19
#1  0x0000ffffa8c77dcc in TclBN_mp_init_u64 (
    a=a@entry=0xffffe5366218, 
    b=b@entry=2407412430484045)
    at /home/purism/Downloads/release.tcl/libtommath/bn_mp_init_u64.c:6
#2  0x0000ffffa8c3b404 in ShorteningBignumConversion (endPtr=0xffffe5366318, decpt=0xffffe5366310, 
    ilim1=-1, ilim=-1, len=<optimized out>, 
    k=<optimized out>, s5=50, s2=0, m2minus=63, 
    m2plus=63, b2=65, bw=2407412430484045, 
    dPtr=<synthetic pointer>)
    at /home/purism/Downloads/release.tcl/generic/tclStrToD.c:3925
#3  TclDoubleDigits (dv=1.0000000000000001e+50, 
    ndigits=<optimized out>, ndigits@entry=-1, 
    flags=flags@entry=4, 
    decpt=decpt@entry=0xffffe5366310, 
    sign=sign@entry=0xffffe5366314, 
    endPtr=endPtr@entry=0xffffe5366318)
    at /home/purism/Downloads/release.tcl/generic/tclStrToD.c:4539
#4  0x0000ffffa8c47c00 in Tcl_PrintDouble (
[?2004h--Type <RET> for more, q to quit, c to continue without paging--
[?2004l
    dummy3082=dummy3082@entry=0x0, 
    value=<optimized out>, 
    dst=dst@entry=0xffffe5366390 "")
    at /home/purism/Downloads/release.tcl/generic/tclUtil.c:3123
#5  0x0000ffffa8b6e304 in UpdateStringOfArithSeries (arithSeriesObjPtr=0xaaab1990c020)
    at /home/purism/Downloads/release.tcl/generic/tclArithSeries.c:1146
#6  0x0000ffffa8c21870 in Tcl_GetStringFromObj (
    objPtr=objPtr@entry=0xaaab1990c020, 
    lengthPtr=lengthPtr@entry=0xffffe5366440)
    at /home/purism/Downloads/release.tcl/generic/tclObj.c:1733
#7  0x0000ffffa8c1bb78 in Tcl_MainEx (
    argc=<optimized out>, argc@entry=1, 
    argv=argv@entry=0xffffe53665f8, 
    appInitProc=appInitProc@entry=0xaaaade630b74 <Tcl_AppInit>, interp=0xaaab198bb100)
    at /home/purism/Downloads/release.tcl/generic/tclMain.c:536
#8  0x0000aaaade630a5c in main (
    argc=<optimized out>, argv=<optimized out>)
    at /home/purism/Downloads/release.tcl/unix/tclAppInit.c:94


i got a partial screenshot of another one but couldn't get it above
0x0000ffffa8c78888 in TclBN_mp_mul_d ( a=a@entry=0xffffe5366260, b=48828125,c=c@entry=0xffffe5366260 at /home/purism/Downloads/release.tcl//libtommath/bn_mp_mul_d.c:42
*tmpc++=(mp_digit)(r& (mp_word)MP_MASK);

bt


#0 0x0000ffffa8c78888 in TclBN_mp_mul_d ( a=a@entry=0xffffe5366260, b=48828125,c=c@entry=0xffffe5366260 )  at /home/purism/Downloads/release.tcl//libtommath/bn_mp_mul_d.c:42
#1 0x0000ffffa8c3a5f4 in MulPow5 (base=base@entry=0xffffe5366260,n=n@entry=50, (truncated)

anonymous added on 2024-12-18 18:59:01:
I can confirm the hang of test lseq-1.27 on the following system using "-Os" compiler flag:

Linux debian 6.1.0-25-arm64 #1 SMP Debian 6.1.106-3 (2024-08-26) aarch64 GNU/Linux
gcc (Debian 12.2.0-14) 12.2.0 

Using default "-O2" flag, the tests run fine.

If the tests performed by Ashok were executed on x86_64 architecture, I suspect it could be an ARM specific compiler bug.

Paul

griffin added on 2024-12-18 18:53:06:

Can you attach gdb to the hung process, and get a traceback to show where in the code it is hung?

This will require configuring with --enable-symbols (i.e. building with CFLAGS += -g)

Check that using --enable-symbols doesn't cause it to suddenly work correctly.


anonymous added on 2024-12-18 17:48:13:
lseq        1e50           {1e50+1}   

also hung

lseq [expr {1e50+0} [expr {1e50+1}] 1]

also hung(that was a typo)

lseq       {1e50+0}        {1e50+1} 

also hung(that was a typo)

lseq [expr {1e50+0}] [expr {1e50+1}] 1 

did not hang

lseq       {1e50+0}        {1e50+1} 1

did not hang

lseq [expr {1e50+0}] count 1 1 

did not hang(and outputted 1e+50)

lseq {1e50+0} count 1 1 
did not hang  (and outputted 1e+50)

anonymous added on 2024-12-18 17:26:28:
i used trace with make to see what variables were being defined:

make --trace test TESTFLAGS="-f lseq.test -verbose t -match lseq-1.27 "

LD_LIBRARY_PATH=`pwd`
TCLLIBPATH="/home/purism/Downloads/release.tcl/unix/pkgs"
TCL_LIBRARY=""
./tcltest /home/purism/Downloads/release.tcl/tests/all.tcl -f lseq.test -verbose t match lseq-1.27

which is a little weird, and didn't work when i tried to run tclsh to run lseq  since pkgs isn't in the unix directory it's in the release.tcl directory (?) but even when i set TCLLIBPATH to be /home/purism/Downloads/release.tcl/pkgs (ie where pkgs actually was)

this allowed me to run ./tclsh 
but then
% lseq 1e50 [expr {1e50+1}] 

hung

anonymous added on 2024-12-18 16:52:34:
echo $CFLAGS: -Os

when run with  make test TESTFLAGS="-f lseq.test -verbose t -match lseq-$N"

lseq-1.26 finishes OK

lseq-1.27 hangs:
Running tests that match: lseq-1.27 
Skipping tests that match: l*.test
Only running test fils that match: lseq.test
Test began at Wed Dec 18 10:49:57 CST 2024
lseq.test
---- lseq-1.27 start

and then it hangs there

griffin added on 2024-12-18 15:30:22:

This is a cell phone device built on open source. It's possible that the linux OS was built with additional optimizations, such as -Os, as well, which could affect the behavior of the libraries.

Pure speculation on my part, unencumbered by any facts: lseq does rely on rounding in places. If the rounding of a value goes wrong, it might be possible get into an infinite loop.

This probably requires debugging in the pureos 10 operating system rather than a generic Debian.


apnadkarni added on 2024-12-18 02:26:47:

That is what I tried (I presume you meant -Os and not -s) but did not see any failures with gcc 9.4 or gcc 11.4. Perusing the code did not show anything obvious. The test body is

    list [lseq        1e50     [expr {1e50+1}]  ] \
	 [lseq        1e50           {1e50+1}   ] \
	 [lseq [expr {1e50+0}] [expr {1e50+1}] 1] \
	 [lseq       {1e50+0}        {1e50+1}  1] \
	 [lseq [expr {1e50+0}] count 1 1] \
	 [lseq       {1e50+0}  count 1 1]

Could you try one more run with

make test TESTFLAGS="-f lseq.test -verbose t -match lseq-1.27"

If that fails by itself, it is likely it is something in that test and not the consequence of some earlier test. In which case, could you then try each of those lseq commands in the test body above in turn to see which (if any) hang?


anonymous (claiming to be [email protected]) added on 2024-12-17 13:21:08:
Please post your            `configure` line 

# export CFLAGS="-s"
# ./configure

# make test TESTFLAGS="-f lseq.test -verbose t"  

gets up to

---- lseq-1.27 start

and then stops there.

apnadkarni added on 2024-12-17 02:33:03:

Not able to reproduce on Ubuntu 20/gcc 9.4. Please post your configure line and output of

make test TESTFLAGS="-f lseq.test -verbose t"

to see which test is hanging.