]> Cypherpunks repositories - gostls13.git/commit
test/nosplit: apply stack limit adjustment in the right place
authorAustin Clements <austin@google.com>
Mon, 4 Apr 2022 18:51:39 +0000 (14:51 -0400)
committerAustin Clements <austin@google.com>
Tue, 19 Apr 2022 15:59:24 +0000 (15:59 +0000)
commit120f445495a573f80b1f0c0acc326c281c01b13e
tree65bac4326613569314b766f3ac90dbd29722283c
parent5f625de4d09843ba1c996019abaddd1f85840f56
test/nosplit: apply stack limit adjustment in the right place

The nosplit test was originally written when the stack limit was a
mere 128 bytes. Now it's much larger, but rather than rewriting all of
the tests, we apply a hack to just add the extra space into the stack
frames of the existing tests.

Unfortunately, we add it in the wrong place. The extra space should be
added just once per chain of nosplit functions, but instead we add it
to every frame that appears first on a line in the test's little
script language. This means that for tests like

    start 0 call f1
    f1 16 nosplit call f2
    f2 16 nosplit call f3
    f3 16 nosplit call f4
    f4 16 nosplit call f5
    f5 16 nosplit call f6
    f6 16 nosplit call f7
    f7 16 nosplit call f8
    f8 16 nosplit call end
    end 1000
    REJECT

we add 672 bytes to *every* frame, meaning that we wind up way over
the stack limit by the end of the stanza, rather than just a little as
originally intended.

Fix this by instead adding the extra space to the first nosplit
function in a stanza. This isn't perfect either, since we could have a
nosplit -> split -> nosplit chain, but it's the best we can do without
a graph analysis.

Change-Id: Ibf156c68fe3eb1b64a438115f4a17f1a6c7e2bd1
Reviewed-on: https://go-review.googlesource.com/c/go/+/398174
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
test/nosplit.go