Re: [MLton] Bug report (Ur/Web, ARM)
Matthew Fluet <[email protected]> Wed, 21 Oct 2015 23:40:20 -0400
| Newsgroups | gmane.comp.lang.ml.mlton.devel |
|---|---|
| Message-ID | <CAMrhFL4s1LRpoULy0tHZLxF9sANnqf9RVMDPTZVt_RS+tcvYEA@mail.gmail.com> |
On Wed, Oct 21, 2015 at 10:32 AM, Jason Pepas <[email protected]> wrote: > As you suspected, running mlton with no arguments results in the same error. > > Here is the last few lines of output of strace: > > open("/lib/arm-linux-gnueabi/libc.so.6", O_RDONLY) = 3 > read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0XX\1\0004\0\0\0"..., > 512) = 512 > lseek(3, 1231644, SEEK_SET) = 1231644 > read(3, > "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1400) > = 1400 > lseek(3, 1231204, SEEK_SET) = 1231204 > read(3, "A'\0\0\0aeabi\0\1\35\0\0\0\0054T\0\6\2\10\1\t\1\22\4\24\1\25\1"..., > 40) = 40 > fstat64(3, {st_mode=S_IFREG|0755, st_size=1233044, ...}) = 0 > mmap2(NULL, 1275160, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = > 0xb6d26000 > mprotect(0xb6e50000, 32768, PROT_NONE) = 0 > mmap2(0xb6e58000, 12288, PROT_READ|PROT_WRITE, > MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x12a) = 0xb6e58000 > mmap2(0xb6e5b000, 9496, PROT_READ|PROT_WRITE, > MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb6e5b000 > close(3) = 0 > mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = > 0xb6d25000 > set_tls(0xb6d254c0, 0xb6d25b97, 0xb6d25b98, 0xb6d254c0, 0xb6fb8000) = 0 > mprotect(0xb6e58000, 8192, PROT_READ) = 0 > mprotect(0xb6f91000, 4096, PROT_READ) = 0 > mprotect(0xb6fb7000, 4096, PROT_READ) = 0 > munmap(0xb6fb0000, 22122) = 0 > sysinfo({uptime=606121, loads=[20768, 9216, 5568] totalram=29065216, > freeram=3432448, sharedram=0, bufferram=1458176} totalswap=1073737728, > freeswap=1069465600, procs=51}) = 0 > mmap2(NULL, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = > 0xb6fb0000 > mprotect(0xb6fb0000, 4096, PROT_NONE) = 0 > mprotect(0xb6fb1000, 16384, PROT_READ|PROT_WRITE|PROT_EXEC) = 0 > mprotect(0xb6fb5000, 4096, PROT_NONE) = 0 > sigaltstack({ss_sp=0xb6fb3000, ss_flags=0, ss_size=8192}, NULL) = 0 > mmap2(0xf8000000, 1802240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, > -1, 0) = 0xb6b6d000 > write(2, "unhandled exception: ", 21unhandled exception: ) = 21 > write(2, "SysErr", 6SysErr) = 6 > write(2, "\n", 1 > ) = 1 > write(2, "MLton bug: ", 11MLton bug: ) = 11 > write(2, "unhandled exception in Basis Lib"..., 36unhandled exception in > Basis Library) = 36 > write(2, "\nPlease send a bug report to MLt"..., 46 > Please send a bug report to [email protected]. > ) = 46 > exit_group(2) = ? > > I would guess this means that the last call to mmap2() failed? No, as Henry mentioned, the mmap2 is succeeding, since it is not returning NULL. In fact, it looks like none of the traced system calls are failing, and it looks like you have a fairly complete trace of the run of the executable. The various mmap2 calls with MAP_ANONYMOUS are for allocating the initial ML heap; the sigaltstack is expected during initialization of the runtime system (https://github.com/MLton/mlton/blob/master/runtime/gc/init.c#L335; https://github.com/MLton/mlton/blob/master/runtime/gc/signals.c#L30). Once the write system calls start, the ML code is already handling the raised SysErr exception. So, it isn't an actual system call that is failing. I guess it is just a C library function (that doesn't need kernel support) that is erroring. You might try "ltrace /usr/lib/mlton/mlton-compile", though that will generate a lot of data. On my system, there are pages of memcpy calls that correspond to copying static strings into the initial ML heap and then memcpy calls that correspond to object copies during garbage collection. ------------------------------------------------------------------------------