This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug go/56171] syscall FAILs on Solaris
- From: "ro at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 07 Feb 2013 17:02:35 +0000
- Subject: [Bug go/56171] syscall FAILs on Solaris
- Auto-submitted: auto-generated
- References: <bug-56171-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56171
Rainer Orth <ro at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Last reconfirmed| |2013-02-07
Resolution|FIXED |
Target Milestone|--- |4.8.0
Ever Confirmed|0 |1
--- Comment #3 from Rainer Orth <ro at gcc dot gnu.org> 2013-02-07 17:02:35 UTC ---
The test still doesn't pass on Solaris for a couple of reasons:
* passfd_test.go still uses AF_LOCAL which is missing on Solaris 9 and 10. I'm
attaching a patch that defines it from AF_UNIX if missing.
* Once it compiles, the test fails to link before Solaris 11:
Undefined first referenced
symbol in file
nanosleep _gotest_.o (symbol belongs to implicit
depe
ndency /lib/librt.so.1)
ld: fatal: symbol referencing errors. No output written to a.out
collect2: error: ld returned 1 exit status
FAIL: syscall
We need two things to fix this: also check for nanosleep in librt, just as we
do for sched_yield, and add $(LIBS) to GOLIBS so testcases are also linked
with
-lrt if necessary. The attached patch also handles this.
After those changes, the testcase compiles and links, but still fails:
--- FAIL: TestPassFD (0.11 seconds)
:0: child process: "WriteMsgUnix: write unix: bad file number", <nil>
FAIL
FAIL: syscall
In truss, it seems the same fds (4, 5) are closed twice, yielding EBADF
the second time. For fd 4, I found those stacktraces when the closes happen:
12 4387 close:return fd = 4 errno = 0
libc.so.1`__close+0x7
a.out`syscall.Close+0x1b
libgo.so.3.0.1`os.close.pN7_os.file+0x5d
libgo.so.3.0.1`os.Close.pN7_os.File+0x2a
a.out`syscall_test.$thunk4+0x2a
libgo.so.3.0.1`runtime.Goexit+0x42
libgo.so.3.0.1`testing.FailNow.pN14_testing.common+0x22
libgo.so.3.0.1`testing.Fatalf.pN14_testing.common+0x65
a.out`syscall_test.TestPassFD+0xd77
libgo.so.3.0.1`testing.$thunk10+0xe2
libgo.so.3.0.1`kickoff+0x39
libc.so.1`resumecontext
libgo.so.3.0.1`testing.RunTests+0x461
libgo.so.3.0.1`testing.Main+0x470
a.out`main.main+0x63
libgo.so.3.0.1`runtime_main+0x7b
libgo.so.3.0.1`kickoff+0x39
libc.so.1`resumecontext
a.out`main+0x4b
a.out`_start+0x83
12 4387 close:return fd = 4 errno = 9
libc.so.1`__close+0x7
a.out`syscall.Close+0x1b
a.out`syscall_test.$thunk2+0x2a
libgo.so.3.0.1`runtime.Goexit+0x42
libgo.so.3.0.1`testing.FailNow.pN14_testing.common+0x22
libgo.so.3.0.1`testing.Fatalf.pN14_testing.common+0x65
a.out`syscall_test.TestPassFD+0xd77
libgo.so.3.0.1`testing.$thunk10+0xe2
libgo.so.3.0.1`kickoff+0x39
libc.so.1`resumecontext
libgo.so.3.0.1`testing.RunTests+0x461
libgo.so.3.0.1`testing.Main+0x470
a.out`main.main+0x63
libgo.so.3.0.1`runtime_main+0x7b
libgo.so.3.0.1`kickoff+0x39
libc.so.1`resumecontext
a.out`main+0x4b
a.out`_start+0x83
I haven't yet made the necessary connections to the code to explain this.
Rainer
In