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

getAddresses with BCH causes segmentation fault #256

Closed
ClementPavue opened this issue Mar 25, 2019 · 3 comments
Closed

getAddresses with BCH causes segmentation fault #256

ClementPavue opened this issue Mar 25, 2019 · 3 comments

Comments

@ClementPavue
Copy link

Execute the code below makes BlockSci crashes

Expected Result

Get addresses from the mega clusters

Actual Result

SIGSEGV

Reproduction Steps

Addresse a = getAddressFromString("12D5aJQQ7JsRdh42wdMwBFLYVLSFmh2RY2", ...)
if(a){
  Cluster c = cm.getCluster(a,...);
  auto addresses = c.getAddresses() | ranges::to_vector; <----- Crash here
}

System Information

BlockSci version: 0.6
Using AMI: no
Total memory:64Gb

@maltemoeser
Copy link
Member

Does this only happen with the mega cluster?

@ClementPavue
Copy link
Author

I tried with other smaller clusters ( 1 millions addresses ) and the code above works yes

maltemoeser added a commit that referenced this issue May 14, 2019
We previously relied on the loop being in ascending order to overwrite smaller values when there duplicate keys, which holds on MacOS but not on Ubuntu 16.04. On Ubuntu, when an address type wasn’t used (producing duplicate keys), the lower address type would be stored in the map, and as a result addresses were being serialized with the wrong address type. This would then lead to segfaults when trying to re-instantiate these addresses (e.g., when iterating over addresses in a cluster).

Fixes: #256, #273
@maltemoeser
Copy link
Member

This should be fixed now with the latest v0.6, you'll need to re-run the clustering.

There was an issue where, if there were no addresses of type WITNESS_UNKNOWN, then during clustering addresses of type NONSTANDARD were serialized as WITNESS_UNKNOWN, leading to the crash when trying to reinstantiate these addresses.

Curiously, this only happened on Ubuntu, where a map was iterated over in a different order than on MacOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants