Closed GoogleCodeExporter closed 9 years ago
The bug seems to be triggered due to a too small stack size in kproc(). With 2k
more it still crashes, but adding 3k seems to do the job (the GUI appears now
and works):
diff -r c19f2eb83978 emu/port/kproc-pthreads.c
--- a/emu/port/kproc-pthreads.c Fri Jun 15 11:31:28 2012 -0400
+++ b/emu/port/kproc-pthreads.c Wed Jul 25 01:02:13 2012 +0100
@@ -159,7 +159,7 @@
if(flags & KPX11)
pthread_attr_setstacksize(&attr, 512*1024); /* could be a parameter */
else if(KSTACK > 0)
- pthread_attr_setstacksize(&attr, (KSTACK < PTHREAD_STACK_MIN?
PTHREAD_STACK_MIN: KSTACK)+1024);
+ pthread_attr_setstacksize(&attr, (KSTACK < PTHREAD_STACK_MIN?
PTHREAD_STACK_MIN: KSTACK)+4096);
pthread_attr_setinheritsched(&attr, PTHREAD_INHERIT_SCHED);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
if(pthread_create(&thread, &attr, tramp, p))
This makes Inferno run on the Raspberry Pi.
Original comment by chneukir...@gmail.com
on 25 Jul 2012 at 12:02
It might be better to change KSTACK in Linux/arm/include/emu.h. The 1024 is
just a little slop for extra data above PTHREAD_STACK_MIN.
x86 uses 32k, and perhaps ARM (for Linux) should too. KSTACK doesn't need to be
a power of two if USE_PTHREADS is selected.
I'll change that.
Possibly it should depend on the specific board, since it might be nice to have
more space for more kprocs if the platform allows a smaller stack size, but
I'll think about that.
Original comment by Charles....@gmail.com
on 25 Jul 2012 at 2:11
CHANGES
Linux/arm/include/emu.h
include/version.h
committed changeset 543:aa92b6f626cf
Thanks for tracking it down.
Original comment by Charles....@gmail.com
on 25 Jul 2012 at 2:14
Original issue reported on code.google.com by
chneukir...@gmail.com
on 10 Jul 2012 at 7:16