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 in vegas and suave with maxevals smaller than 256 #49

Closed
Hao-Phys opened this issue Feb 9, 2024 · 2 comments
Closed
Labels

Comments

@Hao-Phys
Copy link

Hao-Phys commented Feb 9, 2024

I got segmentation error when trying to pass maxevals to vegas.
Minimal example: vegas((x, f) -> f[1] = cos(x[1]); atol=1e-4, maxevals=20)

All other kwargs seem to work fine.
Machine info: Pop!_OS 22.04 LTS and Apple M2 (Sonoma).
Cuba version: v2.3.0

@giordano giordano changed the title Cannot pass maxevals kwargs Cannot pass maxevals kwargs smaller than 256 to vegas Feb 10, 2024
@giordano giordano changed the title Cannot pass maxevals kwargs smaller than 256 to vegas Cannot pass maxevals kwargs smaller than 256 to vegas and suave Feb 10, 2024
@giordano giordano changed the title Cannot pass maxevals kwargs smaller than 256 to vegas and suave Segmentation fault in vegas and suave with maxevals smaller than 256 Feb 10, 2024
@giordano
Copy link
Owner

I can reproduce the segmentation fault with

vegas((x, f) -> f[1] = cos(x[1]); atol=1e-4, maxevals=255)

but not

vegas((x, f) -> f[1] = cos(x[1]); atol=1e-4, maxevals=256)

So the problem isn't that you can't use maxevals at all, which is completely false (as demonstrated also by the maxevals=256 case), since there's a default value of

julia> Cuba.MAXEVALS
1000000

but that the Cuba C library crashes when you use a too small value for the number of maximum evaluations, the threshold being 256. Also, this is specific to vegas and suave, instead cuhre and divonne work fine. I have changed the title to more accurately describe the issue.

You will have to report the bug to the Cuba library author Thomas Hahn, I can't do anything about it.

@giordano
Copy link
Owner

Also, this is a duplicate of #12

@giordano giordano closed this as not planned Won't fix, can't repro, duplicate, stale Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants