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

UB reproducibility #191

Closed
o0101 opened this issue Apr 13, 2021 · 4 comments
Closed

UB reproducibility #191

o0101 opened this issue Apr 13, 2021 · 4 comments
Assignees
Labels

Comments

@o0101
Copy link
Contributor

o0101 commented Apr 13, 2021

Hey @rurban

Thanks a lot for your work on SMHasher. It's really changed a lot in the last 3 years, all because of the effort you put in. The project's so much bigger than it was before, and better, thanks to your effort. I, and I'm sure a lot of others, really appreciate what you're doing.

Anyway, I'm sure you're super busy so I get if you can't get to this, or if anything makes it impossible for you and that's cool, everyone's got different degrees of freedom there, but I was just wondering about something and I have a pretty stupid question so I'm sorry.

Question is: how do I reproduce the "UB" claims you make against some of the hashes? Specifically I'm trying to repro on my hashes discohash and beamsplitter so I can try to address the UB flags you put against them. I tried,

$ clang++ -fsanitize=undefined *.cpp

on my discohash repo and it compiled fine. Sorry I'm not an expert in this and I know it's not your job, so if you can't reply that's cool. I'm just wondering, how do I do it like you did it so I can reproduce the behaviour you're seeing?

Anyway, I get if you're too busy to reply or if anything else means you can't get to this and that's cool, everyone has different degrees of freedom there, I wish you all the best in SMHasher and have a great 2021!

Cris

@rurban
Copy link
Owner

rurban commented Apr 13, 2021

ubsan is a runtime check!

@o0101 o0101 closed this as completed Apr 14, 2021
@o0101
Copy link
Contributor Author

o0101 commented Apr 14, 2021

If you know how I can reproduce the behavior you're seeing and you let me know how to do that I might work on a fix.

@o0101 o0101 reopened this Apr 14, 2021
@o0101 o0101 closed this as completed Apr 14, 2021
@rurban rurban reopened this Apr 14, 2021
@o0101 o0101 closed this as completed Apr 14, 2021
@rurban
Copy link
Owner

rurban commented Apr 17, 2021

Use the Debug CMAKE_BUILD_TYPE and run smhasher with your hash.

mkdir Debug
cd Debug
cmake .. -DCMAKE_BUILD_TYPE=Debug
make
./SMHasher BEBB4185

If the UB is fixed in-between please file a ticket.
For now it reports

--- Testing BEBB4185 "BEBB4185 64" POOR

[[[ Sanity Tests ]]]

Verification value 0xBEBB4185 ....... PASS
discohash.cpp:97:36: runtime error: load of misaligned address 0x6120000001e1 for type 'const uint64_t', which requires 8 byte alignment
0x6120000001e1: note: pointer points here
 2b 9d 0f  3c ae 43 09 bc 25 8f e6  cf 1b 9a 2f 99 89 b8 c9  22 f9 b9 11 f1 35 df 03  37 dc 62 fc 63
              ^ 
discohash.cpp:98:17: runtime error: load of misaligned address 0x6120000001e1 for type 'const uint64_t', which requires 8 byte alignment
0x6120000001e1: note: pointer points here
 2b 9d 0f  3c ae 43 09 bc 25 8f e6  cf 1b 9a 2f 99 89 b8 c9  22 f9 b9 11 f1 35 df 03  37 dc 62 fc 63

@rurban rurban reopened this Apr 17, 2021
@rurban rurban self-assigned this Apr 17, 2021
@rurban rurban closed this as completed Apr 17, 2021
@o0101
Copy link
Contributor Author

o0101 commented Apr 21, 2021

Thankyou @rurban ! ☺️

o0101 added a commit to o0101/smhasher that referenced this issue Jun 23, 2023
@o0101 o0101 mentioned this issue Jun 23, 2023
o0101 added a commit to o0101/smhasher that referenced this issue Jun 24, 2023
- Change FORCE_INLINE to static inline
- Make windows happy? Blargh...need to use dynamic memory instead of VLA...
- Correct verif value
- Delete unused
- Add line for 256 for info
- Name: DISCoHAsH
o0101 added a commit to o0101/smhasher that referenced this issue Jun 24, 2023
- Change FORCE_INLINE to static inline
- Make windows happy? Blargh...need to use dynamic memory instead of VLA...
- Correct verif value
- Delete unused
- Add line for 256 for info
- Name: DISCoHAsH
- Squashed
rurban pushed a commit that referenced this issue Jun 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants