Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

nodeos crashing on occupied listener port of net_plugin #7909

Closed
ghost opened this issue Sep 13, 2019 · 7 comments
Closed

nodeos crashing on occupied listener port of net_plugin #7909

ghost opened this issue Sep 13, 2019 · 7 comments

Comments

@ghost
Copy link

ghost commented Sep 13, 2019

Run the following command twice from different terminals:
$nodeos -d ./data --config-dir ./config --contracts-console

Problem:
warn 2019-09-13T20:01:45.870 thread-0 controller.cpp:432 initialize_blockchai ] Initializing new blockchain with genesis state
info 2019-09-13T20:01:46.402 thread-0 chain_plugin.cpp:982 plugin_startup ] starting chain in read/write mode
info 2019-09-13T20:01:46.402 thread-0 chain_plugin.cpp:986 plugin_startup ] Blockchain started; head block is #1, genesis timestamp is 2018-06-01T12:00:00.000
./02-nodeos.sh: line 17: 31060 Segmentation fault: 11 $vg $nodeos -d ./data --config-dir ./config --contracts-console

Solution:
Proper error handling if bind of listener socket fails.

Test:
Run nodeos twice and on second time it should exit with proper error message.

@heifner
Copy link
Contributor

heifner commented Sep 13, 2019

What version of eosio? I'm unable to reproduce with 1.8.3.

@ghost
Copy link
Author

ghost commented Sep 13, 2019

Saw it on latest release/1.8.x d87164f
as well as on master 7116e88

@heifner
Copy link
Contributor

heifner commented Sep 13, 2019

I tested that commit of 1.8.3, what platform?

@ghost
Copy link
Author

ghost commented Sep 13, 2019

MACOS

Are we using the SO_REUSEADDR socket param on that listener? With that enabled it should not throw the exception. Perhaps this is already enabled per default on other platforms?

@heifner
Copy link
Contributor

heifner commented Sep 13, 2019

Yes, using acceptor->set_option(tcp::acceptor::reuse_address(true));
I tested on Ubuntu 18.10. I'll test mac on Monday.

@ghost
Copy link
Author

ghost commented Sep 13, 2019

If it's of any help, I've sent a valgrind.log on Telegram.

@heifner
Copy link
Contributor

heifner commented Sep 17, 2019

Fixed by #7931

@heifner heifner closed this as completed Sep 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant