Bug#933574: chicken: FTBFS on hppa - stack exhausted running csi

2022-10-18 Thread John David Anglin
Dear Maintainer,

The stack overflows because the stack is incorrectly configured to
grow downward when in fact the stack on hppa grows upward.  When this
is fixed, build is successful:
https://buildd.debian.org/status/fetch.php?pkg=chicken=hppa=5.3.0-1=1666123017=0

Please push fix upstream and install patch if needed.

Thanks,
Dave Anglin

Index: chicken-5.3.0/Makefile.linux
===
--- chicken-5.3.0.orig/Makefile.linux
+++ chicken-5.3.0/Makefile.linux
@@ -94,7 +94,11 @@ chicken-config.h: chicken-defaults.h
 	echo "#define HAVE_ALLOCA_H 1" >>$@
 	echo "#define HAVE_ERRNO_H 1" >>$@
 	echo "#define HAVE_SYSEXITS_H 1" >>$@
+ifeq ($(ARCH),hppa)
+	echo "#define C_STACK_GROWS_DOWNWARD 0" >>$@
+else
 	echo "#define C_STACK_GROWS_DOWNWARD 1" >>$@
+endif
 ifdef GCHOOKS
 	echo "#define C_GC_HOOKS" >>$@
 endif
Index: chicken-5.3.0/config-arch.sh
===
--- chicken-5.3.0.orig/config-arch.sh
+++ chicken-5.3.0/config-arch.sh
@@ -34,6 +34,7 @@ case "`uname -m`" in
 	*) echo "ppc.sysv";;
 	esac;;
 amd64|x86_64) echo "x86-64";;
+parisc*) echo "hppa";;
 riscv*) echo "riscv";;
 *) ;;
 esac


signature.asc
Description: PGP signature


Bug#933574: chicken: FTBFS on hppa - stack exhausted running csi

2019-07-31 Thread John David Anglin
Source: chicken
Version: 4.11.0-1
Severity: normal

Dear Maintainer,

The chicken build fails here:

cd tests; sh runtests.sh
 repository search path ...
Segmentation fault
make[1]: *** [rules.make:974: check] Error 139
make[1]: Leaving directory '/<>'
dh_auto_test: make -j1 check returned exit code 2
make: *** [debian/rules:16: build-arch] Error 255
dpkg-buildpackage: error: debian/rules build-arch subprocess returned exit 
status 2

Full log is here:
https://buildd.debian.org/status/fetch.php?pkg=chicken=hppa=5.1.0-1=1563584158=0

The problem occurs running csi:

dave@mx3210:~/debian/chicken/chicken-5.1.0/tests$ gdb ../csi
GNU gdb (Debian 8.3-1) 8.3
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "hppa-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ../csi...
(gdb) set args -n -include-path 
/home/dave/debian/chicken/chicken-5.1.0/tests/.. -s rep
(gdb) r
Starting program: /home/dave/debian/chicken/chicken-5.1.0/csi -n -include-path 
/home/dave/debian/chicken/chicken-5.1.0/tests/.. -s rep

Program received signal SIGSEGV, Segmentation fault.
0xfa7c1050 in C_raise_interrupt (reason=reason@entry=255) at runtime.c:5036
5036runtime.c: No such file or directory.
(gdb) disass $pc-16,$pc+16
Dump of assembler code from 0xfa7c1040 to 0xfa7c1060:
   0xfa7c1040 :ldw 75c(r1),ret0
   0xfa7c1044 :   stw,ma r6,80(sp)
   0xfa7c1048 :   stw r5,-7c(sp)
   0xfa7c104c :   stw r4,-78(sp)
=> 0xfa7c1050 :   stw r19,-20(sp)
   0xfa7c1054 :   ldw 0(ret0),ret0
   0xfa7c1058 :   cmpib,= 0,ret0,0xfa7c109c 

   0xfa7c105c :   addil L%35800,r19,r1
End of assembler dump.
(gdb) x/x $sp-0x20
0xf92f8020: Cannot access memory at address 0xf92f8020
(gdb) bt
#0  0xfa7c1050 in C_raise_interrupt (reason=reason@entry=255) at runtime.c:5036
#1  0xfa4cfadc in f_3612 (t0=t0@entry=-114327864, t1=t1@entry=6) at eval.c:8333
#2  0xfa4cf48c in f_3599 (t0=-116032504, t1=-114327864, t2=-87161136,
t3=-115791088) at eval.c:8324
#3  0xfa4cfa5c in f_3612 (t0=t0@entry=-114327864, t1=t1@entry=6) at eval.c:8349
#4  0xfa4cf48c in f_3599 (t0=-116032504, t1=-114327864, t2=-87161136,
t3=-115791088) at eval.c:8324
#5  0xfa4cfa5c in f_3612 (t0=t0@entry=-114327864, t1=t1@entry=6) at eval.c:8349
#6  0xfa4cf48c in f_3599 (t0=-116032504, t1=-114327864, t2=-87161136,
t3=-115791088) at eval.c:8324
#7  0xfa4cfa5c in f_3612 (t0=t0@entry=-114327864, t1=t1@entry=6) at eval.c:8349
#8  0xfa4cf48c in f_3599 (t0=-116032504, t1=-114327864, t2=-87161136,
t3=-115791088) at eval.c:8324
#9  0xfa4cfa5c in f_3612 (t0=t0@entry=-114327864, t1=t1@entry=6) at eval.c:8349
#10 0xfa4cf48c in f_3599 (t0=-116032504, t1=-114327864, t2=-87161136,
t3=-115791088) at eval.c:8324
#11 0xfa4cfa5c in f_3612 (t0=t0@entry=-114327864, t1=t1@entry=6) at eval.c:8349
#12 0xfa4cf48c in f_3599 (t0=-116032504, t1=-114327864, t2=-87161136,
t3=-115791088) at eval.c:8324
#13 0xfa4cfa5c in f_3612 (t0=t0@entry=-114327864, t1=t1@entry=6) at eval.c:8349
#14 0xfa4cf48c in f_3599 (t0=-116032504, t1=-114327864, t2=-87161136,
t3=-115791088) at eval.c:8324
#15 0xfa4cfa5c in f_3612 (t0=t0@entry=-114327864, t1=t1@entry=6) at eval.c:8349
...
#969 0xfa4cf48c in f_3599 (t0=-116032504, t1=-114484408, t2=-87161136,
t3=-114484408) at eval.c:8324
#970 0xfa4cfa5c in f_3612 (t0=-114484408, t0@entry=0, t1=t1@entry=6)
at eval.c:8349
#971 0xfa4cf48c in f_3599 (t0=-116032504, t1=-114484408, t2=-87161136,
t3=-114484408) at eval.c:8324
#972 0xfa4cf654 in f_3666 (c=, av=)
--Type  for more, q to quit, c to continue without paging--
at eval.c:8502
#973 0xfa459810 in f_19927 (c=, av=0x0) at library.c:31316
#974 0xfa4a8878 in f_3634 (t0=, t1=,
t2=) at eval.c:8369
#975 0xfa4a8ac0 in f_4091 (c=, av=)
at eval.c:9534
#976 0xfa6d238c in f_4877 (c=, av=)
at expand.c:11099
#977 0xfa7a9e6c in values_continuation (c=-114484409, av=0xface06d0)
at runtime.c:7949
#978 0xfa7b1088 in C_values (c=-114484408, av=0x0) at runtime.c:7811
#979 0xfa6e8b44 in f_4548 (t0=-114486288, t1=-114486648, t2=-87161136,
t3=-114484408, t4=) at expand.c:10481

It looks like infinite recursion but maybe we need a larger stack for test.

Regards,
Dave Anglin

-- System Information:
Debian Release: bullseye/sid
  APT prefers buildd-unstable
  APT policy: (500, 'buildd-unstable'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 5.2.5+ (SMP w/4 CPU cores)