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

Fix crash on DHT start + processing core #47

Open
henriqueaklein opened this issue May 20, 2024 · 0 comments
Open

Fix crash on DHT start + processing core #47

henriqueaklein opened this issue May 20, 2024 · 0 comments

Comments

@henriqueaklein
Copy link
Contributor

For some reason the processing core and DHT Start don't play well and ends up crashing on Linux
This code crashes:

        pubsub_->GetDHT()->Start();

When this code is compiled:

processing_core_ = std::make_shared<processing::ProcessingCoreImpl>( globaldb_, 1000000, 2 );

Weirdly it doesn't need to run, the creation of the processing core can be called after the DHT Start and the side effect will occur before it ever runs and crashes on the boost library:

Image

The base_implementation_type contains null fields and that triggers a segfault (maybe because a socket '0' is valid).
If we remove the processing core initialization, this code never runs on the DHT Start and it doesn't crash.

@itsafuu also did some investigating and got to AsynnIOManager's singletons as the possible trigger (but probably not the issue). By commenting a couple of singleton creations the error seems to disappear:


void FileManager::InitializeSingletons() {
    sgns::MNNLoader::InitializeSingleton();
    sgns::MNNParser::InitializeSingleton();
    //sgns::SFTPLoader::InitializeSingleton();
    sgns::HTTPLoader::InitializeSingleton();
    //sgns::WSLoader::InitializeSingleton();
    sgns::IPFSLoader::InitializeSingleton();
    sgns::IPFSSaver::InitializeSingleton();
    sgns::MNNSaver::InitializeSingleton();
}

This needs investigating because it might be memory invasion or concurrency issues

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