Thanks!

It looks like this happens only with -O3, so most users won't run into
it (with the default -O2).


I see that changing the declaration

  uptr vspace_offsets[vspaces_count+1];

to

  uptr vspace_offsets[2*vspaces_count+1];

makes the error go away, but I don't know whether it's just a bug in
array-bounds checking (in which case extending the array size should be
harmless) or reflects a miscompilation (in which case extending the
array size just masks a problem).

At Wed, 5 Jun 2019 15:04:10 +0200, "'Paulo Matos' via Racket Developers" wrote:
> Hi,
> 
> This is just to let you know of a GCC bug in GCC7.4.0 (default in Ubuntu
> 18.04 LTS) when compiling racketcs.
> 
> GCC complains about
> vfasl.c:358:134: error: array subscript is above array bounds
> [-Werror=array-bounds]
> 
> on vfasl.c of Chez sources. However, this is a false positive fixed on
> more recent GCC versions. On ubuntu 18.04:
> racket/racket/src/ChezScheme/ta6le/c$ apt-get install -y gcc-8
> racket/racket/src/ChezScheme/ta6le/c$ gcc  -m64 -msse2 -Wpointer-arith
> -Wall -Wextra -Werror -Wno-implicit-fallthrough -O2 -D_REENTRANT
> -pthread -march=native -O3 -Wall -DELF_FIND_BOOT_SECTION -pthread -c
> -DX86_64 -I../boot/ta6le -I../zlib -I../lz4/lib vfasl.c
> vfasl.c: In function ‘S_vfasl’:
> vfasl.c:352:134: error: array subscript is above array bounds
> [-Werror=array-bounds]
>        MAYBE_FIXUP(0);
> ...
> cc1: all warnings being treated as errors
> racket/racket/src/ChezScheme/ta6le/c$ gcc-8  -m64 -msse2 -Wpointer-arith
> -Wall -Wextra -Werror -Wno-implicit-fallthrough -O2 -D_REENTRANT
> -pthread -march=native -O3 -Wall -DELF_FIND_BOOT_SECTION -pthread -c
> -DX86_64 -I../boot/ta6le -I../zlib -I../lz4/lib vfasl.c
> $
> 
> The broken gcc version:
> $ gcc --version
> gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0
> Copyright (C) 2017 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
> Fixed:
> $ gcc-8 --version
> gcc-8 (Ubuntu 8.3.0-6ubuntu1~18.04) 8.3.0
> Copyright (C) 2018 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
> The might have come in long before 8.3.0 but I haven't run further
> tests. This is relevant to know because the bug is in the default GCC
> for Ubuntu LTS.
> 
> If I find more, I will let you know.
> 
> Regards,
> -- 
> Paulo Matos
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-dev/72642853-8f01-61a3-033d-b38be5e712
> 07%40linki.tools.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-dev/5cf7c201.1c69fb81.da9c.267fSMTPIN_ADDED_MISSING%40gmr-mx.google.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to