Bus error w/combined writeln(int) and uniform

Lars T. Kyllingstad public at kyllingen.NOSPAMnet
Mon Jan 31 01:18:49 PST 2011


On Sun, 30 Jan 2011 18:43:22 +0100, Magnus Lie Hetland wrote:

> Tried to see if I could find this in the issue tracker; sorry if I
> missed it. (Maybe it manifests with something other than a bus error on
> other platforms?)
> 
> Anyway, when I run the following program in OS X (using dmd 2.051), it
> first prints out 1, and then I get a bus error:
> 
> import std.random, std.stdio;
> void main() {
>      writeln(1);
>      auto y = uniform(0.0, 1.0);
> }
> 
> Writing a string instead, for example, removes the problem (as does many
> other minor changes; I've tried to eliminate as much as possible from my
> original program while retaining the bug).
> 
> Is this already known, or should I submit it?
> 
> Thanks,
> 
> - M

It works fine on Linux, which means the bug is likely OSX specific.  I 
only know of one "mysterious OSX segfault" bug currently in Bugzilla, but 
I'm not sure if it's related:

  http://d.puremagic.com/issues/show_bug.cgi?id=4854

-Lars


More information about the Digitalmars-d mailing list