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

GTPSA bombs out of Julia on error #110

Closed
DavidSagan opened this issue May 15, 2024 · 3 comments
Closed

GTPSA bombs out of Julia on error #110

DavidSagan opened this issue May 15, 2024 · 3 comments

Comments

@DavidSagan
Copy link
Member

Instead of throwing a Julia error the following bombs out of Julia and returns to the Unix command line:

julia> using GTPSA

julia> x = vars()

[82309] signal (11.2): Segmentation fault: 11
in expression starting at REPL[2]:1
unsafe_load at ./pointer.jl:119 [inlined]
unsafe_load at ./pointer.jl:119 [inlined]
numvars at /Users/dcs16/.julia/dev/GTPSA/src/utils.jl:16 [inlined]
vars at /Users/dcs16/.julia/dev/GTPSA/src/ctors.jl:18
vars at /Users/dcs16/.julia/dev/GTPSA/src/ctors.jl:18
unknown function (ip: 0x104ac8093)
... etc.
jl_repl_entrypoint at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-10/src/jlapi.c:731
Allocations: 2906 (Pool: 2898; Big: 8); GC: 0
Segmentation fault: 11
MAC:~/.julia/dev/GTPSA> 
@mattsignorelli
Copy link
Contributor

mattsignorelli commented May 15, 2024

This is actually a Julia bug, and is occurring because there is no Descriptor defined. It attempts to use the default Descriptor (which is null) and when "getting" the numvar of that Descriptor it segfaults

Since I don't expect vars to be called often, I could put the check in there (as well as complexvars, params, complexparams). mono, TPS, and ComplexTPS will give a descriptive error from the C code for this because it attempts to create a TPS before getting the number of variables/parameters.

@DavidSagan
Copy link
Member Author

Yes a check here would make the package less frustrating to the User.

@mattsignorelli
Copy link
Contributor

Fixed in #763f784

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