ebitengine / oto

♪ A low-level library to play sound on multiple platforms ♪
Apache License 2.0
1.59k stars 133 forks source link

building without optimization fails #182

Closed hajimehoshi closed 2 years ago

hajimehoshi commented 2 years ago
go build -tags=example "-gcflags=all=-N -l" -v ./...
# github.com/hajimehoshi/oto/v2/example
github.com/ebitengine/purego.SyscallN: nosplit stack over 792 byte limit
github.com/ebitengine/purego.SyscallN<1>
    grows 408 bytes, calls github.com/ebitengine/purego.syscall_syscall9X<1>
        grows 168 bytes, calls runtime.cgocall<1>
            grows 56 bytes, calls runtime.entersyscall<1>
                grows 32 bytes, calls runtime.reentersyscall<1>
                    grows 64 bytes, calls runtime.save<1>
                        grows 32 bytes, calls runtime.badctxt<1>
                            grows 32 bytes, calls runtime.throw<1>
                                grows 48 bytes, calls runtime.systemstack<0>
                                    grows 8 bytes, calls gosave_systemstack_switch<22>
                                        grows 8 bytes, calls runtime.abort<0>
                                        64 bytes over limit
                                    grows 8 bytes, calls indirect
                                        grows 8 bytes, calls runtime.morestack<0>
                                        64 bytes over limit
                                    grows 8 bytes, calls indirect
                                        grows 8 bytes, calls runtime.morestack<0>
                                        64 bytes over limit
                                grows 48 bytes, calls runtime.fatalthrow<1>
                                    grows 64 bytes, calls runtime.systemstack<0>
                                        grows 8 bytes, calls gosave_systemstack_switch<22>
                                            grows 8 bytes, calls runtime.abort<0>
                                            128 bytes over limit
                                        grows 8 bytes, calls indirect
                                            grows 8 bytes, calls runtime.morestack<0>
                                            128 bytes over limit
                                        grows 8 bytes, calls indirect
                                            grows 8 bytes, calls runtime.morestack<0>
                                            128 bytes over limit
...

(This is the same as hajimehoshi/ebiten#2264)

@TotallyGamerJet, please take a look, thanks.

hajimehoshi commented 2 years ago

With Go 1.17

# github.com/hajimehoshi/oto/v2/example
runtime.throw: nosplit stack overflow
    792 assumed on entry to github.com/ebitengine/purego.SyscallN<1> (nosplit)
    392 after github.com/ebitengine/purego.SyscallN<1> (nosplit) uses 400
    384 on entry to github.com/ebitengine/purego.syscall_syscall9X<1> (nosplit)
    224 after github.com/ebitengine/purego.syscall_syscall9X<1> (nosplit) uses 160
    216 on entry to runtime.cgocall<1> (nosplit)
    1[68](https://github.com/hajimehoshi/oto/runs/7952691393?check_suite_focus=true#step:8:69)  after runtime.cgocall<1> (nosplit) uses 48
    160 on entry to runtime.entersyscall<1> (nosplit)
    136 after runtime.entersyscall<1> (nosplit) uses 24
    128 on entry to runtime.reentersyscall<1> (nosplit)
    [72](https://github.com/hajimehoshi/oto/runs/7952691393?check_suite_focus=true#step:8:73)   after runtime.reentersyscall<1> (nosplit) uses 56
    64  on entry to runtime.save<1> (nosplit)
    40  after runtime.save<1> (nosplit) uses 24
    32  on entry to runtime.badctxt<1> (nosplit)
    8   after runtime.badctxt<1> (nosplit) uses 24
    0   on entry to runtime.throw<1> (nosplit)
    -40 after runtime.throw<1> (nosplit) uses 40