Ask Your Question

Revision history [back]

Segmentation fault on imread after upgrading to Ubuntu 13.10

I upgraded to Ubuntu 13.10 and now get a segfault on imread. I've run the same code on 13.04 and there were no issues. I then tried to use the script at: https://help.ubuntu.com/community/OpenCV. The script installed OpenCV 2.4.8 fine, but the same issue happened when running my binary. I ran valgrind to try to find the source of the error, but I'm stumped.

tarun@heron:~$ valgrind ./DisplayImage Documents/getwell/war/rock.gif
==23413== Memcheck, a memory error detector
==23413== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==23413== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==23413== Command: ./DisplayImage Documents/getwell/war/rock.gif
==23413== 
==23413== Jump to the invalid address stated on the next line
==23413==    at 0x0: ???
==23413==    by 0x13D81DE6: ??? (in /usr/lib/x86_64-linux-gnu/pkcs11/gnome-keyring-pkcs11.so)
==23413==    by 0x13D87821: ??? (in /usr/lib/x86_64-linux-gnu/pkcs11/gnome-keyring-pkcs11.so)
==23413==    by 0x12C9FE05: ??? (in /usr/lib/x86_64-linux-gnu/libp11-kit.so.0.0.0)
==23413==    by 0x12CA04D3: ??? (in /usr/lib/x86_64-linux-gnu/libp11-kit.so.0.0.0)
==23413==    by 0x12CA0C5C: p11_kit_initialize_registered (in /usr/lib/x86_64-linux-gnu/libp11-kit.so.0.0.0)
==23413==    by 0x109AFDB9: gnutls_pkcs11_init (in /usr/lib/x86_64-linux-gnu/libgnutls.so.26.22.6)
==23413==    by 0x1099A40F: gnutls_global_init (in /usr/lib/x86_64-linux-gnu/libgnutls.so.26.22.6)
==23413==    by 0x98D7BED: ??? (in /usr/lib/x86_64-linux-gnu/libavformat.so.53.21.1)
==23413==    by 0x991973E: avformat_network_init (in /usr/lib/x86_64-linux-gnu/libavformat.so.53.21.1)
==23413==    by 0x506A753: _GLOBAL__sub_I_cap_ffmpeg.cpp (in            /usr/local/lib/libopencv_highgui.so.2.4.8)
==23413==    by 0x400F855: call_init.part.0 (dl-init.c:84)
==23413==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==23413== 
==23413== 
==23413== Process terminating with default action of signal 11 (SIGSEGV)
==23413==  Bad permissions for mapped region at address 0x0
==23413==    at 0x0: ???
==23413==    by 0x13D81DE6: ??? (in /usr/lib/x86_64-linux-gnu/pkcs11/gnome-keyring-pkcs11.so)
==23413==    by 0x13D87821: ??? (in /usr/lib/x86_64-linux-gnu/pkcs11/gnome-keyring-pkcs11.so)
==23413==    by 0x12C9FE05: ??? (in /usr/lib/x86_64-linux-gnu/libp11-kit.so.0.0.0)
==23413==    by 0x12CA04D3: ??? (in /usr/lib/x86_64-linux-gnu/libp11-kit.so.0.0.0)
==23413==    by 0x12CA0C5C: p11_kit_initialize_registered (in /usr/lib/x86_64-linux-gnu/libp11-kit.so.0.0.0)
==23413==    by 0x109AFDB9: gnutls_pkcs11_init (in /usr/lib/x86_64-linux-gnu/libgnutls.so.26.22.6)
==23413==    by 0x1099A40F: gnutls_global_init (in /usr/lib/x86_64-linux-gnu/libgnutls.so.26.22.6)
==23413==    by 0x98D7BED: ??? (in /usr/lib/x86_64-linux-gnu/libavformat.so.53.21.1)
==23413==    by 0x991973E: avformat_network_init (in /usr/lib/x86_64-linux-gnu/libavformat.so.53.21.1)
==23413==    by 0x506A753: _GLOBAL__sub_I_cap_ffmpeg.cpp (in /usr/local/lib/libopencv_highgui.so.2.4.8)
==23413==    by 0x400F855: call_init.part.0 (dl-init.c:84)
==23413== 
==23413== HEAP SUMMARY:
==23413==     in use at exit: 92,860 bytes in 1,285 blocks
==23413==   total heap usage: 1,848 allocs, 563 frees, 181,192 bytes allocated
==23413== 
==23413== LEAK SUMMARY:
==23413==    definitely lost: 0 bytes in 0 blocks
==23413==    indirectly lost: 0 bytes in 0 blocks
==23413==      possibly lost: 4,936 bytes in 88 blocks
==23413==    still reachable: 87,924 bytes in 1,197 blocks
==23413==         suppressed: 0 bytes in 0 blocks
==23413== Rerun with --leak-check=full to see details of leaked memory
==23413== 
==23413== For counts of detected and suppressed errors, rerun with: -v
==23413== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 2 from 2)
Segmentation fault (core dumped)