Ralf Hinze <[EMAIL PROTECTED]> wrote:
> hugs (June 1998) terminates with
>
> INTERNAL ERROR: importEntity
>
> while compiling a handful of modules.
Ralf,
Thanks for the report (and the code which you sent separately).
I was able to reproduce your problem and confirm my suspicion
that it occured immediately after a garbage collection by
rerunning with the +g flag.
Then I set to work chasing up a rumour that the setjmp call did not
flush the register windows from the CPU onto the stack. (This is
on a Sparc-based machine.)
I have absolutely no documentation available to me... so it took a while.
After much work grovelling through .h files, it finally occured to me to
try this
for file in *.a *.so; do nm -a $file | grep flush; done
which (after a little more work) revealed that libthread.so defines
a function called
_flush_user_windows
Then I made this change to storage.c
diff -c -r1.42 storage.c
*** storage.c 1998/01/26 04:13:30 1.42
--- storage.c 1998/06/28 01:58:53
***************
*** 1771,1776 ****
--- 1771,1778 ----
jmp_buf regs; /* save registers on stack */
setjmp(regs);
+ _flush_user_windows(); /* no really, save those registers */
+
gcStarted();
topos = 0; /* clear to-space in flat resource */
for (i=0; i<marksSize; ++i) /* initialise mark set to empty */
(and added -lthread to LIBS in the Makefile)
and the problem seemed to go away.
Can you please try this and tell me how you get on?
Also, if anyone out there can send me any documentation for this function,
I'd be most grateful. All I know about this function is that it has the
right sort of name and that it makes one test work - but for all I know
it really flushes pending requests to my X windows server which involves
enough nested function calls (8 or more) that the register windows get
flushed to the stack. It'd be nice to know for sure.
I haven't commited this change yet (or even tried to make it portable).
I'll stick it in the master copy when I hear some good reports about this.
Alastair