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

Segmentation fault in bb on Mac in CI #1861

Open
kevaundray opened this issue Aug 29, 2023 · 1 comment
Open

Segmentation fault in bb on Mac in CI #1861

kevaundray opened this issue Aug 29, 2023 · 1 comment
Labels
C-bb.js Component: bb.js - wrapping bberg in js

Comments

@kevaundray
Copy link
Contributor

Problem

Our Mac builds in CI have been failing tests and after debugging we are getting a segmentation fault when we try to memcpy the CRS.

The function that calls the memcpy barretenberg::srs::IO<curve::BN254>::read_affine_elements_from_buffer( points.data(), (char*)data.data(), num_points * 64); assumes that data.size() is more than num_points * 64.

This should be the case if we enter the if branch size >= num_points. However, the size parameter is saved independently of the number of points that are downloaded. This means that its possible to have a size parameter of 10Million, but only download 5 million points, due to a bad internet connection or if we want a CRS size which is larger than the number of points stored in transcript00.dat.

Solution

Short term: we can use the minimum of data.size() and num_points * 64.

Long term: There is another bug in this, if we want CRS's of large sizes then this will only ever download the first transcript, so ideally we figure out how many points each transcript holds, we then check the max circuit size and download as many transcripts as needed.

@kevaundray kevaundray added the C-bb.js Component: bb.js - wrapping bberg in js label Aug 29, 2023
@github-project-automation github-project-automation bot moved this to Todo in A3 Aug 29, 2023
@kevaundray
Copy link
Contributor Author

Will push a PR for the short term fix so that it unblocks donwstream and then push another fix to download the transcript properly and ensure that size is equal to the .dat file that gets downloaded

kevaundray added a commit that referenced this issue Aug 29, 2023
#1862)

related to #1861 

# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).
codygunton pushed a commit that referenced this issue Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bb.js Component: bb.js - wrapping bberg in js
Projects
Status: Todo
Development

No branches or pull requests

1 participant