<p dir="auto">by <strong>quaggy</strong>:</p>
<pre class="notranslate">What steps will reproduce the problem?
1. Compile bug.go
2. Run bug

What is the expected output?
EOF EOF

What do you see instead?
&lt;nil&gt; EOF

What is your $GOOS?  $GOARCH?
darwin and amd64

Which revision are you using?
7d7941a84d46 tip

Please provide any additional information below.

f() always returns nil. g() always returns the err from h(). Both functions
should behave the same way.

func f() (err os.Error) {
    if n, err := h(); err == nil {
        fmt.Println(n)
    }   
    return
}

func g() (err os.Error) {
    n, err := h() 
    if err == nil {
        fmt.Println(n)
    }   
    return
}</pre>
<p dir="auto">Attachments:</p>
<ol dir="auto">
<li><a href="https://storage.googleapis.com/go-attachment/514/0/bug.go" rel="nofollow">bug.go</a> (332 bytes)</li>
</ol>
<p dir="auto">by <strong>mikaelbrg</strong>:</p>
<pre class="notranslate">When building my project using "go build" (or "go install"), I get
an error "main.init: nosplit stack overflow":

C:\Users\mikaelbe\work\tigerslam&gt;go build robot
# robot
main.init: nosplit stack overflow
        120     guaranteed after split check in main.init
        112     on entry to robot/web.init
        104     on entry to robot/controller.init
        96      on entry to robot/slam.init
        88      on entry to robot/slam/hector.init
        80      on entry to hectormapping/map/mapimages.init
        72      on entry to hectormapping/map/maprep.init
        64      on entry to hectormapping/map/mapproccontainer.init
        56      on entry to hectormapping/scanmatcher.init
        48      on entry to hectormapping/map/gridmap/occbase.init
        40      on entry to hectormapping/map/gridmap/base.init
        32      on entry to hectormapping/map/gridmap.init
        24      on entry to github.com/skelterjohn/go%2ematrix.init
        16      on entry to math.init
        8       on entry to math.init┬À1
        0       on entry to runtime.panicindex
        -8      on entry to runtime.morestack00
runtime.main: nosplit stack overflow
        120     guaranteed after split check in runtime.main
        128     after runtime.main uses -8
        120     on entry to main.init
        112     on entry to robot/web.init
        104     on entry to robot/controller.init
        96      on entry to robot/slam.init
        88      on entry to robot/slam/hector.init
        80      on entry to hectormapping/map/mapimages.init
        72      on entry to hectormapping/map/maprep.init
        64      on entry to hectormapping/map/mapproccontainer.init
        56      on entry to hectormapping/scanmatcher.init
        48      on entry to hectormapping/map/gridmap/occbase.init
        40      on entry to hectormapping/map/gridmap/base.init
        32      on entry to hectormapping/map/gridmap.init
        24      on entry to github.com/skelterjohn/go%2ematrix.init
        16      on entry to math.init
        8       on entry to math.init┬À1
        0       on entry to runtime.panicindex
        -8      on entry to runtime.morestack00

("┬À1" is displayed like that in the console. I don't know if this is a
hint at where the bug might arise.)

This happened after I moved some code to create more logical and reusable packages. If I
remove all references to the "hectormapping" package, the program will build
successfully. "go build hectormapping" also works.

What steps will reproduce the problem?
1. Build "robot" package: <a href="https://bitbucket.org/mikaelbe/tigerslam" rel="nofollow">https://bitbucket.org/mikaelbe/tigerslam</a>

What is the expected output?
robot executable

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

Which operating system are you using?
Windows 7 (x64)

Which version are you using?  (run 'go version')
go version go1.0.3</pre>