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: Fix nil bookie panic in core.Book(...) #2642

Merged
merged 2 commits into from
Jan 6, 2024

Conversation

ukane-philemon
Copy link
Contributor

@ukane-philemon ukane-philemon commented Dec 26, 2023

To reproduce, just call the core.Book method for any market.

I already discarded the original log, but this is from Cryptopower:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1058897]

goroutine 3038 [running]:
decred.org/dcrdex/client/core.(*bookie).translateBookSide(0x0, {0xc009ffa160, 0x3, 0x7?})
        /home/joe/go/pkg/mod/github.com/ukane-philemon/[email protected]/client/core/bookie.go:589 +0x77
decred.org/dcrdex/client/core.(*Core).Book(0xc0037fe000, {0xc0051de020?, 0x1?}, 0x0?, 0x0?)
        /home/joe/go/pkg/mod/github.com/ukane-philemon/[email protected]/client/core/bookie.go:577 +0x891
github.com/crypto-power/cryptopower/ui/page/dcrdex.(*DEXMarketPage).setServerMarkets.func1()
        /home/joe/git/cryptopower/ui/page/dcrdex/market.go:334 +0x64
created by github.com/crypto-power/cryptopower/ui/page/dcrdex.(*DEXMarketPage).setServerMarkets in goroutine 55
        /home/joe/git/cryptopower/ui/page/dcrdex/market.go:332 +0x489

Copy link
Member

@buck54321 buck54321 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be done in +3 lines master...buck54321:bookpanic

Same thing, right?

@ukane-philemon
Copy link
Contributor Author

Yh, but I wanted to get rid of the "long" block of if statement.

@buck54321
Copy link
Member

Yh, but I wanted to get rid of the "long" block of if statement.

No thank you.

@ukane-philemon
Copy link
Contributor Author

Okay, one moment.

Signed-off-by: Philemon Ukane <[email protected]>
@buck54321 buck54321 merged commit 475ae4e into decred:master Jan 6, 2024
5 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.

4 participants