Summary

Panic on "invalid encoded numeric literal" error on 64-bit Windows

Metadata

Description

64-bit builds on Windows (MinGW/MSYS) fail on the lolevel tests with the error "invalid encoded numeric literal".

MSYS2:

 "C:/MSYS264/home/evhan/chicken-4.12.0rc1-mingw-msys-x86-64/tests/../chicken "lolevel-tests.scm" -output-file "a.c" -types ../types.db -ignore-repository -verbose -include-path C:/MSYS264/home/evhan/chicken-4.12.0rc1-mingw-msys-x86-64/tests/.. -specialize"
 ""gcc" "a.c" -o "a.o" -c  -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -Os -IC:/MSYS264/home/evhan/chicken-4.12.0rc1-mingw-msys-x86-64/tests/.. -IC:/MSYS264/usr/local/chicken-4.12.0rc1-mingw-msys-x86-64/include/chicken"
 rm a.c
 ""gcc" "a.o" -o "a.out" -Wl,--enable-auto-import -LC:/MSYS264/home/evhan/chicken-4.12.0rc1-mingw-msys-x86-64/tests/.. -LC:/MSYS264/usr/local/chicken-4.12.0rc1-mingw-msys-x86-64/lib -lchicken -lm -lws2_32"
 rm a.o
 [panic] invalid encoded numeric literal - execution terminated
 
 make: *** [rules.make:663: check] Error 1

And MinGW:

 ""gcc" "a.c" -o "a.o" -c  -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -Os -IC:\\Users\\evhan\\Downloads\\chicken-4.12.0rc1-mingw-x86-64\\tests/.. -IC:/mingw-w64/usr/local/chicken-4.12.0rc1-mingw-x86-64/include/chicken"
 rm a.c
 ""gcc" "a.o" -o "a.out" -Wl,--enable-auto-import -LC:\Users\evhan\Downloads\chicken-4.12.0rc1-mingw-x86-64\tests/.. -LC:/mingw-w64/usr/local/chicken-4.12.0rc1-mingw-x86-64/lib -lchicken -lm -lws2_32"
 rm a.o
 [panic] invalid encoded numeric literal - execution terminated
 
 .\rules.make:665: recipe for target 'check' failed
 mingw32-make: *** [check] Error 1

This was observed on an x86-64 Windows 7 VM. Cygwin and 32-bit MinGW builds are unaffected.

Changes and comments

[2017-02-01 10:08:10 UTC] evhan changed description

[2017-02-01 21:26:11 UTC] evhan changed milestone from someday to 4.13.0

[2017-02-01 21:26:11 UTC] evhan wrote:

This is not new in 4.12.0rc1 (4.11.0 exhibits the same behaviour), so I don't think it should block the release.

[2017-02-15 15:53:23 UTC] kooda wrote:

I’ve been investigating this issue and big-fixnum literals seem to be wrongly generated indeed.

A “f” character is appended to all of them.

The code that generates these literals is in c-backend.scm line 1420.

 (string-append "\x55" (number->string lit) "\x00")

What I don’t understand is that number->string works fine in csi!

[2017-02-27 14:37:18 UTC] LemonBoy wrote:

I've finally found some time to solve this riddle.

[2017-02-27 16:10:41 UTC] kooda changed status from new to closed

[2017-02-27 16:10:41 UTC] kooda set resolution to fixed

[2017-02-27 16:10:41 UTC] kooda wrote:

Fixed by 686545750874d31fac022e0f9d5be75b0edd2a77

Thanks a lot!