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

Segmentation fault when running C benchmarks #369

Open
2 tasks done
Planeshifter opened this issue Nov 29, 2020 · 1 comment
Open
2 tasks done

Segmentation fault when running C benchmarks #369

Planeshifter opened this issue Nov 29, 2020 · 1 comment
Labels
Accepted RFC feature request which has been accepted.

Comments

@Planeshifter
Copy link
Member

Checklist

Please ensure the following tasks are completed before filing a bug report.

  • Read and understood the Code of Conduct.
  • Searched for existing issues and pull requests.

Description

Description of the issue.

Am encountering a Segmentation fault (core dumped) error when running C benchmarks of mathematical functions.

Questions

Any questions for reviewers?

No.

Other

Any other information relevant to this issue? This may include screenshots, references, stack traces, sample output, and/or implementation notes.

The issue seems to be due to the benchmarks overflowing the default maximum stack size of 8 MB.
Increasing the stack size via e.g. ulimit -s 32767 causes the benchmarks to run properly.

We might want to rethink whether to allocate memory with malloc.

Reproduction

What steps are required to reproduce the unexpected output?

In order to reproduce this bug, do the following:

  • From the top-level stdlib directory, run
make benchmark-c BENCHMARKS_FILTER=.*/dsqrt/.*

Expected Results

What are the expected results?

The benchmarks should run without issues.

Actual Results

What are the actual results?

The following are the actual results:

(...)
ok 14 benchmark finished
# c::dsqrt:len=100000
  ---
  iterations: 1000
  elapsed: 0.429753065
  rate: 2326.917667814
  ...
ok 15 benchmark finished
# c::dsqrt:len=1000000
Makefile:133: recipe for target 'run' failed
make[1]: *** [run] Segmentation fault (core dumped)
make[1]: Leaving directory '/home/philipp/git/stdlib/lib/node_modules/@stdlib/math/strided/special/dsqrt/benchmark/c'
/home/philipp/git/stdlib/tools/make/lib/benchmark/c.mk:48: recipe for target 'benchmark-c' failed
make: *** [benchmark-c] Error 1

Environments

What environments are affected (e.g., Node v0.4.x, Chrome, IE 11)? If Node.js, include the npm version, operating system, and any other potentially relevant platform information.

The following environments are affected:

  • Linux Ubuntu
@kgryte
Copy link
Member

kgryte commented Aug 13, 2021

Linking to the relevant line(s) which would need to be changed across the project.

@Planeshifter Planeshifter added the Accepted RFC feature request which has been accepted. label Aug 13, 2021
@kgryte kgryte mentioned this issue Mar 26, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted RFC feature request which has been accepted.
Projects
None yet
Development

No branches or pull requests

2 participants