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

core: Panic on login #3117

Open
davecgh opened this issue Dec 10, 2024 · 2 comments
Open

core: Panic on login #3117

davecgh opened this issue Dec 10, 2024 · 2 comments

Comments

@davecgh
Copy link
Member

davecgh commented Dec 10, 2024

I'm getting a panic on login with the master branch at commit 0030e49e0aa4159f2b55eee546c9083a51146c1e.

Prior to this, I started the MM bots and it crashed shortly after and now this happens on restart when logging in:

unexpected fault address 0x7fb960f94000
fatal error: fault
[signal SIGBUS: bus error code=0x2 addr=0x7fb960f94000 pc=0x87e46a]

goroutine 102 gp=0xc000569a40 m=3 mp=0xc000068e08 [running]:
runtime.throw({0x1e4fa22?, 0x7?})
        /home/davec/sdk/go1.23.4/src/runtime/panic.go:1067 +0x48 fp=0xc0000465b0 sp=0xc000046580 pc=0x477d88
runtime.sigpanic()
        /home/davec/sdk/go1.23.4/src/runtime/signal_unix.go:914 +0x10a fp=0xc000046610 sp=0xc0000465b0 pc=0x479f0a
go.etcd.io/bbolt.(*page).fastCheck(0x7fb960f94000, 0x173f)
        /home/davec/go/pkg/mod/go.etcd.io/[email protected]/page.go:57 +0x2a fp=0xc0000466d8 sp=0xc000046610 pc=0x87e46a
go.etcd.io/bbolt.(*Tx).page(0xc00826bdd0?, 0x1?)
        /home/davec/go/pkg/mod/go.etcd.io/[email protected]/tx.go:534 +0x7b fp=0xc000046710 sp=0xc0000466d8 pc=0x880e5b
go.etcd.io/bbolt.(*Bucket).pageNode(0x20?, 0xc000046ac0?)
        /home/davec/go/pkg/mod/go.etcd.io/[email protected]/bucket.go:748 +0x85 fp=0xc000046758 sp=0xc000046710 pc=0x871105
go.etcd.io/bbolt.(*Cursor).goToFirstElementOnTheStack(0xc000046860)
        /home/davec/go/pkg/mod/go.etcd.io/[email protected]/cursor.go:181 +0xc7 fp=0xc0000467b8 sp=0xc000046758 pc=0x872587
go.etcd.io/bbolt.(*Cursor).next(0xc000046860)
        /home/davec/go/pkg/mod/go.etcd.io/[email protected]/cursor.go:234 +0x52 fp=0xc0000467d8 sp=0xc0000467b8 pc=0x872892
go.etcd.io/bbolt.(*Cursor).Next(0x7fb978a4e79c?)
        /home/davec/go/pkg/mod/go.etcd.io/[email protected]/cursor.go:94 +0x27 fp=0xc000046830 sp=0xc0000467d8 pc=0x872127
go.etcd.io/bbolt.(*Bucket).ForEach(0xc000046900?, 0xc000046908)
        /home/davec/go/pkg/mod/go.etcd.io/[email protected]/bucket.go:396 +0x79 fp=0xc000046890 sp=0xc000046830 pc=0x86f979
decred.org/dcrdex/client/db/bolt.(*BoltDB).filteredMatches.func1(0xc000e7cb40?, 0xc0170a8100?)
        /home/davec/decred/dcrdex/client/db/bolt/db.go:1569 +0x15e fp=0xc000046948 sp=0xc000046890 pc=0x890e3e
decred.org/dcrdex/client/db/bolt.(*BoltDB).filteredMatches.(*BoltDB).matchesView.func2(0xc01072cc40)
        /home/davec/decred/dcrdex/client/db/bolt/db.go:1649 +0x84 fp=0xc0000469a0 sp=0xc000046948 pc=0x890c04
go.etcd.io/bbolt.(*DB).View(0x475f7f?, 0xc000046a58)
        /home/davec/go/pkg/mod/go.etcd.io/[email protected]/db.go:917 +0x6c fp=0xc000046a08 sp=0xc0000469a0 pc=0x8764ec
decred.org/dcrdex/client/db/bolt.(*BoltDB).matchesView(...)
        /home/davec/decred/dcrdex/client/db/bolt/db.go:1640
decred.org/dcrdex/client/db/bolt.(*BoltDB).filteredMatches(0x2a0000002a?, 0x2925fb0?, 0xf8?, 0x3?)
        /home/davec/decred/dcrdex/client/db/bolt/db.go:1563 +0x7a fp=0xc000046a78 sp=0xc000046a08 pc=0x890b1a
decred.org/dcrdex/client/db/bolt.(*BoltDB).MatchesForOrder(0x0?, {0xf, 0x2e, 0x8d, 0x61, 0xe1, 0x9c, 0x89, 0x30, 0x86, ...}, ...)
        /home/davec/decred/dcrdex/client/db/bolt/db.go:1550 +0x50 fp=0xc000046ac0 sp=0xc000046a78 pc=0x8909f0
decred.org/dcrdex/client/core.(*Core).dbTrackers(0xc000516c00, 0xc0000c3a00)
        /home/davec/decred/dcrdex/client/core/core.go:7366 +0x794 fp=0xc000046ee0 sp=0xc000046ac0 pc=0xa402d4
decred.org/dcrdex/client/core.(*Core).loadDBTrades(0xc000516c00, 0xc0000c3a00)
        /home/davec/decred/dcrdex/client/core/core.go:7456 +0x32 fp=0xc000047040 sp=0xc000046ee0 pc=0xa40d92
decred.org/dcrdex/client/core.(*Core).resolveActiveTrades(0xc000516c00, {0x2917740, 0xc000682050})
        /home/davec/decred/dcrdex/client/core/core.go:5241 +0x6d fp=0xc0000470b8 sp=0xc000047040 pc=0xa2d24d
decred.org/dcrdex/client/core.(*Core).Login(0xc000516c00, {0xc000bfe644, 0xa, 0xa})
        /home/davec/decred/dcrdex/client/core/core.go:4624 +0x3e5 fp=0xc000047280 sp=0xc0000470b8 pc=0xa27e05
decred.org/dcrdex/client/webserver.(*WebServer).actuallyLogin(0xc00037c1e0, {0x7fb99f9743f8, 0xc000bce740}, 0xc000344780, 0xc000bdc018?)
        /home/davec/decred/dcrdex/client/webserver/api.go:1511 +0x17d fp=0xc0000474d0 sp=0xc000047280 pc=0xbbfafd
decred.org/dcrdex/client/webserver.(*WebServer).apiLogin(0xc00037c1e0, {0x7fb99f9743f8, 0xc000bce740}, 0xc000344780)
        /home/davec/decred/dcrdex/client/webserver/api.go:1001 +0x106 fp=0xc000047588 sp=0xc0000474d0 pc=0xbbcbe6
decred.org/dcrdex/client/webserver.(*WebServer).apiLogin-fm({0x7fb99f9743f8?, 0xc000bce740?}, 0xc00066b5b8?)
        <autogenerated>:1 +0x36 fp=0xc0000475b8 sp=0xc000047588 pc=0xbd5876
...
@davecgh
Copy link
Member Author

davecgh commented Dec 10, 2024

It seems pretty likely from looking at the code that it's trying to range over a nil bucket with .ForEach over a nil bucket.

@davecgh
Copy link
Member Author

davecgh commented Dec 11, 2024

I was able to work around this by temporarily modifying the code to avoid the issue and it seems fine now, but there is clearly a bug that cause it to get into the state to begin with.

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

No branches or pull requests

1 participant