Skip to content

runtime: allocated pages below zero on openbsd/riscv64 #63385

@4a6f656c

Description

@4a6f656c
#!watchflakes
post <- log ~ `fatal error: allocated pages below zero` && goos == "openbsd" && goarch == "riscv64"

The openbsd/riscv64 port is regularly failing with errors like:

runtime: inUse=0 npages=4
fatal error: allocated pages below zero?

https://build.golang.org/log/bb95405e34149982611770caf632d58e9bc50ff4
https://build.golang.org/log/e5fb11bcae4d4dab31c13f7e271852e39ae5a6df

This seems particularly reproducible (although still intermittent) via the TestArenaCollision test:

$ ../bin/go tool dist test -run runtime:cpu124                                          
                                                                                                                  
##### Test execution environment.                                                                                 
# GOARCH: riscv64                                                                                                 
# CPU:                                                                                                            
# GOOS: openbsd                                                                                                   
# OS Version: OpenBSD 7.4 OpenBSD 7.4 (GENERIC.MP) #423: Tue Oct  3 07:33:24 MDT 2023     [email protected]:/usr/src/sys/arch/riscv64/compile/GENERIC.MP  riscv64
                                                                                                                  
##### GOMAXPROCS=2 runtime -cpu=1,2,4 -quick                                                                      
--- FAIL: TestArenaCollision (0.26s)                                                                              
    malloc_test.go:284: === RUN   TestArenaCollision                                                              
            malloc_test.go:301: reserved [0x60000000, 0x64000000)                                                 
            malloc_test.go:301: reserved [0x54000000, 0x58000000)                                                 
            malloc_test.go:301: reserved [0xa0000000, 0xa4000000)
            malloc_test.go:301: reserved [0x70000000, 0x74000000)                                                 
            malloc_test.go:301: reserved [0xc8000000, 0xcc000000)                                                 
        runtime: inUse=0 npages=1                                                                                 
        fatal error: allocated pages below zero?

inUse always appears to be zero, while npages is some small positive value.

It would seem that this is specific to openbsd/riscv64 and possibly even a kernel/mmap related problem.

/cc @mknyszek any pointers in tracking this down would be greatly appreciated.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions