Skip to content
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

ldc2: Segmentation fault with -O #2885

Closed
patrickkh7788 opened this issue Oct 27, 2018 · 9 comments
Closed

ldc2: Segmentation fault with -O #2885

patrickkh7788 opened this issue Oct 27, 2018 · 9 comments

Comments

@patrickkh7788
Copy link

patrickkh7788 commented Oct 27, 2018

ldmd2 is run from termux32 with -O, remove -O it work fine.

LDC - the LLVM D compiler (1.12.0):
based on DMD v2.082.1 and LLVM 7.0.0
built with LDC - the LLVM D compiler (1.12.0)

@kinke
Copy link
Member

kinke commented Oct 27, 2018

Without any code for reproducibility, such a report is quite obviously useless.

@joakim-noah
Copy link
Contributor

Can you run uname -m in Termux and report what it says? Also, you can try reducing the crashing code with the Dustmite tool.

@patrickkh7788
Copy link
Author

Linux localhost 3.18.71-14176914 #1 SMP PREEMPT Wed Sep 19 10:57:01 KST 2018 armv8l Android

I will try Dustmite, not sure it can work on android.

@joakim-noah
Copy link
Contributor

Hmm, haven't seen that reported before, ie armv8l, can you say what the device or CPU is? If it's a device running a 32-bit kernel, you may need to specify the CPU when building D code, ie add the -mcpu=cortex-a8 flag to your D command-line. You can always choose another 32-bit CPU arch as the baseline instead, but may need to recompile the runtime libraries for it using ldc-build-runtime.

@patrickkh7788
Copy link
Author

@joakim-noah I forget to let you know, I am rung arm32 on a arm64 phone, because I can not find arm32 and I am not able to setup a cross build for arm32.

to do this is modify the termux to make sure it always return arm32 type from Java.

@joakim-noah
Copy link
Contributor

OK, in that case, does adding the 32-bit CPU flag fix the segfault? It usually does for me on 32-bit ARM.

@patrickkh7788
Copy link
Author

@joakim-noah
to build with -mcpu=cortex-a8, it work. Is the binary still can run on all arm32/arm64 android phone ?

@joakim-noah
Copy link
Contributor

Yes, it should. If adding that flag fixes this issue for you, you can close it. I will more prominently emphasize it on the wiki.

@joakim-noah
Copy link
Contributor

I've updated the wiki to emphasize that you should pass that cpu flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants