Debugging a kernel panic when using Cairo graphics with an 8 bit per pixel frame buffer - linux-device-driver

I successfully got a 1 bit per pixel frame buffer working with Cairo Graphics and I’m running into issues converting the frame buffer to 8 bits per pixel.
In the frame buffer I increased the appropriate values by a factor of 8 and for a 128x64 display I get 8192 bytes of memory allocated in the driver.
Testing from the command line with cat /dev/urandom > /dev/fb0 works as expected.
I then use Cairo to draw a diagonal line just to test the boundaries and that’s when I start seeing issues, so I assume it's an issue with deferred IO in the frame buffer. Seems similar to Kernel panic using deferred_io on kmalloced buffer
I've hit a road block and need help moving forward.
Drawing a line from 0x,0y to 63x,0y has no problems.
cairo_move_to(cr,0,0);
cairo_line_to(cr,63,1);
cairo_stroke(cr);
Drawing from 0,0 to 64,0 I start seeing the following until 0,0 to 128,31:
[ 579.978373] ------------[ cut here ]------------
[ 579.992339] WARNING: CPU: 0 PID: 1920 at kernel/ptrace.c:190 SyS_ptrace+0x388/0x5c8()
[ 580.044483] Modules linked in: musb_dsps musb_hdrc udc_core musb_am335x
[ 580.176439] CPU: 0 PID: 1920 Comm: strace Not tainted 4.1.18-rt17 #121
[ 580.183027] Hardware name: Generic AM33XX (Flattened Device Tree)
[ 580.189150] Backtrace:
[ 580.191692] [<c0013208>] (dump_backtrace) from [<c0013428>] (show_stack+0x18/0x1c)
[ 580.199324] r7:c06fc844 r6:000000be r5:00000009 r4:00000000
[ 580.205072] [<c0013410>] (show_stack) from [<c059c968>] (dump_stack+0x20/0x28)
[ 580.212365] [<c059c948>] (dump_stack) from [<c003a32c>] (warn_slowpath_common+0x80/0xb8)
[ 580.220503] [<c003a2ac>] (warn_slowpath_common) from [<c003a408>] (warn_slowpath_null+0x24/0x2c)
[ 580.229349] r8:00000000 r7:00000000 r6:00000018 r5:cc36668c r4:cc366680
[ 580.236184] [<c003a3e4>] (warn_slowpath_null) from [<c0042c84>] (SyS_ptrace+0x388/0x5c8)
[ 580.244348] [<c00428fc>] (SyS_ptrace) from [<c000f800>] (ret_fast_syscall+0x0/0x3c)
[ 580.252062] r9:cd6c4000 r8:c000f9a4 r7:0000001a r6:00000783 r5:b6f8b4d0 r4:00000017
[ 580.259896] ---[ end trace 0000000000000002 ]---
Drawing at 128,32 and above causes a kernel panic:
[ 984.692851] flags: 0x14(referenced|dirty)
[ 984.697350] page dumped because: non-NULL mapping
[ 984.703013] Modules linked in: musb_dsps musb_hdrc udc_core musb_am335x
[ 984.709706] CPU: 0 PID: 2295 Comm: test Tainted: G W 4.1.18-rt17 #121
[ 984.717864] Hardware name: Generic AM33XX (Flattened Device Tree)
[ 984.725323] Backtrace:
[ 984.727874] [<c0013208>] (dump_backtrace) from [<c0013428>] (show_stack+0x18/0x1c)
[ 984.736361] r7:00000000 r6:c07055d0 r5:cff87cb4 r4:c0880c80
[ 984.742767] [<c0013410>] (show_stack) from [<c059c968>] (dump_stack+0x20/0x28)
[ 984.750440] [<c059c948>] (dump_stack) from [<c00e0620>] (bad_page+0xc8/0x12c)
[ 984.761358] [<c00e0558>] (bad_page) from [<c00e08b8>] (free_pages_prepare+0x234/0x2f0)
[ 984.770049] r9:cc215dc8 r8:cff87cb4 r7:00000001 r6:00000001 r5:cff87cb4 r4:cfdad000
[ 984.777961] [<c00e0684>] (free_pages_prepare) from [<c00e2944>] (free_hot_cold_page+0x34/0x298)
[ 984.787421] r10:c08616f0 r9:cc215dc8 r8:00080000 r7:00000000 r6:00000014 r5:cff87cb4
[ 984.795881] r4:cfdad000
[ 984.798476] [<c00e2910>] (free_hot_cold_page) from [<c00e2bf4>] (free_hot_cold_page_list+0x4c/0xec)
[ 984.809020] r10:c08616f0 r9:cc215dc8 r8:cc214000 r7:cc215db4 r6:00000000 r5:cff87cb4
[ 984.817006] r4:cff87cb4
[ 984.819598] [<c00e2ba8>] (free_hot_cold_page_list) from [<c00ea080>] (release_pages+0x24c/0x264)
[ 984.829523] r10:cc215dc8 r9:00000002 r8:cc36d004 r7:00000002 r6:00000000 r5:00000002
[ 984.837500] r4:cff87cb4 r3:00000000
[ 984.847293] [<c00e9e34>] (release_pages) from [<c0116f74>] (free_pages_and_swap_cache+0xa0/0xa4)
[ 984.858132] r10:b6f50000 r9:cc215eb8 r8:cc36d000 r7:00000002 r6:cc36d004 r5:cff87cb4
[ 984.866577] r4:00000002
[ 984.869406] [<c0116ed4>] (free_pages_and_swap_cache) from [<c0105c40>] (unmap_single_vma+0x3f8/0x59c)
[ 984.880475] r9:cc215eb8 r8:b6f50000 r7:cff87cb4 r6:b6f4f000 r5:8d30534f r4:00000000
[ 984.888944] [<c0105848>] (unmap_single_vma) from [<c0106bc0>] (unmap_vmas+0x5c/0x70)
[ 984.898548] r10:b6f4e000 r9:cc4ab318 r8:00000000 r7:b6f4e000 r6:cc215eb8 r5:b6f50000
[ 984.906901] r4:cd6f2370
[ 984.909555] [<c0106b64>] (unmap_vmas) from [<c0109f0c>] (unmap_region+0xb4/0x1ac)
[ 984.919229] r8:cd6f2370 r7:cc215ee0 r6:b6f50000 r5:cd4af8f0 r4:cc51b700
[ 984.926694] [<c0109e58>] (unmap_region) from [<c010bddc>] (do_munmap+0x28c/0x3fc)
[ 984.935467] r10:cd6f2370 r9:cc4ab318 r8:cc51b704 r7:b6f4e000 r6:b6f50000 r5:cd6f2370
[ 984.945040] r4:cc51b700
[ 984.948196] [<c010bb50>] (do_munmap) from [<c010bf90>] (vm_munmap+0x44/0x58)
[ 984.956689] r10:00000100 r9:cc214000 r8:c000f9a4 r7:00002000 r6:b6f4e000 r5:cc51b700
[ 984.965245] r4:cc51b748
[ 984.967906] [<c010bf4c>] (vm_munmap) from [<c010cf2c>] (SyS_munmap+0x24/0x28)
[ 984.976574] r7:0000005b r6:00029a30 r5:00002000 r4:b6f4e000
[ 984.982811] [<c010cf08>] (SyS_munmap) from [<c000f974>] (__sys_trace_return+0x0/0x2c)
[ 984.990844] r5:00000001 r4:00029858
[ 984.998016] Disabling lock debugging due to kernel taint
[ 985.602383] Unable to handle kernel paging request at virtual address a2763fc4
[ 985.609738] pgd = c0004000
[ 985.613681] [a2763fc4] *pgd=00000000
[ 985.617326] Internal error: Oops: 5 [#1] PREEMPT ARM
[ 985.617347] Modules linked in: musb_dsps musb_hdrc udc_core musb_am335x
[ 985.617363] CPU: 0 PID: 1766 Comm: kworker/0:0 Tainted: G B W 4.1.18-rt17 #121
[ 985.617367] Hardware name: Generic AM33XX (Flattened Device Tree)
[ 985.617397] Workqueue: events fb_deferred_io_work
[ 985.617403] task: cc364000 ti: cc44a000 task.ti: cc44a000
[ 985.617420] PC is at __wake_up_bit+0x10/0x48
[ 985.617436] LR is at unlock_page+0x38/0x3c
[ 985.617445] pc : [<c0065b9c>] lr : [<c00dba2c>] psr: a00f0013
[ 985.617445] sp : cc44be98 ip : cc44beb8 fp : cc44beb4
[ 985.617449] r10: cfd86500 r9 : 0cfd8650 r8 : 00000000
[ 985.617455] r7 : cd24dc00 r6 : cd2b9150 r5 : cd2b9154 r4 : cc215db4
[ 985.617460] r3 : 289d8fec r2 : 00000000 r1 : cc215db4 r0 : a2763fb0
[ 985.617469] Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel
[ 985.617475] Control: 10c5387d Table: 8d4f0019 DAC: 00000015
[ 985.617480] Process kworker/0:0 (pid: 1766, stack limit = 0xcc44a210)
[ 985.617486] Stack: (0xcc44be98 to 0xcc44c000)
[ 985.617495] be80: c07f0000 cff87cb4
[ 985.617506] bea0: 00000000 cc44bea0 cc44becc cc44beb8 c00dba2c c0065b98 cc215db4 cd2b9154
[ 985.617518] bec0: cc44beec cc44bed0 c0305528 c00dba00 cd24de28 cd496380 c0860f5c c07ff8b8
[ 985.617529] bee0: cc44bf2c cc44bef0 c004fdac c03054f0 cc44a000 cc364000 cc44bf14 00000000
[ 985.617540] bf00: c0050a34 c07ff8b8 cd496398 c07ff8dc 00000008 c0860c6d c07ff8b8 cd496380
[ 985.617550] bf20: cc44bf64 cc44bf30 c0050120 c004fc9c 00000000 c07ff8dc 00000000 00000000
[ 985.617561] bf40: cd713fc0 cd496380 c00500e8 00000000 00000000 00000000 cc44bfac cc44bf68
[ 985.617572] bf60: c0054cd4 c00500f4 00000000 00000000 00000000 cd496380 00000000 cc44bf7c
[ 985.617582] bf80: cc44bf7c 00000000 cc44bf88 cc44bf88 cd713fc0 c0054c08 00000000 00000000
[ 985.617593] bfa0: 00000000 cc44bfb0 c000f8a8 c0054c14 00000000 00000000 00000000 00000000
[ 985.617603] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 985.617613] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
[ 985.617617] Backtrace:
[ 985.617634] [<c0065b8c>] (__wake_up_bit) from [<c00dba2c>] (unlock_page+0x38/0x3c)
[ 985.617648] [<c00db9f4>] (unlock_page) from [<c0305528>] (fb_deferred_io_work+0x44/0xe4)
[ 985.617656] r5:cd2b9154 r4:cc215db4
[ 985.617680] [<c03054e4>] (fb_deferred_io_work) from [<c004fdac>] (process_one_work+0x11c/0x458)
[ 985.617692] r7:c07ff8b8 r6:c0860f5c r5:cd496380 r4:cd24de28
[ 985.617707] [<c004fc90>] (process_one_work) from [<c0050120>] (worker_thread+0x38/0x52c)
[ 985.617723] r10:cd496380 r9:c07ff8b8 r8:c0860c6d r7:00000008 r6:c07ff8dc r5:cd496398
[ 985.617727] r4:c07ff8b8
[ 985.617744] [<c00500e8>] (worker_thread) from [<c0054cd4>] (kthread+0xcc/0xe4)
[ 985.617760] r10:00000000 r9:00000000 r8:00000000 r7:c00500e8 r6:cd496380 r5:cd713fc0
[ 985.617764] r4:00000000
[ 985.617783] [<c0054c08>] (kthread) from [<c000f8a8>] (ret_from_fork+0x14/0x2c)
[ 985.617795] r7:00000000 r6:00000000 r5:c0054c08 r4:cd713fc0
[ 985.617806] Code: e1a0c00d e92dd800 e24cb004 e24dd010 (e590e014)
[ 985.927655] ---[ end trace 0000000000000006 ]---
Here are the relative parts of the frame buffer driver:
static const struct fb_var_screeninfo oledfb_var = {
.bits_per_pixel = 8,
.grayscale = 1,
};
vmem_size = par->width * par->height * oledfb_var.bits_per_pixel / 8;
vmem = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
get_order(vmem_size));
info->fix.line_length = par->width * oledfb_var.bits_per_pixel / 8;
info->var.red.length = oledfb_var.bits_per_pixel;
info->var.red.offset = 0;
info->var.red.msb_right = 1;
info->var.green.length = oledfb_var.bits_per_pixel;
info->var.green.offset = 0;
info->var.green.msb_right = 1;
info->var.blue.length = oledfb_var.bits_per_pixel;
info->var.blue.offset = 0;
info->var.blue.msb_right = 1;
info->var.transp.length = oledfb_var.bits_per_pixel;
info->var.transp.offset = 0;
info->var.transp.msb_right = 1;
info->screen_base = (u8 __force __iomem *)vmem;
info->fix.smem_start = __pa(vmem);
info->fix.smem_len = vmem_size;
And here is how I’m initializing my memory map and surface in cairo:
// Figure out the size of the screen in bytes
device->fb_screensize = device->fb_vinfo.xres * device->fb_vinfo.yres
* device->fb_vinfo.bits_per_pixel / 8;
printf(" Size (bytes): %d\n", (int)device->fb_screensize);
printf("Mapping memory\n");
// Map the device to memory
device->fb_data = (char *)mmap(0, device->fb_screensize,
PROT_READ | PROT_WRITE, MAP_SHARED,
device->fb_fd, 0);
if ((int)device->fb_data == -1) {
perror("Error: failed to map framebuffer device to memory");
exit(4);
}
// Get fixed screen information
if (ioctl(device->fb_fd, FBIOGET_FSCREENINFO, &device->fb_finfo) == -1) {
perror("Error reading fixed information");
exit(2);
}
printf(" Stride_for_width: %d\n", cairo_format_stride_for_width(CAIRO_FORMAT_A8, device->fb_vinfo.xres));
surface = cairo_image_surface_create_for_data((unsigned char *)device->fb_data,
CAIRO_FORMAT_A8,
device->fb_vinfo.xres,
device->fb_vinfo.yres,
cairo_format_stride_for_width(CAIRO_FORMAT_A8, device->fb_vinfo.xres));
cairo_surface_set_user_data(surface, NULL, device, &cairo_linuxfb_surface_destroy);

I changed
vmem = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, get_order(vmem_size));
...
__free_pages(__va(info->fix.smem_start), get_order(info->fix.smem_len));
to
vmem = kzalloc(vmem_size, GFP_KERNEL);
...
kfree(info->screen_base);
and that seems to have fixed the problem. I based my driver off of https://github.com/torvalds/linux/blob/master/drivers/video/fbdev/ssd1307fb.c since the hardware is similar. I don't know enough to understand why one way works over the other but the __ in front of the function call raised a red flag.

Related

Matlab terminate while compile caffe. Disabled - No sandbox or build area path

E0302 03:12:50.399718 23466 net.cpp:785] [Backward] All net params (data, diff): L1 norm = (13513.7, 65688.6); L2 norm = (23.9842, 295.159)
F0302 03:14:40.549015 23466 syncedmem.hpp:31] Check failed: error == cudaSuccess (29 vs. 0) driver shutting down
*** Check failure stack trace: ***
------------------------------------------------------------------------
abort() detected at Fri Mar 2 03:14:40 2018
------------------------------------------------------------------------
Configuration:
Crash Decoding : Disabled - No sandbox or build area path
Crash Mode : continue (default)
Current Graphics Driver: Unknown hardware
Current Visual : 0x21 (class 4, depth 24)
Default Encoding : UTF-8
Deployed : false
GNU C Library : 2.23 stable
Host Name : lly
MATLAB Architecture : glnxa64
MATLAB Entitlement ID: 6257193
MATLAB Root : /usr/local/MATLAB/R2016b
MATLAB Version : 9.1.0.441655 (R2016b)
OpenGL : hardware
Operating System : Linux 4.13.0-36-generic #40~16.04.1-Ubuntu SMP Fri Feb 16 23:25:58 UTC 2018 x86_64
Processor ID : x86 Family 6 Model 158 Stepping 9, GenuineIntel
Virtual Machine : Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
Window System : The X.Org Foundation (11905000), display :0
Fault Count: 1
Abnormal termination:
abort()
Register State (from fault):
RAX = 0000000000000000 RBX = 00007fb35b643420
RCX = 00007fb4b71e9428 RDX = 0000000000000006
RSP = 00007fb49a94d008 RBP = 00007fb49a94d2e0
RSI = 0000000000005baa RDI = 0000000000005b76
R8 = 0000000000000081 R9 = 00007fb35b643440
R10 = 0000000000000008 R11 = 0000000000000202
R12 = 00007fb35b643480 R13 = 0000000000000072
R14 = 00007fb35b643420 R15 = 00007fb35b64ade0
RIP = 00007fb4b71e9428 EFL = 0000000000000202
CS = 0033 FS = 0000 GS = 0000
Stack Trace (from fault):
[ 0] 0x00007fb4b71e9428 /lib/x86_64-linux-gnu/libc.so.6+00218152 gsignal+00000056
[ 1] 0x00007fb4b71eb02a /lib/x86_64-linux-gnu/libc.so.6+00225322 abort+00000362
[ 2] 0x00007fb35b42ee49 /usr/lib/x86_64-linux-gnu/libglog.so.0+00040521
[ 3] 0x00007fb35b4305cd /usr/lib/x86_64-linux-gnu/libglog.so.0+00046541
[ 4] 0x00007fb35b432433 /usr/lib/x86_64-linux-gnu/libglog.so.0+00054323 _ZN6google10LogMessage9SendToLogEv+00000643
[ 5] 0x00007fb35b43015b /usr/lib/x86_64-linux-gnu/libglog.so.0+00045403 _ZN6google10LogMessage5FlushEv+00000187
[ 6] 0x00007fb35b432e1e /usr/lib/x86_64-linux-gnu/libglog.so.0+00056862 _ZN6google15LogMessageFatalD2Ev+00000014
[ 7] 0x00007fb35b9fe8d0 /home/lly/work/caffe-ssd/matlab/+caffe/private/caffe_.mexa64+01329360
[ 8] 0x00007fb35b9c9512 /home/lly/work/caffe-ssd/matlab/+caffe/private/caffe_.mexa64+01111314
[ 9] 0x00007fb35b99bfca /home/lly/work/caffe-ssd/matlab/+caffe/private/caffe_.mexa64+00925642
[ 10] 0x00007fb35b99c3dd /home/lly/work/caffe-ssd/matlab/+caffe/private/caffe_.mexa64+00926685
[ 11] 0x00007fb35bbabae5 /home/lly/work/caffe-ssd/matlab/+caffe/private/caffe_.mexa64+03087077
[ 12] 0x00007fb35b91a01f /home/lly/work/caffe-ssd/matlab/+caffe/private/caffe_.mexa64+00393247
[ 13] 0x00007fb35b91a19a /home/lly/work/caffe-ssd/matlab/+caffe/private/caffe_.mexa64+00393626
[ 14] 0x00007fb4b71edff8 /lib/x86_64-linux-gnu/libc.so.6+00237560
[ 15] 0x00007fb4b71ee045 /lib/x86_64-linux-gnu/libc.so.6+00237637
[ 16] 0x00007fb4a6f047c0 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwmcr.so+00767936
[ 17] 0x00007fb4a6f03011 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwmcr.so+00761873
[ 18] 0x00007fb4a6bb9cfe /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_dispatcher.so+00437502
[ 19] 0x00007fb4a6ba0878 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_dispatcher.so+00333944 _ZN13Mfh_MATLAB_fn11dispatch_fhEiPP11mxArray_tagiS2_+00000616
[ 20] 0x00007fb499146a38 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwmcos_impl.so+02771512
[ 21] 0x00007fb4a6bf5bd5 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_dispatcher.so+00682965
[ 22] 0x00007fb4a6bb9cfe /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_dispatcher.so+00437502
[ 23] 0x00007fb4a6ba0878 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_dispatcher.so+00333944 _ZN13Mfh_MATLAB_fn11dispatch_fhEiPP11mxArray_tagiS2_+00000616
[ 24] 0x00007fb4a3b2a9b4 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+12614068
[ 25] 0x00007fb4a3b2aa50 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+12614224
[ 26] 0x00007fb4a3909306 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+10380038
[ 27] 0x00007fb4a3909785 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+10381189
[ 28] 0x00007fb4a3989cc8 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+10906824
[ 29] 0x00007fb4a398ba2a /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_lxe.so+10914346
[ 30] 0x00007fb4a632aee0 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwm_interpreter.so+02445024 _Z44inCallFcnWithTrapInDesiredWSAndPublishEventsiPP11mxArray_tagiS1_PKcbP15inWorkSpace_tag+00000080
[ 31] 0x00007fb4a766a77a /usr/local/MATLAB/R2016b/bin/glnxa64/libmwiqm.so+00690042 _ZN3iqm15BaseFEvalPlugin7executeEP15inWorkSpace_tagRN5boost10shared_ptrIN14cmddistributor17IIPCompletedEventEEE+00000522
[ 32] 0x00007fb4803cea3f /usr/local/MATLAB/R2016b/bin/glnxa64/libnativejmi.so+00862783 _ZN9nativejmi14JmiFEvalPlugin7executeEP15inWorkSpace_tagRN5boost10shared_ptrIN14cmddistributor17IIPCompletedEventEEE+00000319
[ 33] 0x00007fb4803f1bd5 /usr/local/MATLAB/R2016b/bin/glnxa64/libnativejmi.so+01006549 _ZN3mcr3mvm27McrSwappingIqmPluginAdapterIN9nativejmi14JmiFEvalPluginEE7executeEP15inWorkSpace_tagRN5boost10shared_ptrIN14cmddistributor17IIPCompletedEventEEE+00000741
[ 34] 0x00007fb4a7660a0a /usr/local/MATLAB/R2016b/bin/glnxa64/libmwiqm.so+00649738
[ 35] 0x00007fb4a764ceb2 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwiqm.so+00569010
[ 36] 0x00007fb4a5ea805a /usr/local/MATLAB/R2016b/bin/glnxa64/libmwbridge.so+00159834
[ 37] 0x00007fb4a5ea8617 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwbridge.so+00161303
[ 38] 0x00007fb4a5eaf519 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwbridge.so+00189721
[ 39] 0x00007fb4a5eaf614 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwbridge.so+00189972
[ 40] 0x00007fb4a5eaffa9 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwbridge.so+00192425 _Z8mnParserv+00000617
[ 41] 0x00007fb4a6ecc243 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwmcr.so+00537155
[ 42] 0x00007fb4a6ece1ce /usr/local/MATLAB/R2016b/bin/glnxa64/libmwmcr.so+00545230
[ 43] 0x00007fb4a6ece849 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwmcr.so+00546889 _ZN5boost6detail17task_shared_stateINS_3_bi6bind_tIvPFvRKNS_8functionIFvvEEEENS2_5list1INS2_5valueIS6_EEEEEEvE6do_runEv+00000025
[ 44] 0x00007fb4a6ecd236 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwmcr.so+00541238
[ 45] 0x00007fb4a7694b49 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwiqm.so+00863049
[ 46] 0x00007fb4a768151c /usr/local/MATLAB/R2016b/bin/glnxa64/libmwiqm.so+00783644 _ZN5boost6detail8function21function_obj_invoker0ISt8functionIFNS_3anyEvEES4_E6invokeERNS1_15function_bufferE+00000028
[ 47] 0x00007fb4a76811fc /usr/local/MATLAB/R2016b/bin/glnxa64/libmwiqm.so+00782844 _ZN3iqm18PackagedTaskPlugin7executeEP15inWorkSpace_tagRN5boost10shared_ptrIN14cmddistributor17IIPCompletedEventEEE+00000428
[ 48] 0x00007fb4a7660a0a /usr/local/MATLAB/R2016b/bin/glnxa64/libmwiqm.so+00649738
[ 49] 0x00007fb4a764c690 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwiqm.so+00566928
[ 50] 0x00007fb4a764f048 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwiqm.so+00577608
[ 51] 0x00007fb4b895340a /usr/local/MATLAB/R2016b/bin/glnxa64/libmwservices.so+02634762
[ 52] 0x00007fb4b89549af /usr/local/MATLAB/R2016b/bin/glnxa64/libmwservices.so+02640303
[ 53] 0x00007fb4b89550e6 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwservices.so+02642150 _Z25svWS_ProcessPendingEventsiib+00000102
[ 54] 0x00007fb4a6ecc8c6 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwmcr.so+00538822
[ 55] 0x00007fb4a6eccc42 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwmcr.so+00539714
[ 56] 0x00007fb4a6eba8d6 /usr/local/MATLAB/R2016b/bin/glnxa64/libmwmcr.so+00465110
[ 57] 0x00007fb4b75856ba /lib/x86_64-linux-gnu/libpthread.so.0+00030394
[ 58] 0x00007fb4b72bb41d /lib/x86_64-linux-gnu/libc.so.6+01078301 clone+00000109
[ 59] 0x0000000000000000 <unknown-module>+00000000
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/lly/matlab_crash_dump.23414-1 **
MATLAB is exiting because of fatal error
Killed
Here is my hardware information:
ubuntu 16.04
gtx1070
cdua8.0
cudnn5.1
NVIDIA Drivers: NVIDIA-Linux-x86_64-384.111.run
MATLAB2016b
Any idea on how to solve this? Thank you very much!
Here is my compile caffe process:
Because MATLAB library files and Ubuntu system library files conflict, first i backuped the MATLAB file, and then added the system files to the environment variables, so that the system will use the system's default dynamic file.
①Rename libstdc++.so.6 to libstdc++.so.6_back in the directory of /usr/local/MATLAB/R2016b/sys/os/glnxa64
②execute sudo make matcaffe -j8 which is successful.
③execute sudo make mattest -j8 get this wrong information:
Invalid MEX-file
'/home/lly/work/caffe/matlab/+caffe/private/caffe_.mexa64':
/home/lly/work/caffe/matlab/+caffe/private/caffe_.mexa64: undefined
symbol:
_ZN2cv8imencodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_11_InputArrayERSt6vectorIhSaIhEERKSB_IiSaIiEE.
Error in caffe.set_mode_cpu (line 5)
caffe_('set_mode_cpu');
Error in caffe.run_tests (line 6)
caffe.set_mode_cpu();
④Then, I deleted six MATLAB files in directory /usr/local/MATLAB/R2016b/bin/glnxa64, in order to solve this problem.But finally got the matlab crash problem.
sudo mv libopencv_core.so.2.4 libopencv_core.so.2.4.bak
sudo mv libopencv_core.so.2.4.9 libopencv_core.so.2.4.9.bak
sudo mv libopencv_highgui.so.2.4 libopencv_highgui.so.2.4.bak
sudo mv libopencv_highgui.so.2.4.9 libopencv_highgui.so.2.4.9.bak
sudo mv libopencv_imgproc.so.2.4 libopencv_imgproc.so.2.4.bak
sudo mv libopencv_imgproc.so.2.4.9 libopencv_imgproc.so.2.4.9.bak
Look at the following two things in your log.
Current Graphics Driver: Unknown hardware
OpenGL : hardware
The first one needs to be populated by your graphics card driver information. That is not happening.
Perform the following test:
Put OpenGL to be Software. Check that it has been moved to software
by typing: h = opengl('info')
Check that the current graphics driver field is populated with whatever software driver you have.
Make sure to save these settings.
Restart the Matlab.
Reconfirm the settings and make sure opengl is to software.
Replicate the crash.
Share the Log.
After this you can try running the memory diagnostic on your System Memory and Graphics Card.
I had faced a similar issue and it turned out that there was a problem in my System Memory and Graphics card.
But that you will come to know after the log report is generated.

Why does MATLAB crash with "MATLAB has encountered an internal error and needs to close"?

"Matlab has encountered an internal problem and needs to close"
MATLAB crash file:C:\Users\MJ\AppData\Local\Temp\matlab_crash_dump.7584-1:
------------------------------------------------------------------------
abort() detected at Thu Jan 4 15:30:18 2018
------------------------------------------------------------------------
Configuration:
Crash Decoding : Disabled - No sandbox or build area path
Crash Mode : continue (default)
Current Graphics Driver: Unknown hardware
Default Encoding : KSC_5601
Deployed : false
Graphics card 1 : NVIDIA ( 0x10de ) NVIDIA GeForce GTX 1070 Version 23.21.13.8871 (2017-12-15)
Host Name : DESKTOP-EGKG0V7
MATLAB Architecture : win64
MATLAB Entitlement ID: 2385114
MATLAB Root : C:\Program Files\MATLAB\R2017b
MATLAB Version : 9.3.0.713579 (R2017b)
OpenGL : hardware
Operating System : Microsoft Windows 10 Education
Processor ID : x86 Family 6 Model 158 Stepping 9, GenuineIntel
Virtual Machine : Java 1.8.0_121-b13 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
Window System : Version 10.0 (Build 16299)
Fault Count: 1
Stack Trace (captured):
[ 0] 0x0000000012795e83 bin\win64\libmwfl.dll+00155267 foundation::core::diag::thread_context::unspecified_bool+00000051
[ 1] 0x0000000012794478 bin\win64\libmwfl.dll+00148600 foundation::core::diag::stacktrace_base::capture+00000024
[ 2] 0x00000000127979ce bin\win64\libmwfl.dll+00162254 foundation::core::diag::symbols::getSymbolAddress+00006494
[ 3] 0x000000001279a807 bin\win64\libmwfl.dll+00174087 foundation::core::diag::disable_terminate_dialog+00000887
[ 4] 0x00000000174df615 bin\win64\mcr.dll+00652821 mnShutdownMCR+00023605
[ 5] 0x00000000174df2a1 bin\win64\mcr.dll+00651937 mnShutdownMCR+00022721
[ 6] 0x00000000174df378 bin\win64\mcr.dll+00652152 mnShutdownMCR+00022936
[ 7] 0x00000000174dc5e9 bin\win64\mcr.dll+00640489 mnShutdownMCR+00011273
[ 8] 0x00000000174ddc59 bin\win64\mcr.dll+00646233 mnShutdownMCR+00017017
[ 9] 0x00007ffa0fd4a9ff C:\Windows\System32\ucrtbase.dll+00436735 raise+00000463
[ 10] 0x00007ffa0fd4b6f1 C:\Windows\System32\ucrtbase.dll+00440049 abort+00000049
[ 11] 0x00007ffa003b469a D:\T_caffe\caffe\caffe-windows\matlab\+caffe\private\glog.dll+00018074 google::Demangle+00008410
[ 12] 0x00007ffa003b9de2 D:\T_caffe\caffe\caffe-windows\matlab\+caffe\private\glog.dll+00040418 google::LogMessage::SendToLog+00000738
[ 13] 0x00007ffa003b7a25 D:\T_caffe\caffe\caffe-windows\matlab\+caffe\private\glog.dll+00031269 google::LogMessage::Flush+00000213
[ 14] 0x00007ffa003b61e2 D:\T_caffe\caffe\caffe-windows\matlab\+caffe\private\glog.dll+00025058 google::LogMessageFatal::~LogMessageFatal+00000018
[ 15] 0x00007ff9c9f5db3a D:\T_caffe\caffe\caffe-windows\matlab\+caffe\private\caffe_.mexw64+00842554 mexFunction+00770010
[ 16] 0x00007ff9c9ea1dba D:\T_caffe\caffe\caffe-windows\matlab\+caffe\private\caffe_.mexw64+00073146 mexFunction+00000602
[ 17] 0x00000000fc60234a bin\win64\libmex.dll+00140106 mexRunMexFile+00000314
[ 18] 0x00000000fc600d22 bin\win64\libmex.dll+00134434 mexFeature_mexver+00002146
[ 19] 0x00000000fc5ffab7 bin\win64\libmex.dll+00129719 mexUnlock+00028455
[ 20] 0x00000000175aca93 bin\win64\pgo\m_dispatcher.dll+00117395 Mfh_file::dispatch_fh_impl+00000835
[ 21] 0x00000000175ac73e bin\win64\pgo\m_dispatcher.dll+00116542 Mfh_file::dispatch_fh+00000062
[ 22] 0x000000001759a8d8 bin\win64\pgo\m_dispatcher.dll+00043224 Mfunction_handle::dispatch+00001032
[ 23] 0x000000001849794e bin\win64\pgo\m_lxe.dll+00227662
[ 24] 0x0000000018494571 bin\win64\pgo\m_lxe.dll+00214385
[ 25] 0x000000001849b3a6 bin\win64\pgo\m_lxe.dll+00242598
[ 26] 0x000000001849bfb3 bin\win64\pgo\m_lxe.dll+00245683
[ 27] 0x000000001849dff5 bin\win64\pgo\m_lxe.dll+00253941
[ 28] 0x000000001849d44f bin\win64\pgo\m_lxe.dll+00250959
[ 29] 0x000000001849d822 bin\win64\pgo\m_lxe.dll+00251938
[ 30] 0x000000001856331b bin\win64\pgo\m_lxe.dll+01061659 boost::serialization::singleton<boost::archive::detail::pointer_oserializer<boost::archive::binaryTerm_oarchive,MathWorks::lxe::MatlabIrTree> >::get_instance+00604503
[ 31] 0x000000001856ad46 bin\win64\pgo\m_lxe.dll+01092934 boost::serialization::singleton<boost::archive::detail::pointer_oserializer<boost::archive::binaryTerm_oarchive,MathWorks::lxe::MatlabIrTree> >::get_instance+00635778
[ 32] 0x000000001856a570 bin\win64\pgo\m_lxe.dll+01090928 boost::serialization::singleton<boost::archive::detail::pointer_oserializer<boost::archive::binaryTerm_oarchive,MathWorks::lxe::MatlabIrTree> >::get_instance+00633772
[ 33] 0x00000000184fa4d6 bin\win64\pgo\m_lxe.dll+00632022 boost::serialization::singleton<boost::archive::detail::pointer_oserializer<boost::archive::binaryTerm_oarchive,MathWorks::lxe::MatlabIrTree> >::get_instance+00174866
[ 34] 0x00000000184f9ccd bin\win64\pgo\m_lxe.dll+00629965 boost::serialization::singleton<boost::archive::detail::pointer_oserializer<boost::archive::binaryTerm_oarchive,MathWorks::lxe::MatlabIrTree> >::get_instance+00172809
[ 35] 0x00000000184f9be6 bin\win64\pgo\m_lxe.dll+00629734 boost::serialization::singleton<boost::archive::detail::pointer_oserializer<boost::archive::binaryTerm_oarchive,MathWorks::lxe::MatlabIrTree> >::get_instance+00172578
[ 36] 0x00000000184f35a5 bin\win64\pgo\m_lxe.dll+00603557 boost::serialization::singleton<boost::archive::detail::pointer_oserializer<boost::archive::binaryTerm_oarchive,MathWorks::lxe::MatlabIrTree> >::get_instance+00146401
[ 37] 0x00000000184f3532 bin\win64\pgo\m_lxe.dll+00603442 boost::serialization::singleton<boost::archive::detail::pointer_oserializer<boost::archive::binaryTerm_oarchive,MathWorks::lxe::MatlabIrTree> >::get_instance+00146286
[ 38] 0x00000000184f71d5 bin\win64\pgo\m_lxe.dll+00618965 boost::serialization::singleton<boost::archive::detail::pointer_oserializer<boost::archive::binaryTerm_oarchive,MathWorks::lxe::MatlabIrTree> >::get_instance+00161809
[ 39] 0x00000000177b5b63 bin\win64\pgo\m_interpreter.dll+00416611 inEvalCmdWithLocalReturn+00000063
[ 40] 0x00000000fb60de26 bin\win64\libmwbridge.dll+00122406 mnParser+00001254
[ 41] 0x000000001747bdb1 bin\win64\mcr.dll+00245169 mcr::runtime::setInterpreterThreadSingletonToCurrent+00029793
[ 42] 0x000000001747ace5
bin\win64\mcr.dll+00240869 mcr::runtime::setInterpreterThreadSingletonToCurrent+00025493
[ 43] 0x000000001747ad53 bin\win64\mcr.dll+00240979 mcr::runtime::setInterpreterThreadSingletonToCurrent+00025603
[ 44] 0x000000001747b6e1 bin\win64\mcr.dll+00243425 mcr::runtime::setInterpreterThreadSingletonToCurrent+00028049
[ 45] 0x00000000fd02cc77 bin\win64\iqm.dll+00642167 iqm::UserEvalPlugin::pre+00028951
[ 46] 0x00000000fd039cfc bin\win64\iqm.dll+00695548 iqm::UserEvalPlugin::pre+00082332
[ 47] 0x00000000fd02737f bin\win64\iqm.dll+00619391 iqm::UserEvalPlugin::pre+00006175
[ 48] 0x00000000fd02cc16 bin\win64\iqm.dll+00642070 iqm::UserEvalPlugin::pre+00028854
[ 49] 0x00000000fd027863 bin\win64\iqm.dll+00620643 iqm::UserEvalPlugin::pre+00007427
[ 50] 0x00000000fd03c8b6 bin\win64\iqm.dll+00706742 iqm::UserEvalPlugin::pre+00093526
[ 51] 0x00000000fd0080f7 bin\win64\iqm.dll+00491767 iqm::PackagedTaskPlugin::PackagedTaskPlugin+00000759
[ 52] 0x00000000fd0088bf bin\win64\iqm.dll+00493759 iqm::PackagedTaskPlugin::execute+00000879
[ 53] 0x00000000fd00817d bin\win64\iqm.dll+00491901 iqm::PackagedTaskPlugin::PackagedTaskPlugin+00000893
[ 54] 0x00000000fd008708 bin\win64\iqm.dll+00493320 iqm::PackagedTaskPlugin::execute+00000440
[ 55] 0x00000000fcfdbd3a bin\win64\iqm.dll+00310586 iqm::Iqm::setupIqmFcnPtrs+00079802
[ 56] 0x00000000fcfdbc06 bin\win64\iqm.dll+00310278 iqm::Iqm::setupIqmFcnPtrs+00079494
[ 57] 0x00000000fcfbf5be bin\win64\iqm.dll+00193982 iqm::Iqm::deliver+00004046
[ 58] 0x00000000fcfc0545 bin\win64\iqm.dll+00197957 iqm::Iqm::deliver+00008021
[ 59] 0x00000001001237c1 bin\win64\libmwservices.dll+01259457
services::system_events::PpeDispatchHook::dispatchOne+00021505
[ 60] 0x0000000100128663
bin\win64\libmwservices.dll+01279587 sysq::addProcessPendingEventsUnitTestHook+00002211
[ 61] 0x0000000100128850 bin\win64\libmwservices.dll+01280080 sysq::addProcessPendingEventsUnitTestHook+00002704
[ 62] 0x0000000100129c26 bin\win64\libmwservices.dll+01285158 sysq::getCondition+00003462
[ 63] 0x000000010012ac66 bin\win64\libmwservices.dll+01289318 svWS_ProcessPendingEvents+00000230
[ 64] 0x000000001747c244 bin\win64\mcr.dll+00246340 mcr::runtime::setInterpreterThreadSingletonToCurrent+00030964
[ 65] 0x000000001747c964 bin\win64\mcr.dll+00248164 mcr::runtime::setInterpreterThreadSingletonToCurrent+00032788
[ 66] 0x0000000017472762 bin\win64\mcr.dll+00206690 mcr_process_events+00008818
[ 67] 0x00000000172e23c5 bin\win64\MVMLocal.dll+00271301 mvm_server::inproc::LocalFactory::terminate+00088005
[ 68] 0x00000000fa957669 bin\win64\mvm.dll+01209961 mvm::detail::initLocalMvmHack+00000569
[ 69] 0x00000000fa957e2b bin\win64\mvm.dll+01211947 mvm::detail::SessionImpl::privateSession+00000555
[ 70] 0x00000000fa958051 bin\win64\mvm.dll+01212497 mvm::detail::SessionImpl::privateSession+00001105
[ 71] 0x0000000140007833 bin\win64\MATLAB.exe+00030771
[ 72] 0x000000014000863f bin\win64\MATLAB.exe+00034367
[ 73] 0x00007ffa10ad1fe4 C:\Windows\System32\KERNEL32.DLL+00073700 BaseThreadInitThunk+00000020
[ 74] 0x00007ffa1348ef91 C:\Windows\SYSTEM32\ntdll.dll+00454545 RtlUserThreadStart+00000033
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.
MATLAB crashes due to an unhandled exception in a mex file or compiled code called by a mex file
The error message tells you where the error happened:
This error was detected while a MEX-file was running.
That is, this is not a MATLAB error but a uncaught exception in a mex function (or code called by that mex function, which is usually the case). This is why MATLAB crashes rather than just outputs an error, as it would do for any caught exception. The error trace can help you find the culprit. Look for mexFunction in the stack trace and you will find which mex file is to blame:
[ 16] 0x00007ff9c9ea1dba D:\T_caffe\caffe\caffe-windows\matlab+caffe\private\caffe_.mexw64+00073146 mexFunction+00000602
So the error originates in Caffe's MATLAB interface. Look above this line to find where the exception actually happened. At this point you might be stumped as large traces of unknown libraries are usually impossible to decipher. Your options are now the options of anyone trying to debug a crash. My recommendation:
Find the call to Caffe in MATLAB that is causing the crash. Save your workspace right before the call so you can easily restore it when MATLAB crashes.
See that the crash is reproduced.
Look closely at your inputs and see if you can find something fishy.
If not, find some basic example for running the same function, then gradually work your way from that to your own inputs and see when crashes start happening.
This should help you narrow down what is causing the crash. A different option is to get the source code, build it with debug symbols and debug it by attaching to MATLAB. Depending on your setup, this could be overkill or else lead you into code you don't understand.
You might, on an off-chance, find an actual bug in the software you are using. I don't know how stable Caffe and its MATLAB interface are. However it is best to assume that widely used libraries are more stable than your own code and start your debugging process from there. Good luck!

Access violation while running app via windbg

My application get access violation sometimes.
I runned application through windbg, and it stopped in the following function .
also tried _vscprintf instead of vsnprintf, and the result was same.
I 'm newbie about windbg.
Any help will be appreciated.
int tsk_sprintf_2(char** str, const char* format, va_list* ap)
{
int len = 0;
va_list ap2;
ap2 = *ap;
len = vsnprintf(0, 0, format, *ap); /*-> access violation in this point! */
*str = (char*)calloc(1, len+1);
vsnprintf(*str, len, format, ap2);
va_end(ap2);
return len;
}
==> the following are the result from windbg
MANAGED_STACK: !dumpstack -EE
OS Thread Id: 0x5b8 (22)
Current frame:
ChildEBP RetAddr Caller, Callee
PRIMARY_PROBLEM_CLASS: WRONG_SYMBOLS
BUGCHECK_STR: APPLICATION_FAULT_WRONG_SYMBOLS
LAST_CONTROL_TRANSFER: from 1026d3d8 to 102e14cf
STACK_TEXT:
WARNING: Stack unwind information not available. Following frames may be wrong.
1d3cde7c 1026d3d8 1d3cdea8 0898eeeb 00000000 MSVCR100D!vcwprintf_s_l+0x52ef
1d3cded0 1026d46c 00000000 00000000 0898ee88 MSVCR100D!vsnprintf_l+0x158
1d3cdeec 0834d927 00000000 00000000 0898ee88 MSVCR100D!vsnprintf+0x1c
1d3cdfe8 1002891e 1d3ce0d0 0898ee88 1d3ce1e4 tinySAK!tsk_sprintf_2+0x57
1d3ce0f0 10028b77 09a16fe8 0898ee88 00000000 tinyWRAP!debug_xxx_cb+0x6e
1d3ce1ec 088b697b 09a16fe8 0898ee88 00000444 tinyWRAP!DDebugCallback::debug_info_cb+0x37
1d3cffb4 7c80b713 1cd10f90 1d2cfb44 7c947d9a tinyNET!tnet_transport_mainthread+0x1adb
1d3cffec 00000000 088a2aff 1cd10f90 00000000 KERNEL32!GetModuleFileNameA+0x1b4
SYMBOL_STACK_INDEX: 0
SYMBOL_NAME: msvcr100d!vcwprintf_s_l+52ef
FOLLOWUP_NAME: MachineOwner
MODULE_NAME: MSVCR100D
IMAGE_NAME: MSVCR100D.dll
STACK_COMMAND: ~22s ; kb
BUCKET_ID: WRONG_SYMBOLS
FAILURE_BUCKET_ID: WRONG_SYMBOLS_c0000005_MSVCR100D.dll!vcwprintf_s_l
WATSON_STAGEONE_URL:
Followup: MachineOwner
---------
route.
You're attempting to print into a NULL pointer: len = vsnprintf(0, 0, format, *ap);; of course, it will crash. Send a valid address of output buffer as the first parameter and valid length as second.

How do I read buffer data retrieved from sysctlbyname() in iPhone?

I'm trying to get TCP open port list in iphone by using sysctlbyname().
sysctlbyname(const char *name, void *oldp, size_t *oldlenp, void *newp,
size_t newlen);
.
#include <sys/sysctl.h>
size_t len = 0;
if (sysctlbyname("net.inet.tcp.pcblist", 0, &len, 0, 0) < 0) {
perror("sysctlbyname");
} else {
char *buf = malloc(len);
//printf("%d",sizeof(buf));
sysctlbyname("net.inet.tcp.pcblist", buf, &len, 0, 0);
NSData *data = [NSData dataWithBytesNoCopy:buf length:len];
NSLog(#"data = %#", data);
//printf("%d",sizeof(buf));
//printf("%s",buf);
}
The information is copied into the buffer specified by oldp.
OUTPUT::
data = <18000000 34000000 d8160000 00000000 7d760000 00000000 0c020000 00000000 00000000 00000000 00000000 0050c598 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 c2160000 00000000 40008000 00000000 01400000
Buffer is filled with data here.but I'm unable to print the data in readable format.converting this data into NSString won't help as internally buffer has its own structure.
Anyone knows how to obtain TCP open port list as output from this data?
Thanks.
copy netstat code from BSD source.
see the printproto() function in main.c
This will explore all related to this buffer and how to get TCP port list.
Thanks.

Matlab R2012a crashes when trying 3D-graphics on Ubuntu 12.10

I'm having problems with my 3D-plotting on Ubuntu 12.10. The crash occurs immeadiately after I try to plot data in 3D. I have Crash dump and other error report here:
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/tls/nouveau_dri.so
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/nouveau_dri.so
libGL error: dlopen /usr/lib/x86_64-linux-gnu/dri/nouveau_dri.so failed (/home/jonne/MATLAB/R2012a/bin/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /usr/lib/x86_64-linux-gnu/dri/nouveau_dri.so))
libGL: OpenDriver: trying ${ORIGIN}/dri/tls/nouveau_dri.so
libGL: OpenDriver: trying ${ORIGIN}/dri/nouveau_dri.so
libGL error: dlopen ${ORIGIN}/dri/nouveau_dri.so failed (${ORIGIN}/dri/nouveau_dri.so: cannot open shared object file: No such file or directory)
libGL: OpenDriver: trying /usr/lib/dri/tls/nouveau_dri.so
libGL: OpenDriver: trying /usr/lib/dri/nouveau_dri.so
libGL error: dlopen /usr/lib/dri/nouveau_dri.so failed (/usr/lib/dri/nouveau_dri.so: cannot open shared object file: No such file or directory)
libGL error: unable to load driver: nouveau_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: nouveau
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/tls/swrast_dri.so
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
libGL error: dlopen /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so failed (/home/jonne/MATLAB/R2012a/bin/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /usr/lib/x86_64-linux-gnu/libLLVM-3.1.so.1))
libGL: OpenDriver: trying ${ORIGIN}/dri/tls/swrast_dri.so
libGL: OpenDriver: trying ${ORIGIN}/dri/swrast_dri.so
libGL error: dlopen ${ORIGIN}/dri/swrast_dri.so failed (${ORIGIN}/dri/swrast_dri.so: cannot open shared object file: No such file or directory)
libGL: OpenDriver: trying /usr/lib/dri/tls/swrast_dri.so
libGL: OpenDriver: trying /usr/lib/dri/swrast_dri.so
libGL error: dlopen /usr/lib/dri/swrast_dri.so failed (/usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory)
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
CRASH DUMP:
------------------------------------------------------------------------
Segmentation violation detected at Wed Dec 19 02:17:00 2012
------------------------------------------------------------------------
Configuration:
Crash Decoding : Disabled
Current Visual : 0x21 (class 4, depth 24)
Default Encoding: UTF-8
GNU C Library : 2.15 stable
MATLAB Root : /home/jonne/MATLAB/R2012a
MATLAB Version : 7.14.0.739 (R2012a)
Operating System: Linux 3.5.0-19-generic #30-Ubuntu SMP Tue Nov 13 17:48:01 UTC 2012 x86_64
Processor ID : x86 Family 31 Model 6 Stepping 2, AuthenticAMD
Virtual Machine : Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode
Window System : The X.Org Foundation (11300000), display :0.0
Fault Count: 1
Abnormal termination:
Segmentation violation
Register State (from fault):
RAX = 0000000000000000 RBX = 0000000000000000
RCX = 0000000000000000 RDX = 00007fb9ac068658
RSP = 00007fb9bb8e38e8 RBP = 00000000009a0005
RSI = 0000000000000000 RDI = 0000000000000000
R8 = 00007fb9ac068680 R9 = 0000000000000000
R10 = 0000000000000000 R11 = 0000000000000000
R12 = 0000000000001f02 R13 = 0000000000000000
R14 = 00007fb9c6b797d0 R15 = 0000000000000000
RIP = 00007fb973df6d00 EFL = 0000000000010206
CS = 0033 FS = 0000 GS = 0000
Stack Trace (from fault):
[ 0] 0x00007fb9d09f592e /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwfl.so+00370990 _ZN2fl4diag15stacktrace_base7captureERKNS0_14thread_contextEm+000158
[ 1] 0x00007fb9d09f87d0 /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwfl.so+00382928
[ 2] 0x00007fb9d09f8b3b /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwfl.so+00383803 _ZN2fl4diag13terminate_logEPKcRKNS0_14thread_contextE+000171
[ 3] 0x00007fb9cf8dc203 /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwmcr.so+01253891 _ZN2fl4diag13terminate_logEPKcPK8ucontext+000067
[ 4] 0x00007fb9cf8d90fd /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwmcr.so+01241341
[ 5] 0x00007fb9cf8da79d /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwmcr.so+01247133
[ 6] 0x00007fb9cf8da925 /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwmcr.so+01247525
[ 7] 0x00007fb9cf8daf01 /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwmcr.so+01249025
[ 8] 0x00007fb9cf8db3f5 /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwmcr.so+01250293
[ 9] 0x00007fb9cdfa2cb0 /lib/x86_64-linux-gnu/libpthread.so.0+00064688
[ 10] 0x00007fb973df6d00 /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0+00056576 xcb_glx_get_string_string_length+000000
[ 11] 0x00007fb97c98a6b4 /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1+00272052 __glXGetString+000068
[ 12] 0x00007fb97c98812e /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1+00262446
[ 13] 0x00007fb97cbbf379 /home/jonne/MATLAB/R2012a/bin/glnxa64/glren.so+00078713
[ 14] 0x00007fb97cbb6b40 /home/jonne/MATLAB/R2012a/bin/glnxa64/glren.so+00043840
[ 15] 0x00007fb97cbb6cc6 /home/jonne/MATLAB/R2012a/bin/glnxa64/glren.so+00044230
[ 16] 0x00007fb9c68d30a8 /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwhg.so+09408680 _Z22OpenGLSetupEnumstrOnceb+000296
[ 17] 0x00007fb9c6827ac7 /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwhg.so+08706759 gf_DetermineBestRenderMode+000183
[ 18] 0x00007fb9c6827c0b /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwhg.so+08707083 _Z22gf_DetermineRenderModeP11GObject_tagi+000107
[ 19] 0x00007fb9c6827d0a /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwhg.so+08707338 InitializeFigureRenderEngine+000074
[ 20] 0x00007fb9c6828114 /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwhg.so+08708372
[ 21] 0x00007fb9c689418c /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwhg.so+09150860
[ 22] 0x00007fb9c684a89b /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwhg.so+08849563 _Z24commitHG1DatabaseUpdatesb+000235
[ 23] 0x00007fb9d0157e16 /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwservices.so+01359382 _Z26svWS_CommitDatabaseUpdates28svCommitDatabaseUpdatesType_+000390
[ 24] 0x00007fb9c5030387 /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwuix.so+00525191
[ 25] 0x00007fb9c5030691 /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwuix.so+00525969
[ 26] 0x00007fb9cfb476eb /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwbridge.so+00124651
[ 27] 0x00007fb9cfb47cde /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwbridge.so+00126174 _Z10ioReadLinebP8_IO_FILEPcS1_iPbRKN5boost8optionalIKP15inWorkSpace_tagEEb+000990
[ 28] 0x00007fb9cfb48165 /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwbridge.so+00127333
[ 29] 0x00007fb9cfb4cd0a /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwbridge.so+00146698
[ 30] 0x00007fb9cfb4d165 /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwbridge.so+00147813
[ 31] 0x00007fb9cfb4d9ce /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwbridge.so+00149966 mnParser+000702
[ 32] 0x00007fb9cf8c0de2 /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwmcr.so+01142242 _ZN11mcrInstance30mnParser_on_interpreter_threadEv+000034
[ 33] 0x00007fb9cf8a351a /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwmcr.so+01021210
[ 34] 0x00007fb9cf8a3598 /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwmcr.so+01021336
[ 35] 0x00007fb9c5021376 /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwuix.so+00463734
[ 36] 0x00007fb9c502b862 /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwuix.so+00505954
[ 37] 0x00007fb9d01599a1 /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwservices.so+01366433 _ZSt8for_eachIN9__gnu_cxx17__normal_iteratorIPN5boost8weak_ptrIN4sysq10ws_ppeHookEEESt6vectorIS6_SaIS6_EEEENS4_8during_FIS6_NS2_10shared_ptrIS5_EEEEET0_T_SH_SG_+000081
[ 38] 0x00007fb9d015aaab /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwservices.so+01370795
[ 39] 0x00007fb9d01585f9 /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwservices.so+01361401 _Z25svWS_ProcessPendingEventsiib+000665
[ 40] 0x00007fb9cf8a276f /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwmcr.so+01017711
[ 41] 0x00007fb9cf8a2c3b /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwmcr.so+01018939
[ 42] 0x00007fb9cf8a2d97 /home/jonne/MATLAB/R2012a/bin/glnxa64/libmwmcr.so+01019287
[ 43] 0x00007fb9cdf9ae9a /lib/x86_64-linux-gnu/libpthread.so.0+00032410
[ 44] 0x00007fb9cdcc7cbd /lib/x86_64-linux-gnu/libc.so.6+00998589 clone+000109
Does anyone have any idea what should I do to get this work? 2D-plotting works, but 3D-does not...
Thank you!
What renderer are you using? Could you post a code snippet of your script?
Try creating the figure first, a specifying the renderer. For example,
figure('renderer','zbuffer')
I've had more luck with the zbuffer renderer than opengl or painters for example. In fact, in my startup script I've ensured every figure window that I open uses zbuffer - I've found it is much quicker to render, and has less problems with random crashes.
See: http://www.mathworks.com.au/help/matlab/ref/figure_props.html
Renderer
painters | zbuffer | OpenGL
Rendering method used for screen and printing. Selects the method used to render MATLAB graphics. The choices are:
painters — The original rendering method used by MATLAB is faster when the figure contains only simple or small graphics objects.
zbuffer — MATLAB draws graphics objects faster and more accurately because it colors objects on a per-pixel basis and MATLAB renders only those pixels that are visible in the scene (thus eliminating front-to-back sorting errors). Note that this method can consume a lot of system memory if MATLAB is displaying a complex scene.
OpenGL — OpenGL is a renderer that is available on many computer systems. This renderer is generally faster than painters or zbuffer and in some cases enables MATLAB to access graphics hardware that is available on some systems.
This helped me:
https://bbs.archlinux.org/viewtopic.php?id=154775
(...which got help from How to tell mex to link with the libstdc++.so.6 in /usr/lib instead of the one in the MATLAB directory?)
basically I just did this:
sudo mv /usr/local/MATLAB/R2012a/sys/os/glnx86/libstdc++.so.6 /usr/local/MATLAB/R2012a/sys/os/glnx86/libstdc++.so.6__bck
and
sudo ln -s /usr/lib/i386-linux-gnu/libstdc++.so.6.0.17 /usr/local/MATLAB/R2012a/sys/os/glnx86/libstdc++.so.6