FS#34155 - [ldc] Illegal Instruction
Attached to Project:
Community Packages
Opened by T. Jameson Little (beatgammit) - Tuesday, 05 March 2013, 06:23 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Tuesday, 04 June 2013, 05:17 GMT
Opened by T. Jameson Little (beatgammit) - Tuesday, 05 March 2013, 06:23 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Tuesday, 04 June 2013, 05:17 GMT
|
Details
Description:
When running a program compiled with ldc2, I get "illegal instruction". Additional info: * ldc 20130219-1 CPU: Intel(R) Core(TM)2 Duo CPU T6500 @ 2.10GHz Steps to reproduce: This simple program causes the error every time for me: void main() { } Compiling ldc from source works as expected. I would just flag this as out of date, but I couldn't reproduce the error from an older version of ldc (tried last commit from 2-18 and release 0.10), so it must be a problem with the pre-compiled ldc available in the repositories. |
This task depends upon
Closed by Sven-Hendrik Haase (Svenstaro)
Tuesday, 04 June 2013, 05:17 GMT
Reason for closing: Fixed
Additional comments about closing: Should be fixed in current version. Reopen if it isn't.
Tuesday, 04 June 2013, 05:17 GMT
Reason for closing: Fixed
Additional comments about closing: Should be fixed in current version. Reopen if it isn't.
I'm not 100% sure what that switch does. I'm running on x86_64, so that may be relevant information that I neglected to include in the original report.
CPU: AMD Athlon 64 ×2
I can also confirm the workaround works! :D
Unfortunately, I can't reproduce the issue on my Arch box.
Also, I'm not sure how MULTILIB is related to the bug report. It only triggers compilation of a separate set of, well, multilib (i.e. 32 bit) versions of druntime and Phobos. What do you mean by »With that switch, ldc wouldn't compile«?
out.disasm was from objdump -d
out2.disasm was from objdump, but using my build without MULTILIB
Here's main (not very interesting):
(gdb) info address main
Symbol "main" is at 0x403050 in a file compiled without debugging.
(gdb) disas 0x403050
Dump of assembler code for function main:
0x0000000000403050 <+0>: mov $0x401f70,%edx
0x0000000000403055 <+5>: jmp 0x403060 <_d_run_main>
End of assembler dump.
Here's some more info (ran using gdb):
(gdb) run
Starting program: /home/otto/test
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Program received signal SIGILL, Illegal instruction.
0x000000000041c236 in gc.gcx.GC.initialize() ()
The linux-vdso error doesn't seem significant: https://bugs.archlinux.org/task/30657 (also appears on an equivalent C program)
It seems to be this instruction: vmovups
out2.disasm (1.95 MiB)
[ 31%] Generating src/rt/arrayfloat-debug_32.o
Scanning dependencies of target druntime-ldc-debug_32
[ 31%] Building C object runtime/CMakeFiles/druntime-ldc-debug_32.dir/druntime/src/core/stdc/errno.c.o
In file included from /usr/include/features.h:399:0,
from /usr/include/errno.h:28,
from /home/otto/abs/ldc/borken/src/ldc-build/runtime/druntime/src/core/stdc/errno.c:14:
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory
compilation terminated.
make[2]: *** [runtime/CMakeFiles/druntime-ldc-debug_32.dir/druntime/src/core/stdc/errno.c.o] Error 1
make[1]: *** [runtime/CMakeFiles/druntime-ldc-debug_32.dir/all] Error 2
make: *** [all] Error 2
==> ERROR: A failure occurred in build().
Aborting...
Built from PKGBUILD from abs (attached) with makepkg -s
My system is relatively bare and I don't recall installing any 32-bit compat libs. My rather uninformed guess is that this is a missing dependency issue, not an upstream issue, since I can build from source using the upstream instructions.
I guess this is something that needs to be done in the packaging, not upstream? I suppose LDC could double-check for CPU features, but this sounds like a lot of work for something that can be done at compile time.
It seems the Linux build should be stable, but it hasn't been officially released yet.
EDIT: The next version will be 0.11, but the current version scheme is date-based. Could the version number scheme be changed? Beta-2 has been released, so the official release version should be out soon.