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

Crash at maxevals=100 #12

Open
improbable-22 opened this issue Jul 17, 2017 · 11 comments
Open

Crash at maxevals=100 #12

improbable-22 opened this issue Jul 17, 2017 · 11 comments
Labels

Comments

@improbable-22
Copy link

This gives a segmentation fault error:

using Cuba 
vegas((x, f) -> f[1] = cos(x[1]), maxevals=100)

It works fine at 1000, and also this works fine:

vegas((x, f) -> f[1] = cos(x[1]), nstart=99, nincrease=99, maxevals=100)

I get a similar error from other functions (suave, divonne, cuhre) at maxevals=100.

Cuba 0.4.0, Julia 0.6.0, on a mac.

@giordano
Copy link
Owner

Sorry, I can't reproduce :-/

julia> vegas((x, f) -> f[1] = cos(x[1]), maxevals=100)
Component:
 1: 0.8422538728757027 ± 0.004375690491875356 (prob.: -999.0)
Integrand evaluations: 1000
Fail:                  1
Number of subregions:  0

Can you please post the full crash log?

@giordano
Copy link
Owner

giordano commented Jul 17, 2017

One thing that you can try is to pin an old version (like v0.3.1) and see if vegas still crashes. In Julia run the command

Pkg.pin("Cuba", v"0.3.1")

then restart Julia and repeat

using Cuba 
vegas((x, f) -> f[1] = cos(x[1]), maxevals=100)

Anyway, a full crash log would still be very useful.

@improbable-22
Copy link
Author

OK thanks for taking a look! I've pasted in the whole log below. Will try the old version suggestion now.

               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.6.0 (2017-06-19 13:05 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/                   |  x86_64-apple-darwin13.4.0

julia> using Cuba

julia> vegas((x, f) -> f[1] = cos(x[1]), maxevals=100)

signal (11): Segmentation fault: 11
while loading no file, in expression starting on line 0
Integrate at /Users/me/.julia/v0.6/Cuba/deps/libcuba.dylib (unknown line)
llVegas at /Users/me/.julia/v0.6/Cuba/deps/libcuba.dylib (unknown line)
dointegrate at /Users/me/.julia/v0.6/Cuba/src/Cuba.jl:172 [inlined]
#vegas#4 at /Users/me/.julia/v0.6/Cuba/src/vegas.jl:105
unknown function (ip: 0x1237ebbaa)
#vegas at ./<missing>:0
#vegas at ./<missing>:0
unknown function (ip: 0x1237ea252)
do_call at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:75
eval at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:242
eval_body at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:539
jl_interpret_toplevel_thunk at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:692
jl_toplevel_eval_flex at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/toplevel.c:592
jl_toplevel_eval_in at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/builtins.c:496
eval at ./boot.jl:235
jlcall_eval_17976 at /Applications/Julia-0.6.app/Contents/Resources/julia/lib/julia/sys.dylib (unknown line)
eval_user_input at ./REPL.jl:66
jlcall_eval_user_input_20272 at /Applications/Julia-0.6.app/Contents/Resources/julia/lib/julia/sys.dylib (unknown line)
macro expansion at ./REPL.jl:97 [inlined]
#1 at ./event.jl:73
unknown function (ip: 0x1237e392f)
jl_apply at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/./julia.h:1424 [inlined]
start_task at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/task.c:267
Allocations: 1025872 (Pool: 1024743; Big: 1129); GC: 0

[Process completed]

@improbable-22
Copy link
Author

Using v0.3.1 as suggested, it now runs fine:

julia> Pkg.pin("Cuba", v"0.3.1")
INFO: Creating Cuba branch pinned.fcbd97ff.tmp
INFO: No packages to install, update or remove

julia> using Cuba
INFO: Recompiling stale cache file /Users/me/.julia/lib/v0.6/Cuba.ji for module Cuba.

julia> vegas((x, f) -> f[1] = cos(x[1]), maxevals=100)
([0.842254], [0.00437569], [-999.0], 1000, 1, 0)

julia> suave((x, f) -> f[1] = cos(x[1]), maxevals=100)
([0.842254], [0.00437569], [-999.0], 1000, 1, 1)

@giordano
Copy link
Owner

This is a weird issue. I tested maxevals=100 on AppVeyor and Travis and with both versions 0.3.1 and 0.4.0 of Cuba.jl:

As you can see, there are failures also with the previous version of the package. I'm running Julia 0.7 on GNU/Linux, which seems to be one of the few configurations that never fail.

Honestly, I can't understand what's wrong with maxevals=100. I'll try to track the culprit, but can't do any promise.

@improbable-22
Copy link
Author

OK thanks for having a look. For now I can work around it of course.

@giordano
Copy link
Owner

I asked for help on Discourse: it turned out this may actually be a bug in Cuba library. In particular, at line 24 of src/common/Random.c uninitialized memory is read.

Could you please report the issue to Thomas Hahn (Cuba's author)? You can find his contact at http://wwwth.mpp.mpg.de/members/hahn/ Maybe point him to the Discourse thread, were more information about the bug are provided.

@improbable-22
Copy link
Author

OK I sent him an email, with these links.

@giordano
Copy link
Owner

giordano commented Oct 1, 2017

Out of curiosity, did you get any reply?

@improbable-22
Copy link
Author

Hi giordano, no I did not hear anything.

@giordano
Copy link
Owner

I also tried to get in contact with him in the past, to no avail. So that's not only me. Thank you.

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