Skip to content

Add segfault check to running scripts#777

Open
scanhex12 wants to merge 1 commit intomainfrom
segfault_check
Open

Add segfault check to running scripts#777
scanhex12 wants to merge 1 commit intomainfrom
segfault_check

Conversation

@scanhex12
Copy link
Member

Thank You for Your Contribution!

We appreciate your effort and contribution to the project. To ensure that your Pull Request (PR) adheres to our guidelines, please ensure to review the rules mentioned in our contribution guidelines:

ClickHouse/ClickBench Contribution Rules

Thank you for your attention to these details and for helping us maintain the quality and integrity of the project.

@rschu1ze rschu1ze self-assigned this Feb 4, 2026
for i in $(seq 1 $TRIES); do
RES=$(clickhouse-client --host "${FQDN:=localhost}" --password "${PASSWORD:=}" ${PASSWORD:+--secure} --time --format=Null --query="$query" --progress 0 2>&1 ||:) # (*)
[[ "$?" == "0" ]] && echo -n "${RES}" || echo -n "null"
OUT=$(clickhouse-client --host "${FQDN:=localhost}" --password "${PASSWORD:=}" ${PASSWORD:+--secure} --time --format=Null --query="$query" --progress 0 2>&1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OUT --> CMD?

[[ "$?" == "0" ]] && echo -n "${RES}" || echo -n "null"
OUT=$(clickhouse-client --host "${FQDN:=localhost}" --password "${PASSWORD:=}" ${PASSWORD:+--secure} --time --format=Null --query="$query" --progress 0 2>&1)
CH_EXIT=$?
RES=$(printf '%s\n' "$OUT" | tail -n1) # (*)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# (*) should relate to l. 20.


[[ "$CH_EXIT" == "0" ]] && echo -n "${RES}" || echo -n "null"
[[ "$i" != $TRIES ]] && echo -n ", "
[[ "$CH_EXIT" == "139" ]] && echo "SEGFAULT: q=${QUERY_NUM} try=${i} ${RES}" >&2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The scripts to run submissions in an unattended amnner actually make some expectations how the output looks like:

Basically: In case of a segfault, we need to print null. We actually did that already before.

To give some background: ClickBench focuses on runtimes for successful queries. If a query doesn't run, it doesn't penalize it based on the reason for this (OOM, crash, etc.).

No such assumptions exist for the format of result.csv (l. 28) but I guess it will be nice to keep its content in-sync with the result that is printed to stdout.

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

Successfully merging this pull request may close these issues.

2 participants