-
Notifications
You must be signed in to change notification settings - Fork 9
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
illegal instruction #1
Comments
Point 3.3 in Valgrind's FAQ http://valgrind.org/docs/manual/faq.html mentions two possibilities:
As the examples are quite simple and have worked before, I'm pretty sure that there is an actual instruction that Valgrind 3.7 does not know yet. This is also quite likely as Valgrind is 3.7 is a few years old by now and a recent compiler targeting a recent CPU might use instructions that have been introduced in the meantime. I see two options to solve this:
Option 1 is of course way simpler than option 2. |
We tried option 1 by using the -march=x86-64 flag for gcc when compiling the example, so gcc should not have generated instructions that only work for recent processors. Or do you think a different option for the march flag must be used? |
My guess is that it fails on new SSE instructions and therefore I suggest trying out |
I now tried this option too, although -march=x86-64 should only use SSE2 so an even older instruction set, Unfortunately it did not work, and I think it might be due to the old valgrind version. |
Migrating to Valgrind 3.12 is definitely some work. I started with the first step of making the code compile: https://github.com/fbenz/FpDebug/tree/valgrind_3.12
Afterwards one has to test that everything is still working as intended. Testing and checking for unsupported instructions is a good way of lazily adding required instructions. I can not promise any timeline and would of course be happy for contributions in that direction. |
FpDebug is now able to compile and run with Valgrind 3.12. The small examples are running as expected on my machine (Ubuntu 16.10). In addition, I provided bash scripts to simplify the installation process. Calling the following scripts is sufficient to compile everything:
See #2 |
Closing because it is fixed by #2. If there are still unhandled cases in the version based on Valgrind 3.12 a new issue can be created. |
I managed to compile this using your instructions and additionally modifying the configure script to accept the kernel version and gcc version of ubuntu 16.04. But then when I tested it on the example I got the following error.
==26562== FpDebug-0.1, Floating-point arithmetic debugger
==26562== Copyright (C) 2010-2011 by Florian Benz.
==26562== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==26562== Command: fpdebug/examples/test_1.out
==26562==
==26562== precision=120
==26562== mean-error=yes
==26562== ignore-libraries=no
==26562== ignore-accurate=yes
==26562== sim-original=no
==26562== analyze-all=yes
==26562== bad-cancellations=yes
==26562== ignore-end=no
vex amd64->IR: unhandled instruction bytes: 0x66 0xF 0x1B 0x84 0x24 0x80 0x0 0x0
==26562== valgrind: Unrecognised instruction at address 0x4017cee.
==26562== at 0x4017CEE: _dl_runtime_resolve_sse (dl-trampoline.h:93)
==26562== Your program just tried to execute an instruction that Valgrind
==26562== did not recognise. There are two possible reasons for this.
==26562== 1. Your program has a bug and erroneously jumped to a non-code
==26562== location. If you are running Memcheck and you just saw a
==26562== warning about a bad jump, it's probably your program's fault.
==26562== 2. The instruction is legitimate but Valgrind doesn't handle it,
==26562== i.e. it's Valgrind's fault. If you think this is the case or
==26562== you are not sure, please let us know and we'll try to fix it.
==26562== Either way, Valgrind will now raise a SIGILL signal which will
==26562== probably kill your program.
==26562==
==26562== Process terminating with default action of signal 4 (SIGILL)
==26562== Illegal opcode at address 0x4017CEE
==26562== at 0x4017CEE: _dl_runtime_resolve_sse (dl-trampoline.h:93)
==26562==
==26562== SHADOW VALUES (fpdebug/examples/test_1.out_shadow_values_relative_error_5): successful
==26562== SHADOW VALUES (fpdebug/examples/test_1.out_shadow_values_canceled_5): successful
==26562== SHADOW VALUES (fpdebug/examples/test_1.out_shadow_values_special_5): successful
==26562== MEAN ERRORS (fpdebug/examples/test_1.out_mean_errors_addr_5): successful
==26562== MEAN ERRORS (fpdebug/examples/test_1.out_mean_errors_canceled_5): successful
==26562== MEAN ERRORS (fpdebug/examples/test_1.out_mean_errors_intro_5): successful
==26562== DEBUG - Client exited with code: 0
--26562-- DEBUG - SBs: 1,362, executed: 16,153, instr: 48,945
--26562-- DEBUG - ShadowValues (frees/mallocs): 0/0, diff: 0
--26562-- DEBUG - Floating-point operations: 0
--26562-- DEBUG - Max temps: 201
--26562-- OPTIMIZATION - GET: total 3,358, ignored: 196
--26562-- OPTIMIZATION - STORE: total 1,372, ignored: 0
--26562-- OPTIMIZATION - PUT: total 12,159, ignored: 3,774
--26562-- OPTIMIZATION - LOAD: total 1,922, ignored: 0
Illegal instruction
The text was updated successfully, but these errors were encountered: