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

Bug Segmentation fault occurs because input Option compaction_style is not satinized #10957

Open
SHTUSIST opened this issue Nov 16, 2022 · 2 comments

Comments

@SHTUSIST
Copy link

SHTUSIST commented Nov 16, 2022

Expected behavior

When option compaction_style is set to 5 or bigger by the user, rocksdb should santinize user's input or just raise Status::InvalidArgument because there are only 4 compaction styles.

Actual behavior

However, DB could accept the options.compaction_style =5.

Rocksdb could run successfully for a while and will crash as "Segmentation fault (core dumped)" until it occurs compaction.

Also, set compaction_style to negative integer will trigger this bug as same reason.

Steps to reproduce the behavior

Just run db_bench like below:
./db_bench --benchmarks=fillrandom --compression_type=none --compaction_style=5 --num=5000000

After running a while, Segmentation fault (core dumped) occurs.

@SHTUSIST
Copy link
Author

Bug found by fuzzing.
If allowed, I could submit a PR to fix this bug

@cbi42
Copy link
Member

cbi42 commented Nov 17, 2022

Hi @SHTUSIST, feel free to open a PR for this.

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