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

GSL.hypergeom error reporting failure due to bytestring on v0.6 #63

Closed
jwscook opened this issue Aug 3, 2017 · 1 comment
Closed

GSL.hypergeom error reporting failure due to bytestring on v0.6 #63

jwscook opened this issue Aug 3, 2017 · 1 comment

Comments

@jwscook
Copy link

jwscook commented Aug 3, 2017

First of all, thanks for GSL.jl! It's great!

Minor problem:

Incorrect inputs to the hypergeometric function 2F1 yielded this:

julia> using GSL
julia> a, b = [1.0, 2.0], 3.0
julia> GSL.hypergeom(a, b, 1.0)
ERROR: UndefVarError: bytestring not defined
Stacktrace:
 [1] custom_error_handler(::Ptr{UInt8}, ::Ptr{UInt8}, ::Int32, ::Int32) at /Users/james/.julia/v0.6/GSL/src/ConvertGSL.jl:18
 [2] hypergeom(::Array{Float64,1}, ::Float64, ::Float64) at /Users/james/.julia/v0.6/GSL/src/7_21_HypergeometricFunctions.jl:21

but after

cd /Users/james/.julia/v0.6/GSL/src/
for i in *; do sed -i 's/bytestring/string/g' "$i"; done

I get a DomainError

julia> GSL.hypergeom(a, b, 1.0)
ERROR: GSL Error: Ptr{Int8} @0x00000001233f4e28 -- Ptr{UInt8} @0x00000001233fd388 at Ptr{UInt8} @0x00000001233fe8cf:685
ERROR: DomainError:
Stacktrace:
 [1] custom_error_handler(::String, ::String, ::Int32, ::Int32) at /Users/james/.julia/v0.6/GSL/src/ConvertGSL.jl:35
 [2] custom_error_handler(::Ptr{UInt8}, ::Ptr{UInt8}, ::Int32, ::Int32) at /Users/james/.julia/v0.6/GSL/src/ConvertGSL.jl:18
 [3] hypergeom(::Array{Float64,1}, ::Float64, ::Float64) at /Users/james/.julia/v0.6/GSL/src/7_21_HypergeometricFunctions.jl:21
@ludvigak
Copy link
Collaborator

ludvigak commented Nov 1, 2017

If you don't want GSL to throw errors you can turn them off: https://www.gnu.org/software/gsl/manual/html_node/Error-Handlers.html

julia> using GSL
julia> a, b = [1.0, 2.0], 3.0;
julia> GSL.set_error_handler_off();
julia> GSL.hypergeom(a, b, 1.0)
NaN

giordano added a commit to giordano/GSL.jl that referenced this issue Oct 20, 2018
giordano added a commit to giordano/GSL.jl that referenced this issue Oct 22, 2018
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

No branches or pull requests

2 participants