[M3devel] bad code on PPC_LINUX?

Tony Hosking hosking at cs.purdue.edu
Thu Jan 10 18:41:55 CET 2008


Is this an alignment problem?  Or a mismatch between the compiler and  
runtime?  I have no idea if the alignment specs and definitions for  
the jmp_buf used in exceptions are matched between the compiler and  
run-time properly.  See Target.m3 in the compiler and RTMachine.i3 in  
the runtime.


On Jan 10, 2008, at 2:11 AM, Jay wrote:

>
> Something is screwy I think.
> My gdb skills are um not good.
>
> On PPC_LINUX.
>
> /dev2/cm3/m3-sys/cm3/src/Utils.m3
>
> PROCEDURE WriteFile (file: TEXT;  proc: Emitter;  append := FALSE) =
>   VAR wr: Wr.T;
>   BEGIN
>     IF (append)
>       THEN wr := AppendWriter (file, fatal := TRUE);
>       ELSE wr := OpenWriter (file, fatal := TRUE);
>     END;
>     TRY           (* line 78 *)
>       TRY
>         proc (wr);
>       EXCEPT
>       | Wr.Failure (ec) =>
>           Msg.FatalError (ec, "write failed on ", file);
>       | Thread.Alerted =>
>           Msg.FatalError (NIL, "interrupted while writing ", file);
>       END;
>     FINALLY
>       CloseWriter (wr, file);
>     END;
>   END WriteFile;
>
> I get a SEGV on line 78.
>
> I'm willing to believe, sadly, that some of these huge offsets
> are the price of TRY and saving the register context on anything
> other than x86 (for registers that aren't even used by the function?),
> however it crashes just after the call and notice there the huge  
> 32k offset




More information about the M3devel mailing list