New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMLNJ crashes #228

Closed
xuanruiqi opened this Issue Apr 19, 2016 · 4 comments

Comments

Projects
None yet
5 participants
@xuanruiqi
Copy link

xuanruiqi commented Apr 19, 2016

I installed smlnj with apt-get and the executable sml is crashing:
# sml
/usr/lib/smlnj/bin/.run/run.x86-linux: 1: /usr/lib/smlnj/bin/.run/run.x86-linux: Syntax error: word unexpected (expecting ")")
I collected a strace:
# strace sml strace: Test for PTRACE_O_TRACESYSGOOD failed, giving up using this feature. execve("/usr/bin/sml", ["sml"], [/* 12 vars */]) = 0 brk(0) = 0x8220000 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff5ffee0000 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=37590, ...}) = 0 mmap(NULL, 37590, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7ff5ffff5000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\37\2\0\0\0\0\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0755, st_size=1840928, ...}) = 0 mmap(NULL, 3949248, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff5ff830000 mprotect(0x7ff5ff9eb000, 2093056, PROT_NONE) = 0 mmap(0x7ff5ffbea000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1ba000) = 0x7ff5ffbea000 mmap(0x7ff5ffbf0000, 17088, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7ff5ffbf0000 close(3) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff5ffed0000 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff5ffec0000 arch_prctl(ARCH_SET_FS, 0x7ff5ffec0740) = 0 mprotect(0x7ff5ffbea000, 16384, PROT_READ) = 0 mprotect(0x821b000, 8192, PROT_READ) = 0 mprotect(0x7ff5ffe22000, 4096, PROT_READ) = 0 munmap(0x7ff5ffff5000, 37590) = 0 getpid() = 6697 rt_sigaction(SIGCHLD, {0x8012460, ~[RTMIN RT_1], SA_RESTORER, 0x7ff5ff866d40}, NULL, 8) = 0 geteuid() = 0 brk(0) = 0x8220000 brk(0x8241000) = 0x8241000 getppid() = 6694 stat("/mnt/c/Users/Ray", {st_mode=S_IFDIR|0777, st_size=0, ...}) = 0 stat(".", {st_mode=S_IFDIR|0777, st_size=0, ...}) = 0 open("/usr/bin/sml", O_RDONLY) = 3 fcntl(3, F_DUPFD, 10) = 10 close(3) = 0 fcntl(10, F_SETFD, FD_CLOEXEC) = 0 rt_sigaction(SIGINT, NULL, {SIG_DFL, [], SA_RESTORER, 0x7ff5ff426d40}, 8) = 0 rt_sigaction(SIGINT, {0x8012460, ~[RTMIN RT_1], SA_RESTORER, 0x7ff5ff866d40}, NULL, 8) = 0 rt_sigaction(SIGQUIT, NULL, {SIG_DFL, [], SA_RESTORER, 0x7ff5ff426d40}, 8) = 0 rt_sigaction(SIGQUIT, {SIG_DFL, ~[RTMIN RT_1], SA_RESTORER, 0x7ff5ff866d40}, NULL, 8) = 0 rt_sigaction(SIGTERM, NULL, {SIG_DFL, [], SA_RESTORER, 0x7ff5ff426d40}, 8) = 0 rt_sigaction(SIGTERM, {SIG_DFL, ~[RTMIN RT_1], SA_RESTORER, 0x7ff5ff866d40}, NULL, 8) = 0 read(10, "#!/bin/sh\n\nexport SMLNJ_HOME=${S"..., 8192) = 88 execve("/usr/lib/smlnj/bin/sml", ["/usr/lib/smlnj/bin/sml"], [/* 13 vars */]) = 0 brk(0) = 0x8220000 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff5ffee0000 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=37590, ...}) = 0 mmap(NULL, 37590, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7ff5ffff5000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\37\2\0\0\0\0\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0755, st_size=1840928, ...}) = 0 mmap(NULL, 3949248, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff5ff830000 mprotect(0x7ff5ff9eb000, 2093056, PROT_NONE) = 0 mmap(0x7ff5ffbea000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1ba000) = 0x7ff5ffbea000 mmap(0x7ff5ffbf0000, 17088, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7ff5ffbf0000 close(3) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff5ffed0000 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff5ffec0000 arch_prctl(ARCH_SET_FS, 0x7ff5ffec0740) = 0 mprotect(0x7ff5ffbea000, 16384, PROT_READ) = 0 mprotect(0x821b000, 8192, PROT_READ) = 0 mprotect(0x7ff5ffe22000, 4096, PROT_READ) = 0 munmap(0x7ff5ffff5000, 37590) = 0 getpid() = 6697 rt_sigaction(SIGCHLD, {0x8012460, ~[RTMIN RT_1], SA_RESTORER, 0x7ff5ff866d40}, NULL, 8) = 0 geteuid() = 0 brk(0) = 0x8220000 brk(0x8241000) = 0x8241000 getppid() = 6694 stat("/mnt/c/Users/Ray", {st_mode=S_IFDIR|0777, st_size=0, ...}) = 0 stat(".", {st_mode=S_IFDIR|0777, st_size=0, ...}) = 0 open("/usr/lib/smlnj/bin/sml", O_RDONLY) = 3 fcntl(3, F_DUPFD, 10) = 10 close(3) = 0 fcntl(10, F_SETFD, FD_CLOEXEC) = 0 rt_sigaction(SIGINT, NULL, {SIG_DFL, ~[RTMIN], SA_RESTORER, 0x7ff5ff866d40}, 8) = 0 rt_sigaction(SIGINT, {0x8012460, ~[RTMIN RT_1], SA_RESTORER, 0x7ff5ff866d40}, NULL, 8) = 0 rt_sigaction(SIGQUIT, NULL, {SIG_DFL, ~[RTMIN], SA_RESTORER, 0x7ff5ff866d40}, 8) = 0 rt_sigaction(SIGQUIT, {SIG_DFL, ~[RTMIN RT_1], SA_RESTORER, 0x7ff5ff866d40}, NULL, 8) = 0 rt_sigaction(SIGTERM, NULL, {SIG_DFL, ~[RTMIN], SA_RESTORER, 0x7ff5ff866d40}, 8) = 0 rt_sigaction(SIGTERM, {SIG_DFL, ~[RTMIN RT_1], SA_RESTORER, 0x7ff5ff866d40}, NULL, 8) = 0 read(10, "#!/bin/sh\n#\n# The standard drive"..., 8192) = 5369 pipe([3, 4]) = 0 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7ff5ffec0a10) = 6698 close(4) = 0 read(3, "sml\n", 128) = 4 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=6698, si_status=0, si_utime=0, si_stime=0} --- strace: ptrace(PTRACE_SYSCALL,pid:6697,sig:17): Invalid argument Process 6697 detached

@stehufntdev

This comment has been minimized.

Copy link
Collaborator

stehufntdev commented Apr 19, 2016

Thanks for reporting the issue. Looks like the application is trying to load a i386 binary (32bit):

root@TEST-6:/mnt/c/Users/test/AppData/Local/lxss# readelf -h /usr/lib/smlnj/bin/.run/run.x86-linux
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: Intel 80386
Version: 0x1
Entry point address: 0x804aa76
Start of program headers: 52 (bytes into file)
Start of section headers: 126360 (bytes into file)
Flags: 0x0
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 9
Size of section headers: 40 (bytes)
Number of section headers: 27
Section header string table index: 26

Currently WSL only supports amd64 (native 64bit).

To get this on our priority list can you add it to our [UserVoice](https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/category/161892-bash page)? Thanks again for trying out WSL!

@RobRoseKnows

This comment has been minimized.

Copy link

RobRoseKnows commented Mar 24, 2017

Sorry for the necro and I don't want to be a bother, but is there currently a timeline as to when WSL might support 32-bit i386 binaries?

@stehufntdev

This comment has been minimized.

Copy link
Collaborator

stehufntdev commented Mar 24, 2017

No bother at all :). Right now we don't have a timeline for the change, but are tracking the work. So far we've been prioritizing work based on scenarios and user voice, so please upvote the entry for 32bit support - https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/

@therealkenc

This comment has been minimized.

Copy link
Collaborator

therealkenc commented Mar 24, 2018

Landing zone for i386 binaries in WSL ended up #2468 via osmosis. #2468 should have been duped down the other direction from the start but it didn't work out that way.

@therealkenc therealkenc added duplicate and removed feature labels Mar 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment