[MLton] Experimental 64-bit binary package (& SVN sources)

Matthew Fluet fluet at tti-c.org
Fri Mar 2 14:34:30 PST 2007


skaller wrote:
> On Thu, 2007-03-01 at 08:05 -0600, Matthew Fluet wrote:
>> skaller wrote:
>>> Actually with that last change I get this:
>>>
>>> skaller at rosella:/work/mlton/usr$ bin/mlton
>>> Floating point exception
>> I'll post a binary package with built with debugging later today.

Oops, I accidentally deleted the '-debug true' build.  Rebuilding.

>> In the meantime, can you provide any other information, like an strace? 
>>   Certainly the string "Floating point exception" is not being generated 
>> by MLton.  Does your system default to raising SIGFPE?

The following
   https://wiki.ubuntu.com/AutomatedProblemReports
seems to suggest that Ubuntu installs a SIGFPE handler.

Does the following program trigger a "Floating point exception":

z.c:
---
double doubleDiv(double a, double b) { return (a / b); }
---

y.c:
---
double doubleDiv(double, double);

int main(int argc, char* argv[]) {
   double d1 = doubleDiv (1.0, 0.0);
   double d2 = doubleDiv (-1.0, 0.0);
   double d3 = d1 + d2;
   if (d1 == d3)
     return 1;
   else
     return 0;
}
---

$> gcc -c z.c
$> gcc y.c z.o
$> ./a.out
???

If so, then I'm not sure what to suggest.  MLton (purposefully) does 
computations like the above to generate the values "+inf", "-inf", and 
"nan".

I would find it hard to believe that Ubuntu could require raising SIGFPE
on such non-critical floating point exceptions without breaking other 
applications.


Not much help from the strace:

> ------------------------------------------------------------------------
> execve("bin/mlton", ["bin/mlton"], [/* 30 vars */]) = 0

Launch the mlton script.

> execve("/work/mlton/usr/lib/mlton/mlton-compile", ["/work/mlton/usr/lib/mlton/mlton-"..., "@MLton", "load-world", "/work/mlton/usr/lib/mlton/world."..., "ram-slop", "0.5", "--", "/work/mlton/usr/lib/mlton", "-cc", "gcc", "-cc-opt-quote", "-I/work/mlton/usr/lib/mlton/incl"..., "-cc-opt", "-O1", "-cc-opt", "-fno-strict-aliasing -fomit-fram"..., ...], [/* 28 vars */]) = 0

Launch the mlton-compile binary.

> open("/usr/lib/libgmp.so.3", O_RDONLY)  = 3
> read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000r\0\0"..., 640) = 640
> fstat(3, {st_mode=S_IFREG|0644, st_size=238072, ...}) = 0
> mmap(NULL, 1284928, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2aaaaad47000
> mprotect(0x2aaaaad80000, 1051456, PROT_NONE) = 0
> mmap(0x2aaaaae80000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x39000) = 0x2aaaaae80000
> close(3)                                = 0

Link in libgmp.

> open("/lib/libc.so.6", O_RDONLY)        = 3
> read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\305\1\0"..., 640) = 640
> fstat(3, {st_mode=S_IFREG|0755, st_size=1267512, ...}) = 0
> mmap(NULL, 2327016, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2aaaaae81000
> mprotect(0x2aaaaaf9e000, 1159656, PROT_NONE) = 0
> mmap(0x2aaaab09e000, 94208, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x11d000) = 0x2aaaab09e000
> mmap(0x2aaaab0b5000, 16872, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2aaaab0b5000
> close(3)                                = 0

Link in libc.

> mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aaaab0ba000
> --- SIGFPE (Floating point exception) @ 0 (0) ---
> +++ killed by SIGFPE +++

Nothing interesting seems to happen before SIGFPE.





More information about the MLton mailing list