[M3devel] Ubuntu problems

Mika Nystrom mika at async.caltech.edu
Sun Dec 16 01:18:29 CET 2007

Hello Modula-3 people,

I am trying to build things with CM3 on a relatively recent Ubuntu
system (don't ask me why...) and I am running into a segfault that
I haven't seen mentioned before.  I have a feeling it has something
to do with stack formats, but I'm not sure what to do next.

I downloaded the cm3-5.4.0 binaries and started with that.  The 
compiler in the binary distribution runs, but it appears to produce
garbage.  I first tried bootstrapping but it crashes the moment it
tries to execute something it has compiled itself.  So then I tried
hello, world, with the same results...

Here's the system identification:

mika at edwards:~/test/src$ uname -a
Linux edwards 2.6.20-16-386 #2 Sun Sep 23 19:47:10 UTC 2007 i686 GNU/Linux

I made a "hello, world" program as follows:


BEGIN IO.Put("Hello, world!\n") END Main.

Compiled with cm3 directly from the distributed cm3-5.4.0 for 
LINUXLIBC6 and I get a crash in CsetjmpASM.s (as far as I can tell).
The last unclobbered stack I seem to be able to get in m3gdb is

Breakpoint 5, 0xb75e5fb4 in _setjmp () at ../src/C/LINUXLIBC6/CsetjmpASM.s:31
31      in ../src/C/LINUXLIBC6/CsetjmpASM.s
(m3gdb) where
#0  0xb75e5fb4 in _setjmp () at ../src/C/LINUXLIBC6/CsetjmpASM.s:31
#1  0xb75dbd51 in RTThread__Transfer (from=0xbfe28530, to=0xbfe28530) at ../src/runtime/LINUXLIBC6/RTThreadC.c:14
#2  0xb75dbaed in FlushStackCache () at RTThread.m3:65
#3  0xb75e27c9 in DetermineContext (oldSP=Invalid C/C++ type code 35 in symbol table.
) at ThreadPosix.m3:1101
#4  0xb75e270d in InitTopContext (c=Invalid C/C++ type code 30 in symbol table.
) at ThreadPosix.m3:1076
#5  0xb75e4325 in Init () at ThreadPosix.m3:1498
#6  0xb75c9592 in InitRuntime (p_argc=Invalid C/C++ type code 39 in symbol table.
) at RTLinker.m3:59
#7  0x08048861 in main (argc=1, argv=0xbfe28824, envp=0xbfe2882c) at _m3main.mc:3
(m3gdb) cont

Program received signal SIGSEGV, Segmentation fault.
0xa8dbaede in ?? ()

s.sp was lately 16_b75af6b9, if that means anything at all.

Oh yes, one more thing: setting LD_POINTER_GUARD to 0 before running
the program has no effect on the crash.

Any suggestions for how one might make progress on this?


More information about the M3devel mailing list