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

runtime error: invalid memory address or nil pointer dereference #196

Closed
adamkrellenstein opened this issue Dec 22, 2014 · 7 comments · Fixed by #197
Closed

runtime error: invalid memory address or nil pointer dereference #196

adamkrellenstein opened this issue Dec 22, 2014 · 7 comments · Fixed by #197
Labels

Comments

@adamkrellenstein
Copy link

This error popped up when running the daemon (and processing RPC calls?).
go version: go1.3.3 linux/amd64

21:40:33 2014-12-21 [INF] BMGR: New valid peer 103.224.165.48:18333 (outbound) (/Satoshi:0.9.3/)
2014/12/21 21:40:35 http: panic serving [::1]:43739: runtime error: invalid memory address or nil pointer dereference
goroutine 11452 [running]:
net/http.func·011()
    /usr/lib/go/src/pkg/net/http/server.go:1100 +0xb7
runtime.panic(0xa326a0, 0xf39273)
    /usr/lib/go/src/pkg/runtime/panic.c:248 +0x18d
main.handleGetRawTransaction(0xc208060000, 0x7faffa8a05c8, 0xc208ff7260, 0xc208555ce0, 0x0, 0x0, 0x0, 0x0)
    /home/adam/go/src/github.com/conformal/btcd/rpcserver.go:2429 +0xb9f
main.standardCmdReply(0x7faffa8a05c8, 0xc208ff7260, 0xc208060000, 0xc208555ce0, 0x0, 0x0, 0x0, 0xc2098126c0)
    /home/adam/go/src/github.com/conformal/btcd/rpcserver.go:3280 +0x13d
main.jsonRPCRead(0x7faffa89ff80, 0xc208bd1040, 0xc208273930, 0xc208060000)
    /home/adam/go/src/github.com/conformal/btcd/rpcserver.go:654 +0xbdf
main.func·023(0x7faffa89ff80, 0xc208bd1040, 0xc208273930)
    /home/adam/go/src/github.com/conformal/btcd/rpcserver.go:310 +0x1db
net/http.HandlerFunc.ServeHTTP(0xc208b9bc80, 0x7faffa89ff80, 0xc208bd1040, 0xc208273930)
    /usr/lib/go/src/pkg/net/http/server.go:1235 +0x40
net/http.(*ServeMux).ServeHTTP(0xc2083df6b0, 0x7faffa89ff80, 0xc208bd1040, 0xc208273930)
    /usr/lib/go/src/pkg/net/http/server.go:1511 +0x1a3
net/http.serverHandler.ServeHTTP(0xc208c1c720, 0x7faffa89ff80, 0xc208bd1040, 0xc208273930)
    /usr/lib/go/src/pkg/net/http/server.go:1673 +0x19f
net/http.(*conn).serve(0xc20832dc00)
    /usr/lib/go/src/pkg/net/http/server.go:1174 +0xa7e
created by net/http.(*Server).Serve
    /usr/lib/go/src/pkg/net/http/server.go:1721 +0x313
2014/12/21 21:40:47 http: panic serving [::1]:43784: runtime error: invalid memory address or nil pointer dereference
goroutine 11556 [running]:
[...]
@adamkrellenstein
Copy link
Author

Update: this seems to be happening only on testnet, and pretty much every time I hit the API.

@adamkrellenstein
Copy link
Author

It actually happens when I call getrawtransaction e2134223d898d5f57305750a42664bc8e7ed8caee5597a51b20110221e88ab09 1, e.g. using bitcoin-cli -testnet.

@davecgh
Copy link
Member

davecgh commented Dec 22, 2014

Thanks. I'm looking into it now. Those line numbers appear to be off though from the current master (f1cbd40). Notice that line 654 in rpcserver.go is not the call the standardCmdReply as the trace indicates. I should be able to follow it regardless, but please do make sure you're updated to the latest.

@adamkrellenstein
Copy link
Author

Ah, I forgot to mention! I'm running allownotls, with --notls set.

@davecgh
Copy link
Member

davecgh commented Dec 22, 2014

I found the issue. I'll have a pr shortly which will properly show and return the error.

davecgh added a commit to davecgh/btcd that referenced this issue Dec 22, 2014
This commit corrects the error check from the createTxRawResult call in
handleGetRawTransaction.  It was previously given a different name which
resulted in the wrong error being checked.

Fixes btcsuite#196.
@davecgh
Copy link
Member

davecgh commented Dec 22, 2014

This should be resolved with pr #197. Also, you can use btcctl to interface with btcd though it should be fine with bitcoin-cli since they are intended to be compatible.

@davecgh davecgh added the bug label Dec 22, 2014
@adamkrellenstein
Copy link
Author

Great, thanks!

kcalvinalvin added a commit to kcalvinalvin/btcd that referenced this issue Nov 29, 2024
Remove heap allocations when flushing the nodes or cached leaves
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants