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

no conversion for stoi when parsing --jobs=auto (without OPENMP) #2475

Closed
christopher-tilt-str opened this issue Mar 14, 2024 · 4 comments · Fixed by #2477
Closed

no conversion for stoi when parsing --jobs=auto (without OPENMP) #2475

christopher-tilt-str opened this issue Mar 14, 2024 · 4 comments · Fixed by #2477
Labels
bug - identified Bugs with an identified cause

Comments

@christopher-tilt-str
Copy link
Contributor

Found in version 2.4.1 (tag)
Build on Mac OS Apple Silicon according to build for Mac, OPENMP not installed

run souffle with --jobs=auto

Expected result

Runs with default number of cores

Actual result

Fails with atoi: no conversion

Cause

The code in MainDriver does correctly parse the case of --jobs=auto, however later uses call stoi() without considering the possibility of the argument not being an integer; and this leads to a crash when it's called as stoi("auto").

PR to follow

@quentin
Copy link
Member

quentin commented Mar 15, 2024

Thanks for the report.

By the way, since you are on Apple ARM, I must warn you that there might be some concurrency issues leading to crashes when OpenMP is enabled. I will open an issue about it.

@quentin quentin added the bug - identified Bugs with an identified cause label Mar 15, 2024
strRM pushed a commit to strRM/souffle that referenced this issue Mar 15, 2024
strRM pushed a commit to strRM/souffle that referenced this issue Mar 15, 2024
When passing `auto` to the jobs in non-OpenMP mode, the `"auto"` ends
up as an argument to `std::stoi` in  a couple of places, causing the
program to crash. We fix this by mapping `auto` to `1` when OpenMP
is not available.

Fixes souffle-lang#2475
@christopher-tilt-str
Copy link
Contributor Author

christopher-tilt-str commented Mar 15, 2024 via email

@quentin
Copy link
Member

quentin commented Mar 15, 2024

I created #2476 to track these issues.

@christopher-tilt-str
Copy link
Contributor Author

christopher-tilt-str commented Mar 15, 2024 via email

strRM pushed a commit to strRM/souffle that referenced this issue Mar 15, 2024
When passing `auto` to the jobs in non-OpenMP mode, the `"auto"` ends
up as an argument to `std::stoi` in  a couple of places, causing the
program to crash. We fix this by mapping `auto` to `1` when OpenMP
is not available.

Fixes souffle-lang#2475
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug - identified Bugs with an identified cause
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants