-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
"invalid memory address or nil pointer dereference" in echo
example
#263
Comments
same error 2018/01/16 14:31:48 listening for connections goroutine 32 [running]: |
@masonforest msmux "github.com/whyrusleeping/go-smux-multistream" |
There is even simpler fix: opts := []libp2p.Option{
libp2p.ListenAddrStrings(fmt.Sprintf("/ip4/127.0.0.1/tcp/%d", listenPort)),
libp2p.Identity(priv),
libp2p.Muxer(libp2p.DefaultMuxer()), // <<
} |
However ,the DefaultMuxer didn't include /echo/1.0.0 protocol which will be used in NewStream(). |
Strange, why it works then? |
@FRANKzsx the package name rule is another big problem for this project. Why not just name it as "github.com/whyrusleeping/goSmuxMultistream" ,and import it as goSmuxMultistream ? |
@bronze1man Yes,you are right. I followed the importing of project habits. But it may be better to use directly package name for example. At least, I should declare this package import. Thank you very much. |
@dmbreaker I feel strange, too. |
@FRANKzsx I was having the same error when creating an even more basic example for myself by splitting out the listen code from the dial code. Adding the default mux line worked for me. I can share the code if you want. |
I believe this has now been fixed. @nuxibyte, @FRANKzsx, @masonforest could you pull and try again? |
Yep! It works! 👍 Thanks :) |
This issuse still crops up when using |
Hello, thanks for building libp2p! Decentralize the world! 😃
I'm getting an nil pointer dereference when I run the second instance of the
echo
example.Steps to reproduce from a clean install:
Here's the full traceback.
It looks like it has something to do with
smuxConn
not being set here?Thanks again,
-Mason
The text was updated successfully, but these errors were encountered: