[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: #1847: integer overflow when running 6.0.0pre1 tests (2)
From: |
Chicken Trac |
Subject: |
Re: #1847: integer overflow when running 6.0.0pre1 tests (2) |
Date: |
Thu, 30 Jan 2025 10:59:36 -0000 |
#1847: integer overflow when running 6.0.0pre1 tests (2)
--------------------------------+---------------------
Reporter: Erica Z | Owner: (none)
Type: defect | Status: new
Priority: major | Milestone: someday
Component: unknown | Version: 6.0.0
Resolution: | Keywords:
Estimated difficulty: medium |
--------------------------------+---------------------
Comment (by Erica Z):
working on an extracted `chicken-6.0.0pre1.tar.gz`, having only applied my
patch in https://bugs.call-cc.org/ticket/1846:
{{{
$ CC=clang CFLAGS="-fsanitize=signed-integer-overflow,integer-divide-by-
zero" ./configure
$ LINKER_OPTIONS="-fsanitize=signed-integer-overflow,integer-divide-by-
zero" make check -j16
}}}
apparently it works if the same flag is passed to both the compiler and
the linker! and for the record, here's the output of the compiler tests:
{{{
'/tmp/chicken-6.0.0pre1/chicken' 'compiler-tests.scm' '-output-file' 'a.c'
'-verbose' '-include-path' '/tmp/chicken-6.0.0pre1' '-consult-types-file'
'../types.db' '-ignore-repository'
Warning: (compiler-tests.scm:218) - assignment to imported value binding
`foo'
Warning: Wrong number of arguments
In file `compiler-tests.scm:10',
In procedure `foo',
In procedure call:
(bar 2)
Procedure `bar' is called with 1 argument but 0 arguments are expected.
Procedure `bar' has this type:
(-> fixnum)
Note: Test is always true
At the toplevel,
In conditional expression:
(if g2242 (##sys#make-c-string (##sys#foreign-string-argument g2242))
#f)
Test condition has always true value of type:
string
Note: Test is always false
At the toplevel,
In conditional expression:
(if #f (##core#callunit repl) (##core#undefined))
Test condition is always false.
Note: Test is always true
At the toplevel,
In conditional expression:
(if #t (##core#callunit repl) (##core#undefined))
Test condition has always true value of type:
true
'clang' 'a.c' '-o' 'a.o' '-c' '-fno-strict-aliasing' '-fwrapv'
'-DHAVE_CHICKEN_CONFIG_H' '-DC_ENABLE_PTABLES' '-fsanitize=signed-integer-
overflow,integer-divide-by-zero' '-I/tmp/chicken-6.0.0pre1'
'-I/usr/local/include/chicken'
rm a.c
'clang' 'a.o' '-o' 'a.out' '-fsanitize=signed-integer-overflow,integer-
divide-by-zero' '-L/tmp/chicken-6.0.0pre1'
'-Wl,-rpath=/tmp/chicken-6.0.0pre1' '-L/tmp/chicken-6.0.0pre1'
'-Wl,-rpath=/usr/local/lib' '-l' 'chicken' '-lm' '-ldl'
rm a.o
12
12
12
12
12
bar
1 2 3
1 2 3 :1:2:3
1 2 3 /tmp/chicken-6.0.0pre1/tests/../chicken.h:2626:39: runtime error:
negation of -9223372036854775808 cannot be represented in type 'int64_t'
(aka 'long'); cast to an unsigned type to negate this value to itself
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior
/tmp/chicken-6.0.0pre1/tests/../chicken.h:2626:39
/tmp/chicken-6.0.0pre1/tests/../chicken.h:2675:24: runtime error: negation
of -9223372036854775808 cannot be represented in type 'int64_t' (aka
'long'); cast to an unsigned type to negate this value to itself
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior
/tmp/chicken-6.0.0pre1/tests/../chicken.h:2675:24
Good, unrepresentable C strings cause errors
Testing unsigned FFI type "unsigned-integer32" (32 bits):
Can hold maximum value 4294967295...
Cannot hold one more than maximum value, 4294967296...
Cannot hold -1 (any fixnum negative value)
Cannot hold -2^64 (any bignum negative value < smallest int64)
Testing signed FFI type "integer32" (32 bits):
Can hold maximum value 2147483647...
Can hold minimum value -2147483648...
Cannot hold one more than maximum value 2147483648...
Cannot hold one less than minimum value -2147483648...
Testing unsigned FFI type "unsigned-integer64" (64 bits):
Can hold maximum value 18446744073709551615...
Cannot hold one more than maximum value, 18446744073709551616...
Cannot hold -1 (any fixnum negative value)
Cannot hold -2^64 (any bignum negative value < smallest int64)
Testing signed FFI type "integer64" (64 bits):
Can hold maximum value 9223372036854775807...
Can hold minimum value -9223372036854775808...
Cannot hold one more than maximum value 9223372036854775808...
Cannot hold one less than minimum value -9223372036854775808...
Testing unsigned FFI type "unsigned-integer" (32 bits):
Can hold maximum value 4294967295...
Cannot hold one more than maximum value, 4294967296...
Cannot hold -1 (any fixnum negative value)
Cannot hold -2^64 (any bignum negative value < smallest int64)
Testing signed FFI type "integer" (32 bits):
Can hold maximum value 2147483647...
Can hold minimum value -2147483648...
Cannot hold one more than maximum value 2147483648...
Cannot hold one less than minimum value -2147483648...
Testing signed FFI type "(enum intlimits)" (32 bits):
Can hold maximum value 2147483647...
Can hold minimum value -2147483648...
Cannot hold one more than maximum value 2147483648...
Cannot hold one less than minimum value -2147483648...
Testing unsigned FFI type "unsigned-long" (64 bits):
Can hold maximum value 18446744073709551615...
Cannot hold one more than maximum value, 18446744073709551616...
Cannot hold -1 (any fixnum negative value)
Cannot hold -2^64 (any bignum negative value < smallest int64)
Testing signed FFI type
"/tmp/chicken-6.0.0pre1/tests/../chicken.h:2759:39: runtime error:
negation of -9223372036854775808 cannot be represented in type 'long';
cast to an unsigned type to negate this value to itself
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior
/tmp/chicken-6.0.0pre1/tests/../chicken.h:2759:39
long" (64 bits):
Can hold maximum value 9223372036854775807...
Can hold minimum value -9223372036854775808...
Cannot hold one more than maximum value 9223372036854775808...
Cannot hold one less than minimum value -9223372036854775808...
Testing signed FFI type "ssize_t" (64 bits):
Can hold maximum value 9223372036854775807...
Can hold minimum value -9223372036854775808...
Cannot hold one more than maximum value 9223372036854775808...
Cannot hold one less than minimum value -9223372036854775808...
Testing unsigned FFI type "size_t" (64 bits):
Can hold maximum value 18446744073709551615...
Cannot hold one more than maximum value, 18446744073709551616...
Cannot hold -1 (any fixnum negative value)
Cannot hold -2^64 (any bignum negative value < smallest int64)
2
2
}}}
--
Ticket URL: <https://bugs.call-cc.org/ticket/1847#comment:10>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.
- Re: #1847: integer overflow when running 6.0.0pre1 tests (2), Chicken Trac, 2025/01/07
- Re: #1847: integer overflow when running 6.0.0pre1 tests (2), Chicken Trac, 2025/01/14
- Re: #1847: integer overflow when running 6.0.0pre1 tests (2), Chicken Trac, 2025/01/22
- Re: #1847: integer overflow when running 6.0.0pre1 tests (2), Chicken Trac, 2025/01/23
- Re: #1847: integer overflow when running 6.0.0pre1 tests (2), Chicken Trac, 2025/01/24
- Re: #1847: integer overflow when running 6.0.0pre1 tests (2), Chicken Trac, 2025/01/28
- Re: #1847: integer overflow when running 6.0.0pre1 tests (2),
Chicken Trac <=
- Re: #1847: integer overflow when running 6.0.0pre1 tests (2), Chicken Trac, 2025/01/31
- Re: #1847: integer overflow when running 6.0.0pre1 tests (2), Chicken Trac, 2025/01/31
- Re: #1847: integer overflow when running 6.0.0pre1 tests (2), Chicken Trac, 2025/01/31