Segmentation fault when using MIP


#1

Hello,

I am using Gurobi as my CVX_solver in my research. It is not a very large
problem (but with 10 binary variables). CVX is called from matlab. I got a segmentation fault consistently (see the dump message below). This doesn’t happen if I change those binary variables to real values.

The problem seems to be in libgurobi6.0.so and Gurobi support asked me to upgrade to gurobi 6.5.2. I check that CVX3.0beta is still using the libgurobi6.0.so. My questions are:

  1. Is there a way I could upgrade the gurobi version within CVX to gurobi 6.5.2?
  2. I feel the problem probably will not go way even with gurobi 6.5.2. Any other suggestions to avoid this problem?

p.s. I did try mosek, but it converges so slowly that it pretty much can’t be used.

Thank you for your help and best regards,

Yijun Zhao

================== core dump message =========================

Calling Gurobi 6.00: 1555 variables, 706 equality constraints


Gurobi optimizer, licensed to CVX for CVX

Optimize a model with 706 rows, 1555 columns and 22932 nonzeros

Model has 2 quadratic constraints

Coefficient statistics:

Matrix range [2e-11, 1e+05]

Objective range [1e-03, 5e-01]

Bounds range [1e+00, 1e+00]

RHS range [1e+00, 1e+05]

Warning: Model contains large matrix coefficient range

     Consider reformulating model or setting NumericFocus parameter

     to avoid numerical issues.

Presolve removed 0 rows and 708 columns

Presolve time: 0.01s

Presolved: 706 rows, 847 columns, 22066 nonzeros

Variable types: 837 continuous, 10 integer (10 binary)

Root relaxation: objective -5.331140e-01, 771 iterations, 0.03 seconds

Nodes    |    Current Node    |     Objective Bounds      |     Work

Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time

 0     0   -0.53311    0    2          -   -0.53311      -     -    0s

 0     0   -0.53311    0    2          -   -0.53311      -     -    0s

H 0 0 0.5858032 -0.53311 191% - 0s

 0     0   -0.52309    0    1    0.58580   -0.52309   189%     -    0s

 0     0   -0.52309    0    1    0.58580   -0.52309   189%     -    0s

 0     0   -0.52309    0    1    0.58580   -0.52309   189%     -    0s

 0     0   -0.52309    0    1    0.58580   -0.52309   189%     -    0s

   Segmentation violation detected at Tue Oct  4 18:22:28 2016

Configuration:

Crash Decoding : Disabled

Crash Mode : continue (default)

Current Graphics Driver: Unknown software

Current Visual : None

Default Encoding : UTF-8

GNU C Library : 2.12 stable

Host Name : alpha022

MATLAB Architecture : glnxa64

MATLAB Root : /opt/shared/Matlab/R2016a

MATLAB Version : 9.0.0.341360 (R2016a)

OpenGL : software

Operating System : Linux 2.6.32-573.18.1.el6.x86_64 #1 SMP Wed Jan 6
11:20:49 EST 2016 x86_64

Processor ID : x86 Family 6 Model 62 Stepping 4, GenuineIntel

Virtual Machine : Java 1.7.0_60-b19 with Oracle Corporation Java
HotSpot™ 64-Bit Server VM mixed mode

Window System : No active display

Fault Count: 1

Abnormal termination:

Segmentation violation

Register State (from fault):

RAX = 00007fa73e088f70 RBX = 00007fa73e08d3b0

RCX = 00007fa73e08ea80 RDX = 00007fa824c11010

RSP = 00007fa8792a0a70 RBP = 0000000000000003

RSI = 00007fa73dbcbea0 RDI = 0000000000000041

R8 = 00007fa73d8f65b0 R9 = 00007fa73d7058c0

R10 = 0000000000000003 R11 = 00000000000f2f60

R12 = 00000000000002d6 R13 = 00007fa73e09c8a0

R14 = 000000000000f2f6 R15 = fffffffbfe900000

RIP = 00007fa827366b6f EFL = 0000000000010287

CS = 0033 FS = 0000 GS = 0000

Stack Trace (from fault):

[ 0] 0x00007fa827366b6f
/cluster/home/y/z/yzhao04/cvx/gurobi/a64/libgurobi60.so+01063791

[ 1] 0x00007fa82736683b
/cluster/home/y/z/yzhao04/cvx/gurobi/a64/libgurobi60.so+01062971

[ 2] 0x00007fa82735076e
/cluster/home/y/z/yzhao04/cvx/gurobi/a64/libgurobi60.so+00972654

[ 3] 0x00007fa82734d3ff
/cluster/home/y/z/yzhao04/cvx/gurobi/a64/libgurobi60.so+00959487

[ 4] 0x00007fa827301200
/cluster/home/y/z/yzhao04/cvx/gurobi/a64/libgurobi60.so+00647680

[ 5] 0x00007fa827356c4a
/cluster/home/y/z/yzhao04/cvx/gurobi/a64/libgurobi60.so+00998474

[ 6] 0x00007fa827300f20
/cluster/home/y/z/yzhao04/cvx/gurobi/a64/libgurobi60.so+00646944

[ 7] 0x00007fa8272d5873
/cluster/home/y/z/yzhao04/cvx/gurobi/a64/libgurobi60.so+00469107

[ 8] 0x00007fa827485aaf
/cluster/home/y/z/yzhao04/cvx/gurobi/a64/libgurobi60.so+02239151

[ 9] 0x00007fa8274a2422
/cluster/home/y/z/yzhao04/cvx/gurobi/a64/libgurobi60.so+02356258

[ 10] 0x00007fa8274a00f9
/cluster/home/y/z/yzhao04/cvx/gurobi/a64/libgurobi60.so+02347257

[ 11] 0x00007fa82748a93a
/cluster/home/y/z/yzhao04/cvx/gurobi/a64/libgurobi60.so+02259258

[ 12] 0x00007fa82747bf81
/cluster/home/y/z/yzhao04/cvx/gurobi/a64/libgurobi60.so+02199425

[ 13] 0x00007fa8275782da
/cluster/home/y/z/yzhao04/cvx/gurobi/a64/libgurobi60.so+03232474

[ 14] 0x00007fa8275766f2
/cluster/home/y/z/yzhao04/cvx/gurobi/a64/libgurobi60.so+03225330
GRBoptimize+00000242

[ 15] 0x00007fa8443d2db6
/cluster/home/y/z/yzhao04/cvx/gurobi/a64/gurobi.mexa64+00032182

[ 16] 0x00007fa8443d07c3
/cluster/home/y/z/yzhao04/cvx/gurobi/a64/gurobi.mexa64+00022467
mexFunction+00011699

[ 17] 0x00007fa88224d8b0
/opt/shared/Matlab/R2016a/bin/glnxa64/libmex.so+00149680
mexRunMexFile+00000064

[ 18] 0x00007fa88224a214
/opt/shared/Matlab/R2016a/bin/glnxa64/libmex.so+00135700

[ 19] 0x00007fa88224adb4
/opt/shared/Matlab/R2016a/bin/glnxa64/libmex.so+00138676

[ 20] 0x00007fa882ff4505
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwm_dispatcher.so+00746757
ZN8Mfh_file16dispatch_fh_implEMS_FviPP11mxArray_tagiS2_EiS2_iS2+00001509

[ 21] 0x00007fa882ff49a0
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwm_dispatcher.so+00747936
ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2+00000032

[ 22] 0x00007fa87ffe01c9
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwm_lxe.so+09232841

[ 23] 0x00007fa88010cdbf
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwm_lxe.so+10464703

[ 24] 0x00007fa8801028e6
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwm_lxe.so+10422502

[ 25] 0x00007fa8800cb891
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwm_lxe.so+10197137

[ 26] 0x00007fa87fc5b0ff
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwm_lxe.so+05542143

[ 27] 0x00007fa87fc48940
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwm_lxe.so+05466432

[ 28] 0x00007fa87fc4c22a
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwm_lxe.so+05481002

[ 29] 0x00007fa87feee543
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwm_lxe.so+08242499

[ 30] 0x00007fa87ffd16a1
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwm_lxe.so+09172641

[ 31] 0x00007fa882ff4505
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwm_dispatcher.so+00746757
ZN8Mfh_file16dispatch_fh_implEMS_FviPP11mxArray_tagiS2_EiS2_iS2+00001509

[ 32] 0x00007fa882ff4970
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwm_dispatcher.so+00747888
ZN8Mfh_file22dispatch_fh_with_reuseEiPP11mxArray_tagiS2+00000032

[ 33] 0x00007fa88014d42e
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwm_lxe.so+10728494

[ 34] 0x00007fa88014d4c9
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwm_lxe.so+10728649

[ 35] 0x00007fa88014ff7d
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwm_lxe.so+10739581

[ 36] 0x00007fa880154cc2
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwm_lxe.so+10759362

[ 37] 0x00007fa87ffe0638
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwm_lxe.so+09233976

[ 38] 0x00007fa88010cd3a
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwm_lxe.so+10464570

[ 39] 0x00007fa88010283b
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwm_lxe.so+10422331

[ 40] 0x00007fa8800e92a1
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwm_lxe.so+10318497

[ 41] 0x00007fa87fc5b0ff
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwm_lxe.so+05542143

[ 42] 0x00007fa87fc48940
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwm_lxe.so+05466432

[ 43] 0x00007fa87fc4c22a
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwm_lxe.so+05481002

[ 44] 0x00007fa87feee543
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwm_lxe.so+08242499

[ 45] 0x00007fa87feb707e
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwm_lxe.so+08015998

[ 46] 0x00007fa87febb058
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwm_lxe.so+08032344

[ 47] 0x00007fa87febb107
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwm_lxe.so+08032519

[ 48] 0x00007fa87ff3132c
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwm_lxe.so+08516396

[ 49] 0x00007fa87ff31792
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwm_lxe.so+08517522

[ 50] 0x00007fa882488d7c
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwbridge.so+00200060

[ 51] 0x00007fa8824899c5
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwbridge.so+00203205
_Z8mnParserv+00000789

[ 52] 0x00007fa8832ddc13
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwmcr.so+00695315

[ 53] 0x00007fa8965f181c
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwmvm.so+02410524
_ZNK5boost9function0IvEclEv+00000028

[ 54] 0x00007fa8832df925
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwmcr.so+00702757

[ 55] 0x00007fa8832e0839
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwmcr.so+00706617
_ZN5boost6detail17task_shared_stateINS_3_bi6bind_tIvPFvRKNS_8functionIFvvEEEENS2_5list1INS2_5valueIS6_EEEEEEvE6do_runEv+00000025

[ 56] 0x00007fa8918c28a0
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwms.so+03168416
_ZN5boost6detail22task_base_shared_stateIvE3runEv+00000064

[ 57] 0x00007fa8832e1717
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwmcr.so+00710423

[ 58] 0x00007fa8832dd75a
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwmcr.so+00694106

[ 59] 0x00007fa883650c06
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwiqm.so+00969734

[ 60] 0x00007fa88363eb4c
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwiqm.so+00895820
_ZN5boost6detail8function21function_obj_invoker0ISt8functionIFNS_3anyEvEES4_E6invokeERNS1_15function_bufferE+00000028

[ 61] 0x00007fa88363f21f
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwiqm.so+00897567
_ZNK5boost9function0INS_3anyEEclEv+00000031

[ 62] 0x00007fa88363e993
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwiqm.so+00895379
_ZN3iqm18PackagedTaskPlugin7executeEP15inWorkSpace_tagRN5boost10shared_ptrIN14cmddistributor17IIPCompletedEventEEE+00000163

[ 63] 0x00007fa8832f271d
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwmcr.so+00780061

[ 64] 0x00007fa883620f98
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwiqm.so+00774040

[ 65] 0x00007fa88360b5af
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwiqm.so+00685487

[ 66] 0x00007fa8836087e3
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwiqm.so+00673763

[ 67] 0x00007fa895faea3a
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwservices.so+03443258

[ 68] 0x00007fa895fad8a7
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwservices.so+03438759

[ 69] 0x00007fa895fae10c
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwservices.so+03440908
_Z25svWS_ProcessPendingEventsiib+00000092

[ 70] 0x00007fa8832dded2
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwmcr.so+00696018

[ 71] 0x00007fa8832de211
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwmcr.so+00696849

[ 72] 0x00007fa8832cacfd
/opt/shared/Matlab/R2016a/bin/glnxa64/libmwmcr.so+00617725

[ 73] 0x0000003d79c07aa1
/lib64/libpthread.so.0+00031393

[ 74] 0x0000003d790e893d
/lib64/libc.so.6+00952637 clone+00000109

[ 75] 0x0000000000000000
+00000000


(Michael C. Grant) #2

You can install Gurobi and its Matlab interface separately, per their standard instructions, and CVX should be able to pick that up and use it.


(Mark L. Stone) #3

I don’t know anything about the segmentation fault or what is causing it, but I’ll give Gurobi credit for issuing a warning for the same thing I noticed when looking at the coefficient statistics.

Matrix range [2e-11, 1e+05]

Followed by

Warning: Model contains large matrix coefficient range

 Consider reformulating model or setting NumericFocus parameter
 to avoid numerical issues.

I recommend you heed the warning and take action. If you do, I have no idea whether you will somehow avoid the segmentation fault. Although certainly I agree that properly functioning software should not have a segmentation fault, however bad the numerics of the submitted problem may be.


#4

Hi Mark,

Thanks for pointing this out. The 1.0e^5 is because of the big M conversion in MIP. I use M = 100000. I keep on reducing it and the message went away with M=100, but each time Gurobi still core dumps.

Yijun


(Mark L. Stone) #5

Regardless of core dump, instead of "Big M’, you should use “Just Big Enough M”. Make M just big enough to make the constraints correct, but not bigger. This will give you the best numerics and best performance.of the integer solver.

Why does your model have 2e-11? Should that really be 0 (i.e., there is no term at all) or is it really a meaningful positive number? You should try to keep your coefficients closer to magnitude 1. Again, I have no idea whether that will help you avoid segmentation fault, but it is something you should do anyhow.


#6

How would I know if the M is “just big enough”? I have no idea where the 2e-11 come from.


(Mark L. Stone) #7

I think you need to study and understand how big M works. Try reading and studying https://ocw.mit.edu/courses/sloan-school-of-management/15-053-optimization-methods-in-management-science-spring-2013/tutorials/MIT15_053S13_tut09.pdf as a gentle introduction to how to do Big M and why it works.

I have no idea where the 2e-11 come from.

Where did your model come from?

Did you create it by hand? I guess not, because then you should know where 2e-11 comes from, unless it results from an internal transformation by GUROBI.

Did you enter it into some other modeling system which generated the actual model? Was your model auotmatically transformed by some program from another model?


#8

The good news is Gurobi 6.52 does fix the segmentation fault! I specify the model by hand. 2e^-11 must be some internal translation by Gurobi because I have no such number in my specification.

I installed Gurobi 6.5.2 independently and CVX did pick up when I ran the setup. I am good for now. Thank you all.