Skip to content

gccgo: some kind of thread/errno issue #3333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alberts opened this issue Mar 16, 2012 · 4 comments
Closed

gccgo: some kind of thread/errno issue #3333

alberts opened this issue Mar 16, 2012 · 4 comments

Comments

@alberts
Copy link
Contributor

alberts commented Mar 16, 2012

What steps will reproduce the problem?

go build -compiler=gccgo -v hello.go
while true; do GOMAXPROCS=16 strace -f -ostrace.log ./hello || break; done

What is the expected output?

<7>2012-03-16T16:24:59Z,991900000,name,hello.go:131,main.Hello,test Go version:
weekly.2012-03-13 +a303acb0a5f2
<7>2012-03-16T16:24:59Z,994044000,name,hello.go:132,main.Hello,Pid=1504 Uid=1000
Gid=1000
<7>2012-03-16T16:24:59Z,994573000,name,hello.go:133,main.Hello,GOMAXPROCS=16
<7>2012-03-16T16:24:59Z,995347000,name,hello.go:138,main.Hello,RLIMIT_NOFILE={Cur:32768
Max:32768}
<7>2012-03-16T16:24:59Z,996315000,name,hello.go:138,main.Hello,RLIMIT_MEMLOCK={Cur:18446744073709551615
Max:18446744073709551615}
<7>2012-03-16T16:24:59Z,996987000,name,hello.go:138,main.Hello,RLIMIT_NPROC={Cur:1024
Max:32768}
<7>2012-03-16T16:24:59Z,997686000,name,hello.go:145,main.Hello,RLIMIT_MEMLOCK={Cur:18446744073709551615
Max:18446744073709551615}

What do you see instead?

sometimes it fails:

<7>2012-03-16T16:27:42Z,890122000,name,hello.go:131,go.main.Hello,test Go version:
xgcc (GCC) 4.8.0 20120316 (experimental)
<7>2012-03-16T16:27:42Z,953058000,name,:0,go.main.Hello,Pid=2177 Uid=1000 Gid=1000
<7>2012-03-16T16:27:42Z,954038000,name,hello.go:133,go.main.Hello,GOMAXPROCS=16
panic: getrlimit: Resource temporarily unavailable [recovered]
        panic: getrlimit: Resource temporarily unavailable

however, if you look at the strace, you can see:

getrlimit(RLIMIT_NPROC, {rlim_cur=1024, rlim_max=32*1024}) = 0

I think it's some kind of thread/errno issue.

Which compiler are you using (5g, 6g, 8g, gccgo)?

gccgo

Which operating system are you using?

linux, amd64

Which revision are you using?  (hg identify)

gccgo (GCC) 4.8.0 20120316 (experimental)

Please provide any additional information below.

everything works fine if I just build with

go build -compiler=gccgo -v hello.go

Failing strace also attached.

Depending on the machine, it might fail more readily with another value of GOMAXPROCS.
Maybe gccgo doesn't even care about GOMAXPROCS. It even fails with GOMAXPROCS=1.

Attachments:

  1. hello.go (3748 bytes)
  2. strace.log (93579 bytes)
@dsymonds
Copy link
Contributor

Comment 1:

Labels changed: added priority-go1, gccgo, removed priority-triage.

Owner changed to @ianlancetaylor.

@ianlancetaylor
Copy link
Contributor

Comment 2:

Thanks for the test case.  The bug is that syscall.Syscall and friends fail to call
SetErrno(0) before making the call.  It's too late for the gcc 4.7.0 release, so I'll
fix it for 4.7.1.

Labels changed: added priority-later, removed priority-go1.

@alberts
Copy link
Contributor Author

alberts commented Apr 8, 2012

Comment 3:

I think this is fixed?

@ianlancetaylor
Copy link
Contributor

Comment 4:

Yes, this is fixed now on tip.  Thanks for the reminder.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants