https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122330
Bug ID: 122330
Summary: algol68/compile/error-coercion-2.a68 FAILs with
-D_FORTIFY_SOURCE=3
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Keywords: testsuite-fail
Severity: normal
Priority: P3
Component: algol68
Assignee: algol68 at gcc dot gnu.org
Reporter: sjames at gcc dot gnu.org
Target Milestone: ---
I'm looking at test failures in packaging from wiring up algol68. It looks
pretty good but there's a few failures. I'll look into the others, but here's
one for now.
It requires GCC to be built with -D_FORTIFY_SOURCE=N, I tested with N=3.
```
$ /usr/libexec/gcc/x86_64-pc-linux-gnu/16/a681
algol68/compile/error-coercion-2.a68 -fstropping=upper
*** buffer overflow detected ***: terminated
a681: internal compiler error: Aborted
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See <https://bugs.gentoo.org/> for instructions.
```
```
#0 __pthread_kill_implementation (threadid=<optimized out>, signo=6, no_tid=0)
at pthread_kill.c:44
#1 __pthread_kill_internal (threadid=<optimized out>, signo=6) at
pthread_kill.c:89
#2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at
pthread_kill.c:100
#3 0x00007ffff7420fe2 in __GI_raise (sig=sig@entry=6) at
../sysdeps/posix/raise.c:26
#4 0x00007ffff74013a1 in __GI_abort () at abort.c:77
#5 0x00007ffff74025b2 in __libc_message_impl (fmt=fmt@entry=0x7ffff75e3808
"*** %s ***: terminated\n") at ../sysdeps/posix/libc_fatal.c:138
#6 0x00007ffff752e0f7 in __GI___fortify_fail (msg=msg@entry=0x7ffff75e37ef
"buffer overflow detected") at fortify_fail.c:24
#7 0x00007ffff752da52 in __GI___chk_fail () at chk_fail.c:28
#8 0x00007ffff752f2d5 in ___snprintf_chk (s=<optimized out>,
maxlen=maxlen@entry=1023, flag=flag@entry=2, slen=<optimized out>,
format=format@entry=0x5555585218ba " and ")
at snprintf_chk.c:29
#9 0x0000555557efc929 in snprintf (__s=<optimized out>, __n=1023,
__fmt=0x5555585218ba " and ") at /usr/include/bits/stdio2.h:68
#10 a68_mode_error_text (n=0x55555945fe60, p=<optimized out>, q=0x5555594be7f0,
context=305, deflex=2, depth=<optimized out>)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-moids-diagnostics.cc:159
#11 0x0000555557f24517 in a68_cannot_coerce (p=0x55555945fe60, from=<optimized
out>, to=<optimized out>, context=305, deflex=2, att=326)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-moids-diagnostics.cc:219
#12 mode_check_identity_declaration (p=<optimized out>) at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:178
#13 0x0000555557f25221 in mode_check_serial (r=r@entry=0x7fffffffc3b0,
p=<optimized out>, x=x@entry=0x7fffffffd100, k=k@entry=true)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:360
#14 0x0000555557f2540e in mode_check_serial_units (p=p@entry=0x55555945f430,
x=x@entry=0x7fffffffd100, y=y@entry=0x7fffffffc9f0, att=283)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:412
#15 0x0000555557f25623 in mode_check_closed (p=0x55555945f430,
x=0x7fffffffd100, y=0x7fffffffc9f0)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:668
#16 mode_check_closed (p=0x5555594bd7a0, x=0x7fffffffd100,
y=y@entry=0x7fffffffc9f0) at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:670
#17 0x0000555557f26ffc in mode_check_enclosed (p=0x5555594bd850,
x=x@entry=0x7fffffffd100, y=y@entry=0x7fffffffc9f0)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:851
#18 0x0000555557f228af in mode_check_unit (p=0x5555594bd900,
x=x@entry=0x7fffffffd100, y=y@entry=0x7fffffffc9f0)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:1746
#19 0x0000555557f22294 in mode_check_unit (p=<optimized out>, x=<optimized
out>, y=0x7fffffffc9f0)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:1698
#20 mode_check_unit (p=0x5555594bd9b0, x=x@entry=0x7fffffffd100,
y=y@entry=0x7fffffffc9f0)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:1701
#21 0x0000555557f22294 in mode_check_unit (p=<optimized out>, x=<optimized
out>, y=0x7fffffffc9f0)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:1698
#22 mode_check_unit (p=0x5555594bda60, x=x@entry=0x7fffffffd100,
y=y@entry=0x7fffffffc9f0)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:1701
#23 0x0000555557f22294 in mode_check_unit (p=<optimized out>, x=<optimized
out>, y=0x7fffffffc9f0)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:1698
#24 mode_check_unit (p=0x5555594bdb10, x=x@entry=0x7fffffffd100,
y=y@entry=0x7fffffffc9f0)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:1701
#25 0x0000555557f22294 in mode_check_unit (p=<optimized out>, x=<optimized
out>, y=0x7fffffffc9f0)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:1698
#26 mode_check_unit (p=p@entry=0x5555594bdbc0, x=x@entry=0x7fffffffd100,
y=y@entry=0x7fffffffc9f0)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:1701
#27 0x0000555557f252d5 in mode_check_unit (p=0x5555594bdbc0, x=0x7fffffffd100,
y=0x7fffffffc9f0)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:386
#28 mode_check_serial (r=r@entry=0x7fffffffca90, p=<optimized out>,
x=x@entry=0x7fffffffd100, k=k@entry=true)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:387
#29 0x0000555557f2540e in mode_check_serial_units (p=p@entry=0x55555945f360,
x=x@entry=0x7fffffffd100, y=y@entry=0x7fffffffd0d0, att=283)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:412
#30 0x0000555557f25623 in mode_check_closed (p=0x55555945f360,
x=0x7fffffffd100, y=0x7fffffffd0d0)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:668
#31 mode_check_closed (p=0x5555594bdc70, x=0x7fffffffd100,
y=y@entry=0x7fffffffd0d0) at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:670
#32 0x0000555557f26ffc in mode_check_enclosed (p=0x5555594bde80,
x=x@entry=0x7fffffffd100, y=y@entry=0x7fffffffd0d0)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:851
#33 0x0000555557f228af in mode_check_unit (p=0x5555594bdf30,
x=x@entry=0x7fffffffd100, y=y@entry=0x7fffffffd0d0)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:1746
#34 0x0000555557f22294 in mode_check_unit (p=<optimized out>, x=<optimized
out>, y=0x7fffffffd0d0)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:1698
#35 mode_check_unit (p=0x5555594bdfe0, x=x@entry=0x7fffffffd100,
y=y@entry=0x7fffffffd0d0)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:1701
#36 0x0000555557f22294 in mode_check_unit (p=<optimized out>, x=<optimized
out>, y=0x7fffffffd0d0)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:1698
#37 mode_check_unit (p=0x5555594be090, x=x@entry=0x7fffffffd100,
y=y@entry=0x7fffffffd0d0)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:1701
#38 0x0000555557f22294 in mode_check_unit (p=<optimized out>, x=<optimized
out>, y=0x7fffffffd0d0)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:1698
#39 mode_check_unit (p=0x5555594be140, x=x@entry=0x7fffffffd100,
y=y@entry=0x7fffffffd0d0)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:1701
#40 0x0000555557f22294 in mode_check_unit (p=<optimized out>, x=<optimized
out>, y=0x7fffffffd0d0)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:1698
#41 mode_check_unit (p=p@entry=0x5555594be350, x=x@entry=0x7fffffffd100,
y=y@entry=0x7fffffffd0d0)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:1701
#42 0x0000555557f2532c in mode_check_unit (p=0x5555594be350, x=0x7fffffffd100,
y=0x7fffffffd0d0)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-moids-misc.cc:188
#43 mode_check_serial (r=r@entry=0x7fffffffd200, p=<optimized out>,
x=x@entry=0x7fffffffd300, k=k@entry=false)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:392
#44 0x0000555557f2527d in mode_check_serial (r=r@entry=0x7fffffffd200,
p=<optimized out>, x=x@entry=0x7fffffffd300, k=k@entry=true)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:374
#45 0x0000555557f2540e in mode_check_serial_units (p=p@entry=0x55555945f1c0,
x=x@entry=0x7fffffffd300, y=y@entry=0x7fffffffd330, att=283)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:412
#46 0x0000555557f25623 in mode_check_closed (p=0x55555945f1c0,
x=0x7fffffffd300, y=0x7fffffffd330)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:668
#47 mode_check_closed (p=0x5555594be4b0, x=0x7fffffffd300,
y=y@entry=0x7fffffffd330) at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:670
#48 0x0000555557f26ffc in mode_check_enclosed (p=0x5555594be560, x=<optimized
out>, y=y@entry=0x7fffffffd330)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:851
#49 0x0000555557f26cac in mode_check_enclosed (p=0x5555594be610, x=<optimized
out>, y=0x7fffffffd330)
at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:849
#50 0x0000555557f0cfc4 in a68_mode_checker (p=0x55555945f0f0) at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:112
#51 a68_mode_checker (p=0x55555945f0f0) at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser-moids-check.cc:105
#52 a68_parser (filename=<optimized out>) at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-parser.cc:547
#53 0x0000555557ee9419 in a68_parse_file () at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/algol68/a68-lang.cc:618
#54 0x0000555557c8c847 in compile_file () at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/toplev.cc:453
#55 0x0000555557c7895e in do_compile () at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/toplev.cc:2220
#56 0x0000555557c59ad6 in toplev::main (this=this@entry=0x7fffffffd606,
argc=<optimized out>, argv=<optimized out>)
at /usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/toplev.cc:2383
#57 0x0000555557c58849 in main (argc=<optimized out>, argv=<optimized out>) at
/usr/src/debug/sys-devel/gcc-16.0.9999/gcc-16.0.9999/gcc/main.cc:39
```
```
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/16/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/16
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/16/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/16
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/16/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/16/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/16/include/g++-v16
--disable-silent-rules --disable-dependency-tracking
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/16/python
--enable-libphobos --enable-objc-gc
--enable-languages=c,c++,d,objc,obj-c++,fortran,ada,cobol,algol68,m2,rust,jit
--enable-obsolete --enable-secureplt --disable-werror --with-system-zlib
--enable-nls --without-included-gettext --disable-libunwind-exceptions
--enable-checking=yes,extra,rtl --with-bugurl=https://bugs.gentoo.org/
--with-pkgversion='Gentoo Hardened 16.0.9999 p, commit
67c6ba80620febd358e1ec757b2a8a17a4f62acf' --with-gcc-major-version-only
--enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
--enable-multilib --with-multilib-list=m32,mx32,m64 --disable-fixed-point
--with-abi=m64 --enable-targets=all --enable-offload-defaulted
--enable-offload-targets=nvptx-none --enable-libgomp --disable-libssp
--enable-libada --disable-cet --enable-systemtap --enable-valgrind-annotations
--disable-vtable-verify --disable-libvtv --with-zstd --with-isl
--disable-isl-version-check --enable-default-pie --enable-host-pie
--enable-host-bind-now --enable-default-ssp --disable-fixincludes
--with-gxx-libcxx-include-dir=/usr/include/c++/v1 --enable-host-shared
--enable-libgdiagnostics --enable-linker-build-id
--with-build-config='bootstrap-O3 bootstrap-lto'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.0 20251018 (experimental)
515045254f5dbdea5208035a0352acc12c381088 (Gentoo Hardened 16.0.9999 p, commit
67c6ba80620febd358e1ec757b2a8a17a4f62acf)
```