-
-
Notifications
You must be signed in to change notification settings - Fork 262
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
Hello World segfault with Phobos as shared library #194
Comments
[Added code tags to the original post and adjusted the description] Uh oh, this looks like a tricky low-level issue indeed. As it does not occur on any of the boxes I have access to, could you please do two things: First, find out which instruction really causes the segfault, using Second, just to narrow down the problem a bit, could you try to compile LDC manually from Git master, without building the druntime/Phobos as dynamic libraries? It should be quite easy, just follow the README (I don't remember right now if Fedora does separate "dev" packages – if so, then you probably need to install them for LLVM and libconfig). |
just to said from my virtual machine with f18 it works fine fedora provides :
|
I went to the second comment directly and compiled LDC right from source (git master) using standard fedora development packages as per your instructions, and that worked without any problems. which means that this might be either specific to fedora patches or the problem is actually fixed on more recent code. Next I will try to repackage ldc and related packages using the latest code from git and will update you on how it goes. Thank you very much for your insightful comment. |
did you have build ldc as shared lib or static ? that is strange that. I do not get this problem |
I actually just went with the standard build procedure; which I guess is static. Lemme try dynamic / shared. |
Interesting outcome ... compiled as shared libs segfaults. Prior to cmake I defined this : then prior to compiling and running: And just to be sure about things ... I uninstalled (yum removed) all ldc related packages from my system) Here is the disassembler dump, although I am not sure at which line did it exactly segfault ... [kefah@localhost Development]$ gdb ./hello Program received signal SIGSEGV, Segmentation fault. |
Here is the backtrace ... in case its useful : |
@bioinfornatics: In this case, please consider switching the Fedora build to static libraries for now. Shared libraries are not really supported anyway (at least if you link together more than a single D module, weird things can happen). As for what causes the issue, I'm not really sure. The crash indeed happens on the assignment to xfeatures – seems like something is wrong with the relocations? |
@klickverbot it seem is an intel issue more than fedora x86_64 as with my AMD proc i do not have this problem |
I'm confirming that repacking the very rpms of Fedora 18 (from its source rpm) with static compilation instead of shared, indeed solves the problem. I only modified the spec file and built the rpms ... --- SPECS/ldc.spec.old 2012-10-13 06:51:54.794346117 +0300 %build generate geany tags@@ -201,25 +201,21 @@ %files druntime %files druntime-devel %files phobos %files phobos-devel %files phobos-geany-tags |
@bioinfornatics: Can you please switch the Fedora packages back over to static libraries? We won't officially support dynamic library builds anyway as long as they are not supported by upstream druntime, and LDC not working at all on certain systems for questionable benefits is just unacceptable. @kefah: Unfortunately, neither me nor any of the other devs seems to be able to reproduce it on their system, so if you are into low-level stuff, then it would be great if you could try to figure out what exactly is going wrong. If not, I guess we have to leave this issue for now and revisit it when druntime gets workable shared library support. |
I get the same segfault on both Mint 13 and Fedora 17 with an intel core 2 quad Q9550 Pity, the entire reason I was moving over to ldc was for the shared libraries. |
yes i think shared lib has a bad support for intel processor |
Should be fixed in Git master. |
Hello,
I'm using the latest Fedora 18 (spherical cow) 64 bits on my Ivy Bridge i7-3520M Lenovo T430.
Running the simplest hello-world program segfaults.
It looks to me like an alignment issue due to the cpu arch.
Note : This very code runs without issues on a Virtual Machine (Fedora 18 with latest updates).
Here are more details :
Fedora 18 64bits latest updates.
(Edit by @klickverbot: I moved the strace output here, as it doesn't seem to be interesting, yet is huge.)
The text was updated successfully, but these errors were encountered: