object file and binary of simple hello world that fails
application/zip
162023
Comments
Comment #0 by timothee.cour2 — 2013-12-04T12:20:54Z
when building from git head on ubuntu, I'm now getting SIGSEGV upon calling writeln("some_string);
Previously it worked.
Comment #1 by hsteoh — 2013-12-05T11:45:57Z
Post self-contained test case, please. I can't reproduce your problem in my environment (just updated to git HEAD, Debian/unstable 64-bit).
Comment #2 by hsteoh — 2013-12-05T11:46:50Z
P.S. Here is the code I tested:
------
import std.stdio;
void main() {
writeln("Hello");
}
------
No segfaults happened.
Comment #3 by kozzi11 — 2013-12-05T12:14:19Z
(In reply to comment #2)
> P.S. Here is the code I tested:
> ------
> import std.stdio;
>
> void main() {
> writeln("Hello");
> }
> ------
>
> No segfaults happened.
same here, ArchLinux 64 with out segfaults
Comment #4 by timothee.cour2 — 2013-12-05T15:10:54Z
(In reply to comment #3)
> (In reply to comment #2)
> > P.S. Here is the code I tested:
> > ------
> > import std.stdio;
> >
> > void main() {
> > writeln("Hello");
> > }
> > ------
> >
> > No segfaults happened.
>
> same here, ArchLinux 64 with out segfaults
At least another user reported the same problem (see email: dmd git head completely broken on ubuntu (but not osx))
It fails for me on both Ubuntu 12.04.1 LTS (64bit) and Ubuntu 12.04.3 LTS (64bit), and the other user reported same issue on Ubuntu 12.04.3 LTS, x86_64
to reproduce: just do a fresh git clone of dmd/druntime/phobos and build as usual, then run this program:
import std.stdio;
void main() {
writeln("Hello");
}
it segfaults.
then git checkout 2.064 on dmd/druntime/phobos, clean/rebuild, it doesn't segfault. So it's something introduced since then.
Comment #5 by hsteoh — 2013-12-05T19:20:55Z
I'm afraid you'll have to git bisect to find out when this started happening. I've been compiling medium-sized projects with git HEAD and everything runs without any problems, so my environment isn't useful to track down this problem.
Comment #6 by maxim — 2013-12-05T22:27:10Z
It is obvious that it is either a user problem or bug which is revealed in specific circumstances.
Please attach:
1) Fully working binary
2) Object file only
This will help to detect root of the issue.
Comment #7 by timothee.cour2 — 2013-12-09T13:04:12Z
Created attachment 1299
object file and binary of simple hello world that fails
object file and binary of simple hello world that fails
Comment #8 by hsteoh — 2013-12-09T16:20:41Z
Interesting. The segfault is caused by stdout being null. But std.stdio's static this() does initialize it correctly. So the static this() somehow isn't getting called by the druntime startup code???
What compile flags are you using, and what's the contents of dmd.conf?
Comment #9 by timothee.cour2 — 2013-12-09T16:36:23Z
(In reply to comment #8)
> Interesting. The segfault is caused by stdout being null. But std.stdio's
> static this() does initialize it correctly. So the static this() somehow isn't
> getting called by the druntime startup code???
$cat ./dmd/src/dmd.conf
[Environment]
DFLAGS=-Ipath/to/phobos -Ipath/to/druntime/import -L-Lpath/to/phobos/generated/linux/release/default/ -L--export-dynamic -L-lrt
> What compile flags are you using, and what's the contents of dmd.conf?
#compile flags:
$./dmd/src/dmd -g -ofmain main.d
Other than that I'm building dmd/druntime/phobos as usual, no special options etc.
Comment #10 by code — 2013-12-22T01:01:37Z
Just ran into this while preparing the release on a Ubuntu 12.04 box.
The .ctors .dtors sections of the object files are truncated, they are 4 byte each, but they should be 8 byte for the 64-bit pointer.
This is not an ld.gold issue, still investigating.
> how come this wasn't auto-detected by the auto tester? isn't ubuntu part of the
machines being tested?
I don't know which distributions are running on the auto-tester.
But even if we threw 10x more machines on the problem there will always remain some configurations that don't get tested.
For such a prominent thing as Ubuntu 12.04 LTS, this shouldn't happen though.
Comment #19 by timothee.cour2 — 2013-12-22T16:36:21Z