Created attachment 51249 [details] Simple test case Version: 3.6 SVN (using Devel) OS: Linux I have a simple JNI program which works properly without valgrind, and fails when using valgrind (I'm not sure which of OpenJDK/valgrind is guilty). Exact output from java is : "Error occurred during initialization of VM Unknown x64 processor: SSE2 not supported" which occurs when calling : JNI_CreateJavaVM I've made a few researchs, so here's a quick summary : - when running "valgrind cpuid" sse2 is listed in cpu features - it seems that OpenJDK method to check sse2 presence is split between those functions/files : * supports_sse2() and feature_flags() / vm_version_x86.hpp * VM_Version_StubGenerator::generate_getPsrInfo() / vm_version_x86.cpp (maybe it could be useful to someone with better asm knowledge than me :-) ) My computer specs : - Core 2 Duo - Ubunto 10.04 (amd64) Reproducible: Always Steps to Reproduce: Compile the attached program then run "valgrind PROGRAM"
I guess I've found the problem ; OpenJDK code does this before early in the features detection code : "// if we are unable to change the AC flag, we have a 386" If it happens, it skips the feature detection, then the assert 'supports_sse2()' fails later. If this early test is removed, my test program works correctly. After looking in valgrind sources, it seems that eflag's AC bit is handled only in x86 code. I've attached a simple patch which tries to implement AC flag support for amd64 - it works here and with this patch applied the test program is running OK. I hope this could be useful.
Created attachment 51299 [details] patch proposal for eflag AC handling for amd64
We see the same problem with OpenJDK and the attached patch helps. Any chance to get the patch into 3.6? Thanks!
Committed, r2050 + followup fix in r11388. Thanks.