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

fix(cli/bench): strace numeric format #16055

Merged
merged 1 commit into from
Sep 27, 2022

Conversation

marcosc90
Copy link
Contributor

@marcosc90 marcosc90 commented Sep 27, 2022

strace number format depends on LC_NUMERIC environment variable. This PR sets LC_NUMERIC to C to prevent strace from using decimal comma which causes the following line to panic:

percent_time: str::parse::<f64>(syscall_fields[0]).unwrap(),

To reproduce (on linux)

LC_NUMERIC=es_ES.UTF-8 cargo bench --bench deno_bench -- strace

Output can be tested by doing:

LC_NUMERIC=es_ES.UTF-8 strace -c -f -o /tmp/strace.out echo "deno"
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
  0,00    0,000000           0         1           read
  0,00    0,000000           0         1           write
------ ----------- ----------- --------- --------- ----------------
100.00    0,000000                    39         2 total

LC_NUMERIC=C strace -c -f -o /tmp/strace.out echo "deno"
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
  0.00    0.000000           0         3           read
  0.00    0.000000           0         1           write
------ ----------- ----------- --------- --------- ----------------
100.00    0.000000                    45         3 total

fixes #15743

https://github.com/denoland/deno/actions/runs/3134121413/jobs/5088284253

Copy link
Member

@littledivy littledivy left a comment

Choose a reason for hiding this comment

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

Oh, good catch! LGTM

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

LGTM too, thanks for fixing this @marcosc90!

@bartlomieju bartlomieju merged commit 980d65b into denoland:main Sep 27, 2022
@marcosc90 marcosc90 deleted the strace-number-format branch September 27, 2022 19:51
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.

Occasional panic in release benchmarks
3 participants