<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.E-MailFormatvorlage17
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.E-MailFormatvorlage18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Hello,<o:p></o:p></p><p class=MsoNormal>we use CBC via googles or-tools from java in our application.<o:p></o:p></p><p class=MsoNormal>Compared to scientific problems, our problems are small and solved by Cbc in <1s (which is great!).<o:p></o:p></p><p class=MsoNormal>As we process requests from users concurrently, we’d also like to call Cbc concurrently.<o:p></o:p></p><p class=MsoNormal>Currently, this is impossible, because Cbc uses the static parameters array in CbcMain0 and CbcMain1 and thus crashes or reads incorrect parameters.<o:p></o:p></p><p class=MsoNormal>One backtrace, for example is:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>#2 0x00007fb3435bf52b in __libc_message (do_abort=<optimized out>, fmt=<optimized out>) at ../sysdeps/unix/sysv/linux/libc_fatal.c:189<br>#3 0x00007fb3435c8d76 in malloc_printerr (action=3, str=0x7fb3436a1248 "double free or corruption (!prev)", ptr=<optimized out>) at malloc.c:6283<br>#4 0x00007fb3435cdaac in *__GI___libc_free (mem=<optimized out>) at malloc.c:3738<br>#5 0x00007fb342733f06 in std::string::assign(std::string const&) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6<br>#6 0x00007fb2d652cb7b in establishParams(int&, CbcOrClpParam*) () from libjnilinearsolver.so<br>#7 0x00007fb2d64edc3b in CbcMain0(CbcModel&) () from libjnilinearsolver.so<br>#8 0x00007fb2d6511bec in callCbc(char const*, CbcModel&) () from libjnilinearsolver.so<br>#9 0x00007fb2d64e3fce in operations_research::CBCInterface::Solve(operations_research::MPSolverParameters const&) () from libjnilinearsolver.so<br>#10 0x00007fb2d64cfe45 in operations_research::MPSolver::Solve(operations_research::MPSolverParameters const&) () from libjnilinearsolver.so<br>#11 0x00007fb2d64cff3b in operations_research::MPSolver::Solve() () from libjnilinearsolver.so<br>#12 0x00007fb2d64c91cf in Java_com_google_ortools_linearsolver_mainJNI_MPSolver_1solve_1_1SWIG_10 () from libjnilinearsolver.so<o:p></o:p></p><p class=MsoNormal># from here on it’s just the JVM<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>As I don’t know the code and it’s hard to read, I can’t really fix the problem by myself,<o:p></o:p></p><p class=MsoNormal>but wouldn’t it be better to move parameters inside CbcModel instead of having a static array laying around?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Andi f that’s done (or another solution is found), do you know of any thread-safety issues in cbc?<o:p></o:p></p><p class=MsoNormal>Keep in mind, we don’t want Cbc to solve our problem in multiple threads, we just want to be able to solve different problems simultaneous.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Regards,<o:p></o:p></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>Cornelius Riemenschneider<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>--<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>ITscope GmbH<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>Ludwig-Erhard-Allee 20<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>76131 Karlsruhe<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>Email: <a href="mailto:cornelius.riemenschneider@itscope.de">cornelius.riemenschneider@itscope.de</a><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'><a href="https://www.itscope.com">https://www.itscope.com</a><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>Handelsregister: AG Mannheim, HRB 232782<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>Sitz der Gesellschaft: Karlsruhe<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas'>Geschäftsführer: Alexander Münkel, Benjamin Mund, Stefan Reger<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>