Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

pkg: avoid log.Fatal calls #5700

Merged
merged 3 commits into from
Jan 29, 2025
Merged

Conversation

a-nogikh
Copy link
Collaborator

These calls prevent graceful error handling in the caller code. We should just return error and let individual tools decide what to do.

@a-nogikh a-nogikh force-pushed the features/fewer-fatalf branch 5 times, most recently from 0b3c716 to 35898d9 Compare January 27, 2025 13:56
@a-nogikh a-nogikh changed the title WIP: pkg: avoid log.Fatal calls pkg: avoid log.Fatal calls Jan 27, 2025
@a-nogikh a-nogikh force-pushed the features/fewer-fatalf branch from 35898d9 to c2f73fb Compare January 27, 2025 15:24
@a-nogikh a-nogikh marked this pull request as ready for review January 27, 2025 15:25
@a-nogikh a-nogikh requested a review from dvyukov January 27, 2025 15:27
@a-nogikh
Copy link
Collaborator Author

@dvyukov This PR has so many little changes to the tricky parts of the code that there's a high risk that I introduced some new concurrency/synchronization bugs to syzkaller. The PR needs a careful code review.

If there's any way to do those changes in a simpler way, please let me know.

@a-nogikh a-nogikh force-pushed the features/fewer-fatalf branch from c2f73fb to bed36b4 Compare January 27, 2025 16:46
@a-nogikh
Copy link
Collaborator Author

a-nogikh commented Jan 27, 2025

On my workstation it fails specifically on the recently added align3 test

$ ./tools/syz-env go test  ./pkg/runtest/ -run TestUnit/32_fork -v 
gcr.io/syzkaller/env:latest
=== RUN   TestUnit
=== RUN   TestUnit/32_fork
=== PAUSE TestUnit/32_fork
=== CONT  TestUnit/32_fork
    run.go:77: align0 none                           : OK
    run.go:77: align0 none/thr                       : OK
    run.go:77: align0_be none                        : SKIP (excluded by constraints)
    run.go:77: align0_be none/thr                    : SKIP (excluded by constraints)
    run.go:77: align3 none                           : FAIL: run 0: wrong call 0 result 9, want 0
    run.go:77: align3 none/thr                       : FAIL: run 0: wrong call 0 result 9, want 0
    run.go:77: bf none                               : OK
    run.go:77: bf none/thr                           : OK
< ... >
    run.go:77: zero_args none                        : OK
    run.go:77: zero_args none/thr                    : OK
    run.go:77: ok: 29, broken: 0, skip: 11, fail: 2
    run_test.go:121: tests failed
--- FAIL: TestUnit (0.00s)
    --- FAIL: TestUnit/32_fork (6.05s)
FAIL
FAIL    github.com/google/syzkaller/pkg/runtest 14.689s

@a-nogikh a-nogikh force-pushed the features/fewer-fatalf branch from bed36b4 to 12fcd25 Compare January 27, 2025 16:52
@a-nogikh
Copy link
Collaborator Author

a-nogikh commented Jan 27, 2025

Ah, okay, the test fails on the upstream code as well -- we set -short on our CI and the align3 program is never run there.

pkg/flatrpc/conn.go Outdated Show resolved Hide resolved
pkg/flatrpc/conn.go Show resolved Hide resolved
pkg/manager/diff.go Outdated Show resolved Hide resolved
pkg/manager/diff.go Outdated Show resolved Hide resolved
pkg/manager/diff.go Show resolved Hide resolved
pkg/rpcserver/local.go Outdated Show resolved Hide resolved
pkg/rpcserver/local.go Outdated Show resolved Hide resolved
pkg/rpcserver/rpcserver.go Outdated Show resolved Hide resolved
pkg/rpcserver/rpcserver.go Outdated Show resolved Hide resolved
pkg/rpcserver/rpcserver.go Show resolved Hide resolved
@a-nogikh a-nogikh force-pushed the features/fewer-fatalf branch 3 times, most recently from 9a61a88 to 91d031b Compare January 28, 2025 10:09
This enables graceful error handling in the caller code.
Apply necessary changes to pkg/flatrpc and pkg/manager as well.
There's a 15 minutes timer in the diff fuzzer that needs to be
conditional on the context object.
@a-nogikh a-nogikh force-pushed the features/fewer-fatalf branch from 91d031b to dd2261d Compare January 28, 2025 10:14
@a-nogikh
Copy link
Collaborator Author

PTAL

@a-nogikh a-nogikh added this pull request to the merge queue Jan 29, 2025
Merged via the queue into google:master with commit d03b0c9 Jan 29, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants