Re: writeln() assertion failed in hybrid x64

2014-09-05 Thread Kagamin via Digitalmars-d-learn
It's not a module ctor, this code is executed much earlier. You can write a function, which will initialize standard streams, and call it from the C code before rt_init.

Re: writeln() assertion failed in hybrid x64

2014-09-05 Thread hane via Digitalmars-d-learn
On Friday, 5 September 2014 at 07:22:23 UTC, hane wrote: On Thursday, 4 September 2014 at 15:10:22 UTC, Jorge A. S. wrote: I'm having an error related to yours: when I call writeln function in a closed stdout I will get a segfault message. Example: import std.stdio; void main() { stdout.clo

Re: writeln() assertion failed in hybrid x64

2014-09-05 Thread Szymon Gatner via Digitalmars-d-learn
On Thursday, 4 September 2014 at 20:57:41 UTC, Kagamin wrote: https://github.com/D-Programming-Language/druntime/blob/master/src/rt/dmain2.d#L270 well, this sucks. Is there a way I can call module c-tors explicitly? I was under impression that D(dmd) was suppose to work with VisualC++ in x64b

Re: writeln() assertion failed in hybrid x64

2014-09-05 Thread hane via Digitalmars-d-learn
On Thursday, 4 September 2014 at 15:10:22 UTC, Jorge A. S. wrote: I'm having an error related to yours: when I call writeln function in a closed stdout I will get a segfault message. Example: import std.stdio; void main() { stdout.close(); write("hello\n"); } The code above will crash wi

Re: writeln() assertion failed in hybrid x64

2014-09-04 Thread Kagamin via Digitalmars-d-learn
https://github.com/D-Programming-Language/druntime/blob/master/src/rt/dmain2.d#L270 well, this sucks.

Re: writeln() assertion failed in hybrid x64

2014-09-04 Thread Kagamin via Digitalmars-d-learn
https://github.com/D-Programming-Language/druntime/blob/master/src/core/stdc/stdio.d#L457 see? It's null. Hmm... where is it initialized?

Re: writeln() assertion failed in hybrid x64

2014-09-04 Thread Szymon Gatner via Digitalmars-d-learn
On Thursday, 4 September 2014 at 20:38:38 UTC, Kagamin wrote: Maybe some module constructor wasn't run due to linking mess. So it remains uninitialized. Is there a way I can check if module c-tor run? rt_init() returned no error.

Re: writeln() assertion failed in hybrid x64

2014-09-04 Thread Kagamin via Digitalmars-d-learn
Maybe some module constructor wasn't run due to linking mess. So it remains uninitialized.

Re: writeln() assertion failed in hybrid x64

2014-09-04 Thread Szymon Gatner via Digitalmars-d-learn
On Thursday, 4 September 2014 at 18:22:55 UTC, Marc Schütz wrote: On Thursday, 4 September 2014 at 17:57:47 UTC, Szymon Gatner wrote: On Thursday, 4 September 2014 at 15:25:59 UTC, ketmar via Digitalmars-d-learn wrote: On Thu, 04 Sep 2014 15:10:21 + "Jorge A. S. via Digitalmars-d-learn" wr

Re: writeln() assertion failed in hybrid x64

2014-09-04 Thread via Digitalmars-d-learn
On Thursday, 4 September 2014 at 17:57:47 UTC, Szymon Gatner wrote: On Thursday, 4 September 2014 at 15:25:59 UTC, ketmar via Digitalmars-d-learn wrote: On Thu, 04 Sep 2014 15:10:21 + "Jorge A. S. via Digitalmars-d-learn" wrote: In one of the specializations of the write function in the s

Re: writeln() assertion failed in hybrid x64

2014-09-04 Thread Szymon Gatner via Digitalmars-d-learn
On Thursday, 4 September 2014 at 15:25:59 UTC, ketmar via Digitalmars-d-learn wrote: On Thu, 04 Sep 2014 15:10:21 + "Jorge A. S. via Digitalmars-d-learn" wrote: In one of the specializations of the write function in the std.stdio (the call site that you showed in your post) no check for c

Re: writeln() assertion failed in hybrid x64

2014-09-04 Thread ketmar via Digitalmars-d-learn
On Thu, 04 Sep 2014 15:10:21 + "Jorge A. S. via Digitalmars-d-learn" wrote: > In one of the specializations of the write function in the > std.stdio (the call site that you showed in your post) no check > for closed stdout (when stdout._p is null) is done. I can't say > if this is a bug in

Re: writeln() assertion failed in hybrid x64

2014-09-04 Thread Jorge A. S. via Digitalmars-d-learn
I'm having an error related to yours: when I call writeln function in a closed stdout I will get a segfault message. Example: import std.stdio; void main() { stdout.close(); write("hello\n"); } The code above will crash with segfault buf the following code will raise an exception instead

Re: writeln() assertion failed in hybrid x64

2014-09-03 Thread Szymon Gatner via Digitalmars-d-learn
On Wednesday, 3 September 2014 at 09:55:55 UTC, Szymon Gatner wrote: Hey, I am trying to build hybrid (C++, D) application (more here: http://forum.dlang.org/thread/ugkpqprobonorbdun...@forum.dlang.org) but I am now getting assertion failure from within writeln(). writeln() is called from a D

writeln() assertion failed in hybrid x64

2014-09-03 Thread Szymon Gatner via Digitalmars-d-learn
Hey, I am trying to build hybrid (C++, D) application (more here: http://forum.dlang.org/thread/ugkpqprobonorbdun...@forum.dlang.org) but I am now getting assertion failure from within writeln(). writeln() is called from a D function that has C++ linkage: D definition: extern (C++) void pri