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
scylla $tool crashes if invoked without further args #16451
Comments
xemul
added a commit
that referenced
this issue
Dec 20, 2023
…from Botond Dénes Currently, `tool_app_template::run_async()` crashes when invoked with empty argv (with just `argv[0]` populated). This can happen if the tool app is invoked without any further args, e.g. just invoking `scylla nodetool`. The crash happens because unconditional dereferencing of `argv[1]` to get the current operation. To fix, add an early-exit for this case, just printing a usage message and exiting with exit code 2. Fixes: #16451 Closes #16456 * github.com:scylladb/scylladb: test: add regression tests for invoking tools with no args tools/utils: tool_app_template: handle the case of no args tools/utils: tool_app_template: remove "scylla-" prefix from app name
avikivity
pushed a commit
that referenced
this issue
Dec 20, 2023
…from Botond Dénes Currently, `tool_app_template::run_async()` crashes when invoked with empty argv (with just `argv[0]` populated). This can happen if the tool app is invoked without any further args, e.g. just invoking `scylla nodetool`. The crash happens because unconditional dereferencing of `argv[1]` to get the current operation. To fix, add an early-exit for this case, just printing a usage message and exiting with exit code 2. Fixes: #16451 Closes #16456 * github.com:scylladb/scylladb: test: add regression tests for invoking tools with no args tools/utils: tool_app_template: handle the case of no args tools/utils: tool_app_template: remove "scylla-" prefix from app name
mykaul
added
the
backport/5.4
Issues that should be backported to 5.4 branch once they'll be fixed
label
Dec 25, 2023
denesb
pushed a commit
that referenced
this issue
Jan 4, 2024
…from Botond Dénes Currently, `tool_app_template::run_async()` crashes when invoked with empty argv (with just `argv[0]` populated). This can happen if the tool app is invoked without any further args, e.g. just invoking `scylla nodetool`. The crash happens because unconditional dereferencing of `argv[1]` to get the current operation. To fix, add an early-exit for this case, just printing a usage message and exiting with exit code 2. Fixes: #16451 Closes #16456 * github.com:scylladb/scylladb: test: add regression tests for invoking tools with no args tools/utils: tool_app_template: handle the case of no args tools/utils: tool_app_template: remove "scylla-" prefix from app name (cherry picked from commit 5866d26)
Backported to 5.4. |
denesb
removed
Backport candidate
backport/5.4
Issues that should be backported to 5.4 branch once they'll be fixed
labels
Jan 4, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reproducer:
If any further args are passed, the crash doesn't happen.
The reason for the crash is unconditional dereferencing of
argv[1]
inscylladb/tools/utils.cc
Line 100 in a6200e9
Affected branches: 5.4+
The text was updated successfully, but these errors were encountered: