# Segmentation Violation

Good Day

I am trying to use cvx to solve a convex optimization problem, and on a small dataset this works perfectly. What happens when I use the full dataset is that I get an error “Segmentation Violation”. I realize that the code required a large amount of memory, and so I tried running it on a linux cloud, and even then I get the same error. Is there anyone that can help me solve this issue

I’m afraid you’ve not given us enough information to help you. The only thing I can suggest is to try other solvers. But if you’re still running out of memory, I’m afraid you’re stuck… MATLAB and CVX both add overhead that is hard to avoid.

I don’t think memory is the issue, as I am running the program on a cluster that has 1TB of memory, although MATLAB does seem to cause the error each time it moves to a new area of memory. I am essentially trying to obtain values for w0 and b0 which satisfy:

cvx_begin
variables w0(784) b0 u(X) v(Y)
minimize [norm(w0) + c*(sum(u) + sum(v))]
subject to
A0w0 + b0 >= ones(X,1)-u;
B0
w0 + b0 <= -ones(Y,1)+v;
u>=0;
v>=0
cvx_end

where A0 is a matrix of 5923x784, and B0 is a matrix of 54077x784, X=5923 and Y=54077. Running this on a smaller dataset seems to give me the values for w0 and b0, but when I run the full dataset I get the error. The output that I obtain is:

## Calling SDPT3 4.0: 120786 variables, 60000 equality constraints

num. of constraints = 60000
dim. of socp var = 785, num. of socp blk = 1
dim. of linear var = 120000
dim. of free var = 1 *** convert ublk to lblk
number of dense column in A = 2

SDPT3: Infeasible path-following algorithms

## 0|0.000|0.000|1.0e+00|4.9e+02|1.4e+10| 2.078464e+07 0.000000e+00| 1:29:51|a

``````   Segmentation violation detected at Thu Aug 13 21:31:24 2015
``````

Configuration:
Crash Decoding : Disabled
Current Visual : None
Default Encoding: UTF-8
GNU C Library : 2.11.3 stable
MATLAB Root : /opt/exp_soft/matlab-R2011b
MATLAB Version : 7.13.0.564 (R2011b)
Operating System: Linux 3.0.101-0.47.55-default #1 SMP Thu May 28 08:25:11 UTC 2015 (dc083ee) x86_64
Processor ID : x86 Family 6 Model 13 Stepping 7, GenuineIntel
Virtual Machine : Java 1.6.0_17-b04 with Sun Microsystems Inc. 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 = 000000000000319f RBX = 00002b179a870010
RCX = 0000000080008dec RDX = ffffffffb8b95b57
RSP = 00002afc580b15c0 RBP = 00002afc580b1630
RSI = 0000000080008dec RDI = 00000000059f2f30

R8 = 000000008001784c R9 = 0000000000008bd0
R10 = 0000000080008dec R11 = 00002afc42a85565
R12 = 0000000000000002 R13 = 00002afc580b1e50
R14 = 00002b0a314cc010 R15 = 000000000000ea60

RIP = 00002afc8070ce73 EFL = 0000000000010287

CS = 0033 FS = 0000 GS = 0000

Stack Trace (from fault):
[ 1] 0x00002afc4023c62d /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwfl.so+00218669
[ 3] 0x00002afc412e24f5 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwmcr.so+00447733 _ZN2fl4diag13terminate_logEPKcPK8ucontextb+000085
[ 4] 0x00002afc412df5b4 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwmcr.so+00435636
[ 5] 0x00002afc412e0333 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwmcr.so+00439091
[ 6] 0x00002afc412e04c7 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwmcr.so+00439495
[ 7] 0x00002afc412e185f /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwmcr.so+00444511
[ 8] 0x00002afc412e1a15 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwmcr.so+00444949
[ 10] 0x00002afc8070ce73 /opt/exp_soft/cvx/sdpt3/Solver/Mexfun/mexschurfun.mexa64+00003699 mexFunction+001251
[ 11] 0x00002afc47e1321a /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmex.so+00049690 mexRunMexFile+000090
[ 12] 0x00002afc47e100c9 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmex.so+00037065
[ 13] 0x00002afc47e10d8e /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmex.so+00040334
[ 14] 0x00002afc41573027 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_dispatcher.so+00430119 ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2+000519
[ 15] 0x00002afc4195ddf3 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01854963
[ 16] 0x00002afc41911b8b /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01543051
[ 17] 0x00002afc41912c1d /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01547293
[ 18] 0x00002afc41917c9c /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01567900
[ 19] 0x00002afc41915262 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01557090
[ 20] 0x00002afc41915ea1 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01560225
[ 21] 0x00002afc41978973 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01964403
[ 22] 0x00002afc41573027 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_dispatcher.so+00430119 ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2+000519
[ 23] 0x00002afc4195ddf3 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01854963
[ 24] 0x00002afc41911b8b /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01543051
[ 25] 0x00002afc41912c1d /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01547293
[ 26] 0x00002afc41917c9c /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01567900
[ 27] 0x00002afc41915262 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01557090
[ 28] 0x00002afc41915ea1 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01560225
[ 29] 0x00002afc41978973 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01964403
[ 30] 0x00002afc41573027 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_dispatcher.so+00430119 ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2+000519
[ 31] 0x00002afc4195ddf3 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01854963
[ 32] 0x00002afc41911b8b /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01543051
[ 33] 0x00002afc41912c1d /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01547293
[ 34] 0x00002afc41917c9c /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01567900
[ 35] 0x00002afc41915262 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01557090
[ 36] 0x00002afc41915ea1 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01560225
[ 37] 0x00002afc41978973 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01964403
[ 38] 0x00002afc41573027 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_dispatcher.so+00430119 ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2+000519
[ 39] 0x00002afc4195ddf3 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01854963
[ 40] 0x00002afc41911b8b /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01543051
[ 41] 0x00002afc41912c1d /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01547293
[ 42] 0x00002afc41917c9c /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01567900
[ 43] 0x00002afc41915262 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01557090
[ 44] 0x00002afc41915ea1 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01560225
[ 45] 0x00002afc41978973 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01964403
[ 46] 0x00002afc41573027 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_dispatcher.so+00430119 ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2+000519
[ 47] 0x00002afc4153de07 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_dispatcher.so+00212487
[ 48] 0x00002afc418ef656 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01402454
[ 49] 0x00002afc418f00bc /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01405116
[ 50] 0x00002afc418f027a /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01405562
[ 51] 0x00002afc418f37e5 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01419237
[ 52] 0x00002afc41912793 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01546131
[ 53] 0x00002afc41917c9c /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01567900
[ 54] 0x00002afc41915262 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01557090
[ 55] 0x00002afc41915ea1 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01560225
[ 56] 0x00002afc41978973 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01964403
[ 57] 0x00002afc41573027 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_dispatcher.so+00430119 ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2+000519
[ 58] 0x00002afc4195ddf3 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01854963
[ 59] 0x00002afc41911b8b /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01543051
[ 60] 0x00002afc41912c1d /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01547293
[ 61] 0x00002afc41917c9c /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01567900
[ 62] 0x00002afc41915262 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01557090
[ 63] 0x00002afc41915ea1 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01560225
[ 64] 0x00002afc41978973 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01964403
[ 65] 0x00002afc41573027 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_dispatcher.so+00430119 ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2+000519
[ 66] 0x00002afc4153de07 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_dispatcher.so+00212487
[ 67] 0x00002afc418ef656 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01402454
[ 68] 0x00002afc41940911 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01734929
[ 69] 0x00002afc418fa60e /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01447438
[ 70] 0x00002afc4197359e /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01942942
[ 71] 0x00002afc418fa465 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01447013
[ 72] 0x00002afc418f3d4e /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01420622
[ 73] 0x00002afc41912793 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01546131
[ 74] 0x00002afc41917c9c /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01567900
[ 75] 0x00002afc41915262 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01557090
[ 76] 0x00002afc41915ea1 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01560225
[ 77] 0x00002afc41978973 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01964403
[ 78] 0x00002afc41573027 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_dispatcher.so+00430119 ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2+000519
[ 79] 0x00002afc4195ddf3 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01854963
[ 80] 0x00002afc41911b8b /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01543051
[ 81] 0x00002afc41912c1d /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01547293
[ 82] 0x00002afc41917c9c /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01567900
[ 83] 0x00002afc41915262 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01557090
[ 84] 0x00002afc41915ea1 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01560225
[ 85] 0x00002afc41978973 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01964403
[ 86] 0x00002afc41573027 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_dispatcher.so+00430119 ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2+000519
[ 87] 0x00002afc4195ddf3 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01854963
[ 88] 0x00002afc418f44b7 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01422519
[ 89] 0x00002afc419127b6 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01546166
[ 90] 0x00002afc41917c9c /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01567900
[ 91] 0x00002afc41915262 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01557090
[ 92] 0x00002afc41915ea1 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01560225
[ 93] 0x00002afc41978973 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01964403
[ 94] 0x00002afc41573027 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_dispatcher.so+00430119 ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2+000519
[ 95] 0x00002afc4195ddf3 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01854963
[ 96] 0x00002afc418f44b7 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01422519
[ 97] 0x00002afc419127b6 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01546166
[ 98] 0x00002afc41917c9c /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01567900
[ 99] 0x00002afc41915262 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01557090
[100] 0x00002afc41915ea1 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01560225
[101] 0x00002afc41978973 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01964403
[102] 0x00002afc41573027 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_dispatcher.so+00430119 ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2+000519
[103] 0x00002afc4194e192 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01790354
[104] 0x00002afc4190c13b /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01519931
[105] 0x00002afc41909b56 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01510230
[106] 0x00002afc4190a087 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01511559
[107] 0x00002afc41906a9f /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwm_interpreter.so+01497759
[108] 0x00002afc479580e8 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwiqm.so+01073384 _ZNK3iqm18InternalEvalPlugin24inEvalCmdWithLocalReturnEPKcP15inWorkSpace_tag+000088
[109] 0x00002afc47959453 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwiqm.so+01078355 _ZN3iqm18InternalEvalPlugin7executeEP15inWorkSpace_tagRN5boost10shared_ptrIN14cmddistributor17IIPCompletedEventEEE+000131
[110] 0x00002afc412bb095 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwmcr.so+00286869
[111] 0x00002afc478e9a16 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwiqm.so+00621078
[112] 0x00002afc478d8cba /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwiqm.so+00552122
[113] 0x00002afc41058a72 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwbridge.so+00100978
[115] 0x00002afc41059165 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwbridge.so+00102757
[116] 0x00002afc4105d49a /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwbridge.so+00119962
[117] 0x00002afc4105d904 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwbridge.so+00121092
[118] 0x00002afc4105e22e /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwbridge.so+00123438 mnParser+000702
[120] 0x00002afc412a823e /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwmcr.so+00209470
[121] 0x00002afc412a82b9 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwmcr.so+00209593
[122] 0x00002afc40a2b933 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwservices.so+00481587
[123] 0x00002afc40a2bb45 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwservices.so+00482117
[124] 0x00002afc40a29ba8 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwservices.so+00474024
[125] 0x00002afc4b5dacd5 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libmwuix.so+00486613
[126] 0x00002afc4ac3c02f /opt/exp_soft/matlab-R2011b/bin/glnxa64/libuij.so+00237615 ZSt8for_eachIN9__gnu_cxx17__normal_iteratorIPN5boost8weak_ptrIN4sysq10ws_ppeHookEEESt6vectorIS6_SaIS6_EEEENS4_6wait_FIS6_NS2_10shared_ptrIS5_EEEEET0_T_SH_SG+000063
[127] 0x00002afc4ac3cb52 /opt/exp_soft/matlab-R2011b/bin/glnxa64/libuij.so+00240466

This error was detected while a MEX-file was running. If the MEX-file
is not an official MathWorks function, please examine its source code
for errors. Please consult the External Interfaces Guide for information
on debugging MEX-files.

If this problem is reproducible, please submit a Service Request via:
http://www.mathworks.com/support/contact_us/

A technical support engineer might contact you with further information.

Thank you for your help.** This crash report has been saved to disk as /home/mdlkay002/matlab_crash_dump.16837-1 **

MATLAB is exiting because of fatal error