-
Notifications
You must be signed in to change notification settings - Fork 218
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
Linux: compact_dex_converter fails with "Illegal instruction (core dumped)" #29
Comments
Xmm weird. Can you try attaching gdb and see if you can reproduce the crash? If you're not familiar with gdb use the following steps:
|
Thank you for your response. Here you go:
EDIT: Got the full output now. Sorry about that |
@superr it seems that the libc++.so that I have compiled and shared is not compatible with your system due to some CPU missing features (most probably an old model not supporting all new instruction emitted from newer compiler version). The reason that it works when running from within valgrind, is because valgrind places its own hooks to instrument allocations (including the one that contains the illegal instruction) and thus the original implementation is never invoked (SIGILL is not triggered). Unfortunately I cannot do much from my side. However, you can try forking the necessary AOSP repos, apply the compact_dex_converter patch in the ART git repo and build yourself. Hopefully, when compiling libc++ the compiler will handle the older CPU issue. |
Thank you for your help :) I have synced the Pie repo and applied the patch. I am not sure how to get the compact_dex_converter binary compiled from here. I prefer a static binary, but anything that will work on my PC would be great! Thanks :) |
I think I have figured out how to compile compact_dex_converter. However, it returns this error:
Any idea how to fix this? I synced the full master branch before patching and compiling with the command EDIT: After searching for mem_map.h in the source tree:
Thank you for your assistance :) |
I was able to get past the first error by changing in file compact_dex_converter_main.cc: This:
To:
Unfortunately there is a new error:
Sorry for all the posts, just trying to make my way through this. Thanks again for your help :) |
|
Thanks @Furniel, it is getting closer :) New error:
I appreciate the help :) |
@superr
and change to:
|
Thanks @Furniel for all your help. Finally got it compiled :) Unfortunately, it has the exact same issue as the ones you and @anestisb compiled.
Any new ideas to get this converter working on older PC's? Thanks |
You can try to change compilation flags. But i'm not sure flags from what files used for host build. I recommend start from "/build/soog/cc/config" there you can find "x86_linux_host.go" open it and try to change
you can try remove this
if this won't help you can open "global.go" and change commonGlobalCflags, for example "-O2" to "-O1" |
Thank you again @Furniel for your help :) Sadly neither of those changes made a difference. I do not have the knowledge to troubleshoot this on my own. I understand if you do not wish to continue, but appreciate any additional help you may provide :) |
@superr |
Thanks @Furniel for the new binaries. CPU: AMD Phenom II X4 955 |
@superr |
Thank you once again @Furniel. I really appreciate all your time and effort :) I wish I could bring good news after all this, but it's the same error again. I am able to work around it using valgrind as mentioned above. It is not ideal but it does seem to work. It will have to do for now, at least until an alternative cdex converter is created (hopefully one that can be compiled for Windows too). |
@superr I've managed to reproduce the issue on a dusty workstation and found the root cause of the problem. It's not the main build configs, it's an ART enforcement of SSE4.2 & POPCNT introduced in this commit. The converter tool is affected since it links with ART libraries. Applying the following patch should resolve your problem:
I've also updated (see f099f29) the README links with some additional precompiled binaries for older CPUs. Hopefully, it will work for you too. Needless to say that your workstation cannot be used anymore to pre-optimise apps when generating system images. dex2oat will fail since it expects an SSE4.2 compatible host for the activated ISA features. You might be able to workaround it by disabling some default ISA features from within ART defaults, although too much hassle for 12+ year old CPUs. Probably its time to update your setup :) |
The new binaries for older CPU worked perfectly! Thank you for all your extra effort on this old PC :) This PC is still plenty fast for most things I do on it so I have not been motivated to upgrade. However, this is the second time exactly this missing SSE4.2 has caused an issue. Trying to run a certain OS as a VM failed for the same reason. I suppose it is time to start shopping. Thanks again for your help. You are very much appreciated :) |
Hello,
When trying to convert cdex to dex, compact_dex_converter fails:
You asked if I would use valgrind to run it, and to my surprise it works when run through valgrind:
Now I am really confused
The text was updated successfully, but these errors were encountered: