The first thing I would suggest running the program via truss and see if any calls to write() are returning EBADF.. If so, see what fd# is being passed (or if something is calling close() on fd1).
On Thu, Jun 25, 2015 at 2:57 PM, flamencofantasy via Digitalmars-d < [email protected]> wrote: > On Sunday, 17 May 2015 at 19:36:54 UTC, Joakim wrote: > >> On Tuesday, 5 May 2015 at 15:41:47 UTC, Joakim wrote: >> >>> On Tuesday, 5 May 2015 at 05:42:33 UTC, Kai Nacke wrote: >>> >>>> BTW: You can by-pass the Solaris ld by setting environment variable >>>> LD_ALTEXEC to the ld binary you want to use. >>>> >>> >>> Thanks for the tip: I set that to the binutils ld and got almost all of >>> druntime's tests to pass with a 64-bit binary. I only had to comment out >>> the additional druntime tests having to do with exceptions. Maybe that's >>> related to the link error flamencofantasy pasted. >>> >>> I also tried running the phobos unit tests, but I got a ton of link >>> errors, seemingly for stuff that should be there. I'll let someone else >>> track those down. >>> >> >> Before I chuck this large SmartOS VM on my external backup, I thought I'd >> take another shot at getting the phobos tests running. Turned out to be >> pretty easy and I started hacking around the test failures until it got too >> tedious, when the std.path tests wouldn't run because "Memory allocation >> failed." >> Here's the last patch I used: >> >> https://gist.github.com/joakim-noah/6094789851ba1db1170b >> >> Some notes: >> >> - I disabled the tests for std.datetime and std.parallelism in the test >> runner because they were both failing somewhere. >> - All it took to get the phobos test runner linked was to add all the >> additional necessary libraries that curl needed on Solaris to posix.mak. >> - getcwd will not accept a zero size on Solaris. >> - Solaris seems to have similar issues to Android with formatting NaN and >> hex in std.format. >> > > Hello, > > This is my test program; > > import std.stdio; > > void main() > { > try > { > writeln("Hello"); > } > catch (Exception e) > { > import core.stdc.stdio; > printf(e.msg.ptr); > } > } > > > The output is; > Bad file number > > It has to do with stdout not being valid but I am unable to figure out why > by reading the source code. > I am new to unix in general and SmartOS/Solaris in particular. > > Long story short my fairly large project which builds and runs flawlessly > on Windows and Linux, compiles successfully on SmartOS with no warnings but > any invocation of writeln (and relatives) throws the exception above. > If anyone is willing to help I have a smart zone with ssh access I can > provide you with so you can play. > > Thanks! > > >
