[Cbc] Invoking the Cbc solver from a Java application via JNI.

acw at ascent.com acw at ascent.com
Thu Aug 13 17:07:23 EDT 2009


We have a Cbc application that is invoked from Java using the Java Native 
Interface (JNI).

We're working under Linux.

We build a shared-object (.so) library which provides an entry-point very 
much like driver4's "main".  This entry works fine when called straight 
from C++ code.  But when called via JNI it fails in a weird way.  It 
throws a segmentation fault immediately after entering the function 
CbcMain1.  I moved debugging statements around the entry to CbcMain1, and 
I can't resolve the place the fault is signalled: it looks like it happens 
as part of the calling sequence to CbcMain1.

A call to CbcMain0, a few lines upstream, completes successfully.

Has anyone else succeeded in using Cbc from Java/JNI, and do you have any 
advice to offer?  I am suspecting that some of the compilation flags in 
the Cbc build process violate JNI's expectations about library structure, 
but this vague suspicion doesn't explain why CbcMain0 works and CbcMain1 
fails.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.coin-or.org/pipermail/cbc/attachments/20090813/a95ca809/attachment.html 


More information about the Cbc mailing list