Skip to content
New issue

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

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

Already on GitHub? # to your account

Few tests don't pass on OpenBSD/adJ #30961

Open
vtamara opened this issue Dec 26, 2024 · 5 comments
Open

Few tests don't pass on OpenBSD/adJ #30961

vtamara opened this issue Dec 26, 2024 · 5 comments

Comments

@vtamara
Copy link

vtamara commented Dec 26, 2024

System information

Geth version geth version: 1.14.13-unstable-341647f1-20241219
CL client & version: ?
OS & Version: OpenBSD/adJ 7.6

Expected behaviour

gmake test

All tests passing

Actual behaviour

Most of the tests pass except:

--- FAIL: TestAccountNewBadRepeat (0.12s)                                                                                                                       
    test_cmd.go:261: (stderr:9) INFO [12-26|17:14:24.403] Maximum peer count                       ETH=50 total=50                                              
    test_cmd.go:261: (stderr:9) INFO [12-26|17:14:24.407] Smartcard socket not found, disabling    err="stat /var/run/pcscd/pcscd.comm: no such file or director
y"                                                                                                                                                              
    test_cmd.go:261: (stderr:9) Fatal: Passwords do not match                                                                                                   
    test_cmd.go:115: not enough output, got until ◊:                                                                                                            
        ---------------- (stdout text)                                                                                                                          
        Your new account is locked with a password. Please give a password. Do not forget this password.                                                        
        !! Unsupported terminal, password will be echoed.                                                                                                       
        Password:                                                                                                                                               
        Repeat password:                                                        
         

        ---------------- (expected text)                                                                                                                        
        Your new account is locked with a password. Please give a password. Do not forget this password.                                                        
        !! Unsupported terminal, password will be echoed.                                                                                                       
        Password:                                                                                                                                               
        Repeat password:                                                                                                                                        
        ◊Fatal: Passwords do not match                                                                                                                          
                                                                                                                                                                
--- FAIL: TestWalletImportBadPassword (0.20s)                                                                                                                   
    test_cmd.go:261: (stderr:18) INFO [12-26|17:14:24.968] Maximum peer count                       ETH=50 total=50                                             
    test_cmd.go:261: (stderr:18) INFO [12-26|17:14:24.972] Smartcard socket not found, disabling    err="stat /var/run/pcscd/pcscd.comm: no such file or directo
ry"                                                                                                                                                             
    test_cmd.go:261: (stderr:18) Fatal: could not decrypt key with given password                                                                               
    test_cmd.go:115: not enough output, got until ◊:                                                                                                            
        ---------------- (stdout text)                                                                                                                          
        !! Unsupported terminal, password will be echoed.                                                                                                       
        Password:                                                                                                                                               
                                                                                                                                                                
        ---------------- (expected text)                                                                                                                        
        !! Unsupported terminal, password will be echoed.                                                                                                       
        Password:                                                                                                                                               
        ◊Fatal: could not decrypt key with given password
         

--- FAIL: TestAccountImport (0.00s)                                                                                                                             
    --- FAIL: TestAccountImport/invalid_character (0.09s)                                                                                                       
        test_cmd.go:261: (stderr:25) Fatal: Failed to load the private key: invalid character '1' at end of key file                                            
        test_cmd.go:115: not enough output, got until ◊:                                                                                                        
            ---------------- (stdout text)                                                                                                                      
                                                                                                                                                                
            ---------------- (expected text)                                                                                                                    
            ◊Fatal: Failed to load the private key: invalid character '1' at end of key file                                                                    
                                                                                                                                                                
--- FAIL: TestCustomBackend (2.78s)
...
        Fatal: Failed to register the Ethereum service: db.engine choice was pebble but found pre-existing leveldb database in specified data directory         
FAIL                                                                                                                                                            
FAIL    github.com/ethereum/go-ethereum/cmd/geth        4.880s
...
panic: cannot allocate 67108864 bytes via mmap: cannot allocate memory [recovered]                                                                              
        panic: cannot allocate 67108864 bytes via mmap: cannot allocate memory 
FAIL    github.com/ethereum/go-ethereum/core/state      7.340s
...
fatal error: runtime: out of memory
...
FAIL    github.com/ethereum/go-ethereum/eth/protocols/snap      18.211s

Steps to reproduce the behaviour

gmake test

Backtrace

@Kazholy
Copy link

Kazholy commented Dec 27, 2024


@Kazholy
Copy link

Kazholy commented Dec 27, 2024

Think

@holiman
Copy link
Contributor

holiman commented Jan 9, 2025

Thanks for the report. We don't have a lot of openbsd users, we'd need someone with openbsd to help investigate this. Alternatively, do you know of some easy:ish way to emulate/simulate an openbsd container?

@holiman
Copy link
Contributor

holiman commented Jan 9, 2025

IT's likely related to this method (cmd/utils/cmd.go);

// Fatalf formats a message to standard error and exits the program.
// The message is also printed to standard output if standard error
// is redirected to a different file.
func Fatalf(format string, args ...interface{}) {
	w := io.MultiWriter(os.Stdout, os.Stderr)
	if runtime.GOOS == "windows" {
		// The SameFile check below doesn't work on Windows.
		// stdout is unlikely to get redirected though, so just print there.
		w = os.Stdout
	} else {
		outf, _ := os.Stdout.Stat()
		errf, _ := os.Stderr.Stat()
		if outf != nil && errf != nil && os.SameFile(outf, errf) {
			w = os.Stderr
		}
	}
	fmt.Fprintf(w, "Fatal: "+format+"\n", args...)
	os.Exit(1)
}

Most likely The SameFile check below doesn't work on Windows. -- this is probably also true for openbsd.

@holiman
Copy link
Contributor

holiman commented Jan 9, 2025

Also, this is odd:

panic: cannot allocate 67108864 bytes via mmap: cannot allocate memory [recovered]                                                                              

Afaict, we don't use mmap directly, I guess it must be some library that uses mmap.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

4 participants