-
Notifications
You must be signed in to change notification settings - Fork 57
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
issues with exceptions thrown by Ipopt #9
Comments
That does look eerily familiar, but I can't quite place where from. I would occasionally have some strange things happen with exceptions when I was trying to statically link the various gcc runtime libs, but that's not what's happening here AFAICT. Would want to make sure Ipopt and Julia are all linked against the same libgcc. I'd usually advise reformulating, rescaling, and/or adding constraints to avoid the inf/nan in the first place, but yeah core dumps shouldn't happen. |
Both Ipopt and PPA julia seem to be linked against the same version of libgcc ( CC @staticfloat |
That's pretty bizarre. Looks like |
After some more digging, I think the behavior of the source-compiled Julia is correct, Ipopt has its own mechanism for handling exceptions and doesn't immediately abort. It's just the PPA julia with the weird behavior. Some more debugging notes:
works fine.
Is there any difference in the libunwind version used by the PPA and the one used in source builds? |
The libunwind used by the PPA is |
We have a local patch to libunwind. Maybe that's the issue? |
From the discussion in JuliaLang/julia#3469, it didn't seem like that patch is related to exception handling. |
Depends. If it unwinds incorrectly and can't find the exception handler, you're in trouble. |
How can I refresh an existing julia build to use the system unwind? |
Maybe distclean libunwind and/or deleting usr/lib |
I have /usr/lib/x86_64-linux-gnu/libunwind.so.8. |
Scratch that, I didn't have libunwind8-dev installed. |
I can reproduce the issue when using the system libunwind and a julia source build. Our patch to libunwind was accepted upstream: http://git.savannah.gnu.org/gitweb/?p=libunwind.git;a=commitdiff;h=4509adb85303afb471fbd10733f044535da5b1cc, so maybe we can hope for the fix to be distributed in a year or so.... |
Can you try the libunwind I just uploaded to the PPA? It should just auto-overwrite yours on an |
Unfortunately doesn't seem to fix the issue. Backtrace is the same. |
Just for completeness, what version do you have installed? "apt-cache show On Sun, Jun 22, 2014 at 4:10 PM, Miles Lubin notifications@github.com
|
I have libunwind8 |
Bump. This still seems to be broken: https://groups.google.com/forum/#!topic/julia-opt/YhuEzKdfpWw |
Bump. Still an issue with the PPA, while packaged 0.3.6 seems to bubble/catch exceptions properly (see JuliaLang/julia#10273). Any way to fix the PPA? |
I will try to take a look at this later this week. This is a tough one because last I looked I couldn't figure out what was different between the packaged libunwind and our from-source built libunwind. Hopefully with fresh eyes, this will be easier for me to spot. |
Thanks! On Mon, Feb 23, 2015 at 5:37 PM, Elliot Saba notifications@github.com
|
Can someone give me a simple testcase I can run to make sure I've reproduced the failure locally? |
Here is a simple test for the CoolProp case (not linked to Ipopt appart that it is the same error with the Julia ppa): Installation of Julia with the ppa: sudo add-apt-repository ppa:staticfloat/julianightlies
sudo add-apt-repository ppa:staticfloat/julia-deps
sudo apt install julia Download the CoolProp library: Then in Julia started in the same folder than this library: julia> push!(DL_LOAD_PATH,".")
1-element Array{Union(ASCIIString,UTF8String),1}:
"."
julia> ccall( (:PropsSI, "libCoolProp"), Cdouble, (Ptr{Uint8},Ptr{Uint8},Cdouble,Ptr{Uint8},Cdouble,Ptr{Uint8}), "T","P",101325.,"Q",0.,"Water")
373.12429584768836
julia> ccall( (:PropsSI, "libCoolProp"), Cdouble, (Ptr{Uint8},Ptr{Uint8},Cdouble,Ptr{Uint8},Cdouble,Ptr{Uint8}), "T","P",-101325.,"Q",0.,"Water")
signal (6): Aborted
gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
_Unwind_Resume at /lib/x86_64-linux-gnu/libgcc_s.so.1 (unknown line)
_ZN8CoolProp16_PropsSI_outputsERNSt3tr110shared_ptrINS_13AbstractStateEEESt6vectorINS_16output_parameterESaIS6_EENS_11input_pairsERKS5_IdSaIdEESD_RS5_ISB_SaISB_EE at ./libCoolProp.so (unknown line)
_ZN8CoolProp13_PropsSImultiERKSt6vectorISsSaISsEERKSsRKS0_IdSaIdEES6_SA_S6_S4_SA_RS0 _IS8_SaIS8_EE at ./libCoolProp.so (unknown line)
_ZN8CoolProp7PropsSIERKSsS1_dS1_dS1_ at ./libCoolProp.so (unknown line)
PropsSI at ./libCoolProp.so (unknown line)
anonymous at no file:0
unknown function (ip: -998904628)
jl_f_top_eval at /usr/bin/../lib/x86_64-linux-gnu/julia/libjulia.so (unknown line)
eval_user_input at REPL.jl:53
jlcall_eval_user_input_20160 at (unknown line)
jl_apply_generic at /usr/bin/../lib/x86_64-linux-gnu/julia/libjulia.so (unknown line)
anonymous at task.jl:95
jl_handle_stack_switch at /usr/bin/../lib/x86_64-linux-gnu/julia/libjulia.so (unknown line)
julia_trampoline at /usr/bin/../lib/x86_64-linux-gnu/julia/libjulia.so (unknown line)
unknown function (ip: 4199613)
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 4199667)
unknown function (ip: 0)
Aborted (core dumped) The first call check if it works, the second to check if the problem is still there (it should gives I hope this is simple enough |
Alright, I've narrowed this down to the fact that if you turn on For now, the solution I'll use is to link Julia against |
@staticfloat, does the latest PPA incorporate this fix? We just got another report of the issue: https://groups.google.com/forum/#!topic/julia-opt/meobh1XWnj0. |
@mlubin Ah, the nightlies had it, but looks like the stable builds still had the same error. This has been rectified. |
This is now fixed for me for both ppa since: None of them crash any more. |
Julia 0.3.6-depxfix9-utopic should be available, just do an apt-get update On Sat, Mar 14, 2015 at 3:55 AM, JonWel notifications@github.com wrote:
|
Seems to be fixed now, thanks @staticfloat! |
This came out of debugging https://groups.google.com/forum/#!topic/julia-opt/J77CzzhNP4g, where JuMP was returning inf or NaN when evaluating a function for numerical reasons. Ipopt already has error handling for this case: https://projects.coin-or.org/Ipopt/browser/trunk/Ipopt/src/Algorithm/IpOrigIpoptNLP.cpp#L496 and throws an exception. (I confirmed that the macro is properly expanded and an exception is indeed thrown.) The C wrapper does seem to have code to catch and display exceptions, but it's never reached. Instead, I've seen two different behaviors:
julianightlies
PPA, a core dump occurs. Here's the backtrace:Neither of these is the right behavior.
@tkelman, have you seen this before?
@Keno @vtjnash, is there any reason why C++ exceptions thrown inside a C wrapper called from Julia wouldn't work correctly?
The text was updated successfully, but these errors were encountered: