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

Segfault #1

Open
DalenW opened this issue Feb 4, 2024 · 2 comments
Open

Segfault #1

DalenW opened this issue Feb 4, 2024 · 2 comments

Comments

@DalenW
Copy link

DalenW commented Feb 4, 2024

Here's what the debugger says:
Screenshot 2024-02-04 at 12 44 14 PM

@arthurlm
Copy link
Owner

arthurlm commented Feb 5, 2024

Looking at the locals variables from your screen capture here is my guess on what happen:

  1. i2 == 110
  2. i2 / 10 == 11
  3. i2 / 10 == b';' as u8 & 0x0F
  4. i2 / 10 == line[line.len() - 3]
  5. line.len() == 5
  6. line[2] = b';'
  7. line[4] = b'6' (because f=6)

So my guess is the input file you provide contains line with following format:

??;?6

As you can see, the parser I wrote rely a lot on unsafe code to strip out all check from the final x86 assembly.
Lines produced by the 1brc measures generator must respect the following regexp format:

\w+;-?\d{1,2}\.\d

Did you use the ./create_measurements.sh script provided in the official repository ? Or did you use another script to generate the input file ?

@DalenW
Copy link
Author

DalenW commented Feb 6, 2024

Yeah I did use a different script to generate the file. My bad. I'll try to rerun it with the script you mentioned when I find a time to do so.

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

2 participants