Bug report #8932

segmentation fault in GDAL when exiting, QGIS hangs

Added by Etienne Tourigny over 10 years ago. Updated over 9 years ago.

Status:Closed
Priority:Low
Assignee:-
Category:Build/Install
Affected QGIS version:2.0.1 Regression?:No
Operating System:Linux Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:Yes Copied to github as #:17602

Description

This happens with recent gdal versions (1.9, 1.10 and trunk), both QGIS Master and 2.0 Release. OS is Linux Mint 15.

After exiting QGIS, program crashes and hangs, it must be killed manually.

Crash happens in GDAL's CPLCleanupTLSList, backtrace below (with gdal 1.10)

*** Error in `/home/softdev/bin/qgis': corrupted double-linked list: 0x0000000001593a90 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7fecd)[0x7ffff0333ecd]
/lib/x86_64-linux-gnu/libc.so.6(+0x80898)[0x7ffff0334898]
/home/softdev/lib/libgdal.so.1(+0x6268f3)[0x7ffff4da88f3]
/home/softdev/lib/libgdal.so.1(_ZN17GDALDriverManagerD1Ev+0x175)[0x7ffff4d6a6a5]
/home/softdev/lib/libgdal.so.1(_ZN17GDALDriverManagerD0Ev+0x9)[0x7ffff4d6a739]
/home/softdev/lib/libgdal.so.1(+0x316e5a)[0x7ffff4a98e5a]
/lib64/ld-linux-x86-64.so.2(+0xff47)[0x7ffff7de9f47]
/lib/x86_64-linux-gnu/libc.so.6(+0x3c121)[0x7ffff02f0121]
/lib/x86_64-linux-gnu/libc.so.6(+0x3c1a5)[0x7ffff02f01a5]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfc)[0x7ffff02d5eac]
/home/softdev/bin/qgis[0x557a09]
======= Memory map: ========
00400000-00c3a000 r-xp 00000000 08:07 966290                             /home/softdev/bin/qgis
00e3a000-00e3c000 r--p 0083a000 08:07 966290                             /home/softdev/bin/qgis
00e3c000-00e43000 rw-p 0083c000 08:07 966290                             /home/softdev/bin/qgis
00e43000-06146000 rw-p 00000000 00:00 0                                  [heap]
7fffb4000000-7fffb4021000 rw-p 00000000 00:00 0 
7fffb4021000-7fffb8000000 ---p 00000000 00:00 0 
7fffbb366000-7fffbb566000 rw-s 00000000 00:04 24739891                   /SYSV00000000 (deleted)
7fffbb566000-7fffbb56a000 r-xp 00000000 08:02 396589                     /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.so
7fffbb56a000-7fffbb76a000 ---p 00004000 08:02 396589                     /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.so
7fffbb76a000-7fffbb76b000 r--p 00004000 08:02 396589                     /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.so
7fffbb76b000-7fffbb76c000 rw-p 00005000 08:02 396589                     /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.so
7fffbc000000-7fffbc031000 rw-p 00000000 00:00 0 
7fffbc031000-7fffc0000000 ---p 00000000 00:00 0 
7fffc0869000-7fffc08c9000 rw-s 00000000 00:04 24641589                   /SYSV00000000 (deleted)
7fffc08c9000-7fffc08ca000 ---p 00000000 00:00 0 
7fffc08ca000-7fffc10ca000 rw-p 00000000 00:00 0 
7fffc10ca000-7fffc10f6000 r-xp 00000000 08:02 397490                     /usr/lib/x86_64-linux-gnu/qt4/plugins/bearer/libqnmbearer.so
7fffc10f6000-7fffc12f6000 ---p 0002c000 08:02 397490                     /usr/lib/x86_64-linux-gnu/qt4/plugins/bearer/libqnmbearer.so
7fffc12f6000-7fffc12f8000 r--p 0002c000 08:02 397490                     /usr/lib/x86_64-linux-gnu/qt4/plugins/bearer/libqnmbearer.so
7fffc12f8000-7fffc12f9000 rw-p 0002e000 08:02 397490                     /usr/lib/x86_64-linux-gnu/qt4/plugins/bearer/libqnmbearer.so
7fffc12f9000-7fffc1305000 r-xp 00000000 08:02 397488                     /usr/lib/x86_64-linux-gnu/qt4/plugins/bearer/libqgenericbearer.so
7fffc1305000-7fffc1505000 ---p 0000c000 08:02 397488                     /usr/lib/x86_64-linux-gnu/qt4/plugins/bearer/libqgenericbearer.so
7fffc1505000-7fffc1506000 r--p 0000c000 08:02 397488                     /usr/lib/x86_64-linux-gnu/qt4/plugins/bearer/libqgenericbearer.so
7fffc1506000-7fffc1507000 rw-p 0000d000 08:02 397488                     /usr/lib/x86_64-linux-gnu/qt4/plugins/bearer/libqgenericbearer.so
7fffc1507000-7fffc1543000 r-xp 00000000 08:02 397491                     /usr/lib/x86_64-linux-gnu/qt4/plugins/bearer/libqconnmanbearer.so
7fffc1543000-7fffc1743000 ---p 0003c000 08:02 397491                     /usr/lib/x86_64-linux-gnu/qt4/plugins/bearer/libqconnmanbearer.so
7fffc1743000-7fffc1745000 r--p 0003c000 08:02 397491                     /usr/lib/x86_64-linux-gnu/qt4/plugins/bearer/libqconnmanbearer.so
7fffc1745000-7fffc1746000 rw-p 0003e000 08:02 397491                     /usr/lib/x86_64-linux-gnu/qt4/plugins/bearer/libqconnmanbearer.so
7fffc1746000-7fffc1747000 ---p 00000000 00:00 0 
7fffc1747000-7fffc1f47000 rw-p 00000000 00:00 0 
7fffc1f47000-7fffc1f55000 r-xp 00000000 08:02 297784                     /usr/lib/python2.7/lib-dynload/pyexpat.x86_64-linux-gnu.so
7fffc1f55000-7fffc2154000 ---p 0000e000 08:02 297784                     /usr/lib/python2.7/lib-dynload/pyexpat.x86_64-linux-gnu.so
7fffc2154000-7fffc2155000 r--p 0000d000 08:02 297784                     /usr/lib/python2.7/lib-dynload/pyexpat.x86_64-linux-gnu.so
7fffc2155000-7fffc2157000 rw-p 0000e000 08:02 297784                     /usr/lib/python2.7/lib-dynload/pyexpat.x86_64-linux-gnu.so
7fffc2157000-7fffc2166000 r-xp 00000000 08:02 688853                     /usr/lib/python2.7/dist-packages/mx/DateTime/mxDateTime/mxDateTime.so
7fffc2166000-7fffc2365000 ---p 0000f000 08:02 688853                     /usr/lib/python2.7/dist-packages/mx/DateTime/mxDateTime/mxDateTime.so
7fffc2365000-7fffc2366000 r--p 0000e000 08:02 688853                     /usr/lib/python2.7/dist-packages/mx/DateTime/mxDateTime/mxDateTime.so
7fffc2366000-7fffc2367000 rw-p 0000f000 08:02 688853                     /usr/lib/python2.7/dist-packages/mx/DateTime/mxDateTime/mxDateTime.so
7fffc2367000-7fffc2390000 r-xp 00000000 08:02 1065829                    /usr/lib/python2.7/dist-packages/psycopg2/_psycopg.so
7fffc2390000-7fffc2590000 ---p 00029000 08:02 1065829                    /usr/lib/python2.7/dist-packages/psycopg2/_psycopg.so
7fffc2590000-7fffc2591000 r--p 00029000 08:02 1065829                    /usr/lib/python2.7/dist-packages/psycopg2/_psycopg.so
7fffc2591000-7fffc2597000 rw-p 0002a000 08:02 1065829                    /usr/lib/python2.7/dist-packages/psycopg2/_psycopg.so
7fffc2597000-7fffc2843000 r-xp 00000000 08:02 134984                     /usr/lib/libqscintilla2.so.9.0.1
7fffc2843000-7fffc2a42000 ---p 002ac000 08:02 134984                     /usr/lib/libqscintilla2.so.9.0.1
7fffc2a42000-7fffc2a4d000 r--p 002ab000 08:02 134984                     /usr/lib/libqscintilla2.so.9.0.1
7fffc2a4d000-7fffc2a51000 rw-p 002b6000 08:02 134984                     /usr/lib/libqscintilla2.so.9.0.1
7fffc2a51000-7fffc2a53000 rw-p 00000000 00:00 0 
7fffc2a53000-7fffc2b39000 r-xp 00000000 08:02 278632                     /usr/lib/python2.7/dist-packages/PyQt4/Qsci.so
7fffc2b39000-7fffc2d39000 ---p 000e6000 08:02 278632                     /usr/lib/python2.7/dist-packages/PyQt4/Qsci.so
7fffc2d39000-7fffc2d3e000 r--p 000e6000 08:02 278632                     /usr/lib/python2.7/dist-packages/PyQt4/Qsci.so
7fffc2d3e000-7fffc2d60000 rw-p 000eb000 08:02 278632                     /usr/lib/python2.7/dist-packages/PyQt4/Qsci.so
7fffc2d60000-7fffc2db2000 r-xp 00000000 08:07 966330                     /home/softdev/lib/python2.7/site-packages/GDAL-1.10.1-py2.7-linux-x86_64.egg/osgeo/_ogr.so
7fffc2db2000-7fffc2fb1000 ---p 00052000 08:07 966330                     /home/softdev/lib/python2.7/site-packages/GDAL-1.10.1-py2.7-linux-x86_64.egg/osgeo/_ogr.so
7fffc2fb1000-7fffc2fb2000 r--p 00051000 08:07 966330                     /home/softdev/lib/python2.7/site-packages/GDAL-1.10.1-py2.7-linux-x86_64.egg/osgeo/_ogr.so
7fffc2fb2000-7fffc2fb6000 rw-p 00052000 08:07 966330                     /home/softdev/lib/python2.7/site-packages/GDAL-1.10.1-py2.7-linux-x86_64.egg/osgeo/_ogr.so
7fffc2fb6000-7fffc2fe6000 r-xp 00000000 08:07 966352                     /home/softdev/lib/python2.7/site-packages/GDAL-1.10.1-py2.7-linux-x86_64.egg/osgeo/_osr.so
7fffc2fe6000-7fffc31e6000 ---p 00030000 08:07 966352                     /home/softdev/lib/python2.7/site-packages/GDAL-1.10.1-py2.7-linux-x86_64.egg/osgeo/_osr.so
7fffc31e6000-7fffc31e7000 r--p 00030000 08:07 966352                     /home/softdev/lib/python2.7/site-packages/GDAL-1.10.1-py2.7-linux-x86_64.egg/osgeo/_osr.so
7fffc31e7000-7fffc31e9000 rw-p 00031000 08:07 966352                     /home/softdev/lib/python2.7/site-packages/GDAL-1.10.1-py2.7-linux-x86_64.egg/osgeo/_osr.so
7fffc31e9000-7fffc31ea000 rw-p 00000000 00:00 0 
7fffc31ea000-7fffc31ef000 r-xp 00000000 08:07 966321                     /home/softdev/lib/python2.7/site-packages/GDAL-1.10.1-py2.7-linux-x86_64.egg/osgeo/_gdalconst.so
7fffc31ef000-7fffc33ee000 ---p 00005000 08:07 966321                     /home/softdev/lib/python2.7/site-packages/GDAL-1.10.1-py2.7-linux-x86_64.egg/osgeo/_gdalconst.so
7fffc33ee000-7fffc33ef000 r--p 00004000 08:07 966321                     /home/softdev/lib/python2.7/site-packages/GDAL-1.10.1-py2.7-linux-x86_64.egg/osgeo/_gdalconst.so
7fffc33ef000-7fffc33f0000 rw-p 00005000 08:07 966321                     /home/softdev/lib/python2.7/site-packages/GDAL-1.10.1-py2.7-linux-x86_64.egg/osgeo/_gdalconst.so
7fffc33f0000-7fffc343a000 r-xp 00000000 08:07 966344                     /home/softdev/lib/python2.7/site-packages/GDAL-1.10.1-py2.7-linux-x86_64.egg/osgeo/_gdal.so
7fffc343a000-7fffc3639000 ---p 0004a000 08:07 966344                     /home/softdev/lib/python2.7/site-packages/GDAL-1.10.1-py2.7-linux-x86_64.egg/osgeo/_gdal.so
7fffc3639000-7fffc363a000 r--p 00049000 08:07 966344                     /home/softdev/lib/python2.7/site-packages/GDAL-1.10.1-py2.7-linux-x86_64.egg/osgeo/_gdal.so
7fffc363a000-7fffc363f000 rw-p 0004a000 08:07 966344                     /home/softdev/lib/python2.7/site-packages/GDAL-1.10.1-py2.7-linux-x86_64.egg/osgeo/_gdal.so
7fffc363f000-7fffc36ab000 r-xp 00000000 08:02 272177                     /usr/lib/pyshared/python2.7/matplotlib/backends/_backend_agg.so
7fffc36ab000-7fffc38aa000 ---p 0006c000 08:02 272177                     /usr/lib/pyshared/python2.7/matplotlib/backends/_backend_agg.so
7fffc38aa000-7fffc38ad000 r--p 0006b000 08:02 272177                     /usr/lib/pyshared/python2.7/matplotlib/backends/_backend_agg.so
7fffc38ad000-7fffc38ae000 rw-p 0006e000 08:02 272177                     /usr/lib/pyshared/python2.7/matplotlib/backends/_backend_agg.so
7fffc38ae000-7fffc38e6000 r-xp 00000000 08:02 272174                     /usr/lib/pyshared/python2.7/matplotlib/_tri.so
7fffc38e6000-7fffc3ae6000 ---p 00038000 08:02 272174                     /usr/lib/pyshared/python2.7/matplotlib/_tri.so
7fffc3ae6000-7fffc3ae8000 r--p 00038000 08:02 272174                     /usr/lib/pyshared/python2.7/matplotlib/_tri.so
7fffc3ae8000-7fffc3ae9000 rw-p 0003a000 08:02 272174                     /usr/lib/pyshared/python2.7/matplotlib/_tri.so
7fffc3ae9000-7fffc3af7000 r-xp 00000000 08:02 272172                     /usr/lib/pyshared/python2.7/matplotlib/_delaunay.so
7fffc3af7000-7fffc3cf6000 ---p 0000e000 08:02 272172                     /usr/lib/pyshared/python2.7/matplotlib/_delaunay.so
7fffc3cf6000-7fffc3cf7000 r--p 0000d000 08:02 272172                     /usr/lib/pyshared/python2.7/matplotlib/_delaunay.so
7fffc3cf7000-7fffc3cf8000 rw-p 0000e000 08:02 272172                     /usr/lib/pyshared/python2.7/matplotlib/_delaunay.so
7fffc3cf8000-7fffc3cfd000 r-xp 00000000 08:02 272171                     /usr/lib/pyshared/python2.7/matplotlib/_cntr.so
7fffc3cfd000-7fffc3efd000 ---p 00005000 08:02 272171                     /usr/lib/pyshared/python2.7/matplotlib/_cntr.so
7fffc3efd000-7fffc3efe000 r--p 00005000 08:02 272171                     /usr/lib/pyshared/python2.7/matplotlib/_cntr.so
7fffc3efe000-7fffc3eff000 rw-p 00006000 08:02 272171                     /usr/lib/pyshared/python2.7/matplotlib/_cntr.so
7fffc3eff000-7fffc3f40000 r-xp 00000000 08:02 265905                     /usr/lib/python2.7/dist-packages/_imaging.so
7fffc3f40000-7fffc413f000 ---p 00041000 08:02 265905                     /usr/lib/python2.7/dist-packages/_imaging.so
7fffc413f000-7fffc4142000 r--p 00040000 08:02 265905                     /usr/lib/python2.7/dist-packages/_imaging.so
7fffc4142000-7fffc4145000 rw-p 00043000 08:02 265905                     /usr/lib/python2.7/dist-packages/_imaging.so
7fffc4145000-7fffc4446000 rw-p 00000000 00:00 0 
7fffc4446000-7fffc444e000 r-xp 00000000 08:02 297777                     /usr/lib/python2.7/lib-dynload/_ssl.x86_64-linux-gnu.so
7fffc444e000-7fffc464d000 ---p 00008000 08:02 297777                     /usr/lib/python2.7/lib-dynload/_ssl.x86_64-linux-gnu.so
7fffc464d000-7fffc464e000 r--p 00007000 08:02 297777                     /usr/lib/python2.7/lib-dynload/_ssl.x86_64-linux-gnu.so
7fffc464e000-7fffc464f000 rw-p 00008000 08:02 297777                     /usr/lib/python2.7/lib-dynload/_ssl.x86_64-linux-gnu.so
7fffc464f000-7fffc4692000 r-xp 00000000 08:02 272168                     /usr/lib/pyshared/python2.7/matplotlib/ft2font.so
7fffc4692000-7fffc4891000 ---p 00043000 08:02 272168                     /usr/lib/pyshared/python2.7/matplotlib/ft2font.so
7fffc4891000-7fffc4894000 r--p 00042000 08:02 272168                     /usr/lib/pyshared/python2.7/matplotlib/ft2font.so
7fffc4894000-7fffc4897000 rw-p 00045000 08:02 272168                     /usr/lib/pyshared/python2.7/matplotlib/ft2font.so
7fffc4897000-7fffc489d000 r-xp 00000000 08:02 297799                     /usr/lib/python2.7/lib-dynload/_csv.x86_64-linux-gnu.so
7fffc489d000-7fffc4a9c000 ---p 00006000 08:02 297799                     /usr/lib/python2.7/lib-dynload/_csv.x86_64-linux-gnu.so
7fffc4a9c000-7fffc4a9d000 r--p 00005000 08:02 297799                     /usr/lib/python2.7/lib-dynload/_csv.x86_64-linux-gnu.so
7fffc4a9d000-7fffc4a9f000 rw-p 00006000 08:02 297799                     /usr/lib/python2.7/lib-dynload/_csv.x86_64-linux-gnu.so
7fffc4a9f000-7fffc4ac5000 r-xp 00000000 08:02 272173                     /usr/lib/pyshared/python2.7/matplotlib/_png.so
7fffc4ac5000-7fffc4cc5000 ---p 00026000 08:02 272173                     /usr/lib/pyshared/python2.7/matplotlib/_png.so
7fffc4cc5000-7fffc4cc7000 r--p 00026000 08:02 272173                     /usr/lib/pyshared/python2.7/matplotlib/_png.so
7fffc4cc7000-7fffc4cc8000 rw-p 00028000 08:02 272173                     /usr/lib/pyshared/python2.7/matplotlib/_png.so
7fffc4cc8000-7fffc4d0c000 r-xp 00000000 08:02 272169                     /usr/lib/pyshared/python2.7/matplotlib/_image.so
7fffc4d0c000-7fffc4f0b000 ---p 00044000 08:02 272169                     /usr/lib/pyshared/python2.7/matplotlib/_image.so
7fffc4f0b000-7fffc4f0d000 r--p 00043000 08:02 272169                     /usr/lib/pyshared/python2.7/matplotlib/_image.so
7fffc4f0d000-7fffc4f0f000 rw-p 00045000 08:02 272169                     /usr/lib/pyshared/python2.7/matplotlib/_image.so
7fffc4f0f000-7fffc4f55000 r-xp 00000000 08:02 272167                     /usr/lib/pyshared/python2.7/matplotlib/_path.so
7fffc4f55000-7fffc5155000 ---p 00046000 08:02 272167                     /usr/lib/pyshared/python2.7/matplotlib/_path.so
7fffc5155000-7fffc5157000 r--p 00046000 08:02 272167                     /usr/lib/pyshared/python2.7/matplotlib/_path.so
7fffc5157000-7fffc5158000 rw-p 00048000 08:02 272167                     /usr/lib/pyshared/python2.7/matplotlib/_path.so
7fffc5158000-7fffc5675000 r-xp 00000000 08:02 135745                     /usr/lib/x86_64-linux-gnu/libQtDesigner.so.4.8.4
7fffc5675000-7fffc5874000 ---p 0051d000 08:02 135745                     /usr/lib/x86_64-linux-gnu/libQtDesigner.so.4.8.4
7fffc5874000-7fffc588c000 r--p 0051c000 08:02 135745                     /usr/lib/x86_64-linux-gnu/libQtDesigne
Program received signal SIGABRT, Aborted.
0x00007ffff02eb037 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56    ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff02eb037 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff02ee698 in __GI_abort () at abort.c:90
#2  0x00007ffff03285ab in __libc_message (do_abort=2, fmt=fmt@entry=0x7ffff043c440 "*** Error in `%s': %s: 0x%s ***\
") at ../sysdeps/unix/sysv/linux/libc_fatal.c:199
#3  0x00007ffff0333ecd in malloc_printerr (ptr=0x1593a90, str=0x7ffff04383e8 "corrupted double-linked list", action=<optimized out>) at malloc.c:4923
#4  malloc_consolidate (av=av@entry=0x7ffff0676740 <main_arena>) at malloc.c:4094
#5  0x00007ffff0334898 in _int_free (av=0x7ffff0676740 <main_arena>, p=0x12d0920, have_lock=0) at malloc.c:3994
#6  0x00007ffff4da88f3 in CPLCleanupTLSList (papTLSList=0x12a4be0) at cpl_multiproc.cpp:206
#7  0x00007ffff4d6a6a5 in GDALDriverManager::~GDALDriverManager (this=0x1592240, __in_chrg=<optimized out>) at gdaldrivermanager.cpp:248
#8  0x00007ffff4d6a739 in GDALDriverManager::~GDALDriverManager (this=0x1592240, __in_chrg=<optimized out>) at gdaldrivermanager.cpp:289
#9  0x00007ffff4a98e5a in GDALDestroy () at gdaldllmain.cpp:81
#10 0x00007ffff7de9f47 in _dl_fini () at dl-fini.c:253
#11 0x00007ffff02f0121 in __run_exit_handlers (status=0, listp=0x7ffff06766a8 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true) at exit.c:77
#12 0x00007ffff02f01a5 in __GI_exit (status=<optimized out>) at exit.c:99
#13 0x00007ffff02d5eac in __libc_start_main (main=0x558472 <main(int, char**)>, argc=1, ubp_av=0x7fffffffd408, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffd3f8) at libc-start.c:294
#14 0x0000000000557a09 in _start ()

qgis-valgrind.txt Magnifier (328 KB) Etienne Tourigny, 2013-10-24 09:39 AM

Associated revisions

Revision f2fbb2f8
Added by Matthias Kuhn over 10 years ago

Cleanup methods for providers (implemented for GDAL and OGR)
Fix #8932

History

#1 Updated by Giovanni Manghi over 10 years ago

On the same Linux distribution/version there are no issues using packages from the ubutugis repo (gdal 1.10). cheers!

#2 Updated by Matthias Kuhn over 10 years ago

  • Category deleted (Rasters)

Etienne, does this also happen to you when you build from scratch without CMAKE_BUILD_TYPE=Debug?
(Just out of curiosity, not that I would call this a fix)

#3 Updated by Etienne Tourigny over 10 years ago

Matthias Kuhn wrote:

Etienne, does this also happen to you when you build from scratch without CMAKE_BUILD_TYPE=Debug?
(Just out of curiosity, not that I would call this a fix)

This happens with and without Debug (i.e. both Release and Debug).

#4 Updated by Etienne Tourigny over 10 years ago

Giovanni Manghi wrote:

On the same Linux distribution/version there are no issues using packages from the ubutugis repo (gdal 1.10). cheers!

You are right. However, I have not changed anything in my build setup, and this problem appeared a few weeks before the 2.0 release. Will use the ubuntugis builds! Cheers

#5 Updated by Etienne Tourigny over 10 years ago

  • Priority changed from Normal to Low
  • Category set to Build/Install

#6 Updated by Even Rouault over 10 years ago

Etienne,

Can you try running qgis under valgrind, and look at the report ? Perhaps interesting things will show up.

This GDALDestroy() auto-finalization causes quite a few subtle issues with some drivers (I had problems with ECW, hopefully fixed now). Perhaps you could try editing the main() of QGIS and add explicit call GDALDestroyDriverManager() and OGRCleanupAll() from it just before returning from it. It could perhaps fix the issue.

#7 Updated by Etienne Tourigny over 10 years ago

  • Status changed from Open to Feedback

rouault - wrote:

Etienne,

Can you try running qgis under valgrind, and look at the report ? Perhaps interesting things will show up.

This GDALDestroy() auto-finalization causes quite a few subtle issues with some drivers (I had problems with ECW, hopefully fixed now). Perhaps you could try editing the main() of QGIS and add explicit call GDALDestroyDriverManager() and OGRCleanupAll() from it just before returning from it. It could perhaps fix the issue.

Even, thanks for the suggestions. I think the problem is in my gdal installation, because if I use the qgis packages from ubuntugis, but run with my gdal libraries in LD_LIBRARY_PATH, the problem appears again. I will try with minimal drivers and see if that helps.

I will have a look as soon as I have the time...

#8 Updated by Etienne Tourigny over 10 years ago

I ran qgis (built from release-2_0 branch and gdal 1.10 svn) with valgrind, and surprisingly it did not crash, although running without valgrind crashes every time.
Attached is the output from valgrind (no specific tools used).

Also, building QGIS using gdal-dev package from ubuntugis is fine, so the problem is definitely with my gdal build.

#9 Updated by Giovanni Manghi over 10 years ago

  • Status changed from Feedback to Closed
  • Resolution set to invalid

Etienne Tourigny wrote:

so the problem is definitely with my gdal build.

reopen if necessary.

#10 Updated by Etienne Tourigny over 10 years ago

I have cleaned up my gdal build, and the problem still remains, although more intermittently with a different error (in CSVDeaccessInternal() instead of CPLCleanupTLSList())

(gdb) run
Starting program: /home/softdev/bin/qgis 
warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ffa000
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Warning: loading of qt translation failed [/usr/share/qt4/translations/qt_en_US]
Warning: Could not parse stylesheet of widget 0x115ecc0
[New Thread 0x7fffc2558700 (LWP 28833)]
[New Thread 0x7fffc16db700 (LWP 28834)]
[Thread 0x7fffc2558700 (LWP 28833) exited]
[Thread 0x7fffc16db700 (LWP 28834) exited]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff0607cdb in malloc_consolidate (av=av@entry=0x7ffff094a740 <main_arena>) at malloc.c:4094
4094    malloc.c: No such file or directory.
(gdb) bt
#0  0x00007ffff0607cdb in malloc_consolidate (av=av@entry=0x7ffff094a740 <main_arena>) at malloc.c:4094
#1  0x00007ffff0608898 in _int_free (av=0x7ffff094a740 <main_arena>, p=0x282dbe0, have_lock=0) at malloc.c:3994
#2  0x00007ffff4d99963 in CSVDeaccessInternal (ppsCSVTableList=0x1159f90, bCanUseTLS=1, pszFilename=0x2701ca0 "p\\351\\246\\004") at cpl_csv.cpp:215
#3  0x00007ffff4d999df in CSVDeaccessInternal (ppsCSVTableList=0x1159f90, bCanUseTLS=1, pszFilename=0x0) at cpl_csv.cpp:174
#4  0x00007ffff4b537bb in GDALDeregister_GTiff () at geotiff.cpp:9724
#5  0x00007ffff4d6607a in GDALDriver::~GDALDriver (this=0x14653c0, __in_chrg=<optimized out>) at gdaldriver.cpp:64
#6  0x00007ffff4d660b9 in GDALDriver::~GDALDriver (this=0x14653c0, __in_chrg=<optimized out>) at gdaldriver.cpp:65
#7  0x00007ffff4d68592 in GDALDriverManager::~GDALDriverManager (this=0x1453080, __in_chrg=<optimized out>) at gdaldrivermanager.cpp:207
#8  0x00007ffff4d686b9 in GDALDriverManager::~GDALDriverManager (this=0x1453080, __in_chrg=<optimized out>) at gdaldrivermanager.cpp:288
#9  0x00007ffff4a96dba in GDALDestroy () at gdaldllmain.cpp:81
#10 0x00007ffff7de9f47 in _dl_fini () at dl-fini.c:253
#11 0x00007ffff05c4121 in __run_exit_handlers (status=0, listp=0x7ffff094a6a8 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true) at exit.c:77
#12 0x00007ffff05c41a5 in __GI_exit (status=<optimized out>) at exit.c:99
#13 0x00007ffff05a9eac in __libc_start_main (main=0x4ef090 <main>, argc=1, ubp_av=0x7fffffffd428, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffd418) at libc-start.c:294
#14 0x00000000004f5e21 in _start ()

After adding GDALDestroyDriverManager() and OGRCleanupAll() at the end of main.cpp, as suggested by Even, crash is sporadic and also different:

(gdb) run
Starting program: /home/softdev/bin/qgis 
warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ffa000
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Warning: loading of qt translation failed [/usr/share/qt4/translations/qt_en_US]
Warning: Could not parse stylesheet of widget 0x115edf0
[New Thread 0x7fffc2558700 (LWP 20046)]
[New Thread 0x7fffc16db700 (LWP 20047)]
[Thread 0x7fffc2558700 (LWP 20046) exited]
[Thread 0x7fffc16db700 (LWP 20047) exited]
*** Error in `/home/softdev/bin/qgis': corrupted double-linked list: 0x0000000000f00510 ***

bt

^C
Program received signal SIGINT, Interrupt.
__lll_lock_wait_private () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
95    ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: No such file or directory.
(gdb) bt
#0  __lll_lock_wait_private () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
#1  0x00007ffff060dfcc in _L_lock_11850 () at malloc.c:5151
#2  0x00007ffff060b575 in __GI___libc_malloc (bytes=56) at malloc.c:2856
#3  0x00007ffff7de7680 in _dl_map_object_deps (map=map@entry=0x7ffff7fcb4e0, preloads=preloads@entry=0x0, npreloads=npreloads@entry=0, trace_mode=trace_mode@entry=0, open_mode=open_mode@entry=-2147483648) at dl-deps.c:515
#4  0x00007ffff7deddaf in dl_open_worker (a=a@entry=0x7fffffffbb78) at dl-open.c:265
#5  0x00007ffff7de9706 in _dl_catch_error (objname=objname@entry=0x7fffffffbb68, errstring=errstring@entry=0x7fffffffbb70, mallocedp=mallocedp@entry=0x7fffffffbb60, operate=operate@entry=0x7ffff7dedc00 <dl_open_worker>, 
    args=args@entry=0x7fffffffbb78) at dl-error.c:177
#6  0x00007ffff7ded809 in _dl_open (file=0x7ffff070ad26 "libgcc_s.so.1", mode=-2147483647, caller_dlopen=<optimized out>, nsid=-2, argc=1, argv=0x7fffffffd428, env=0xf6c610) at dl-open.c:656
#7  0x00007ffff06bffb2 in do_dlopen (ptr=ptr@entry=0x7fffffffbd80) at dl-libc.c:87
#8  0x00007ffff7de9706 in _dl_catch_error (objname=0x7fffffffbd60, errstring=0x7fffffffbd70, mallocedp=0x7fffffffbd50, operate=0x7ffff06bff70 <do_dlopen>, args=0x7fffffffbd80) at dl-error.c:177
#9  0x00007ffff06c0072 in dlerror_run (args=0x7fffffffbd80, operate=0x7ffff06bff70 <do_dlopen>) at dl-libc.c:46
#10 __GI___libc_dlopen_mode (name=name@entry=0x7ffff070ad26 "libgcc_s.so.1", mode=mode@entry=-2147483647) at dl-libc.c:163
#11 0x00007ffff069a2a5 in init () at ../sysdeps/x86_64/backtrace.c:52
#12 0x00007fffedac8390 in pthread_once () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_once.S:103
#13 0x00007ffff069a3c4 in __GI___backtrace (array=array@entry=0x7fffffffc040, size=size@entry=64) at ../sysdeps/x86_64/backtrace.c:103
#14 0x00007ffff05fc5c5 in __libc_message (do_abort=2, fmt=fmt@entry=0x7ffff0710440 "*** Error in `%s': %s: 0x%s ***\
") at ../sysdeps/unix/sysv/linux/libc_fatal.c:178
#15 0x00007ffff0607ecd in malloc_printerr (ptr=0xf00510, str=0x7ffff070c3e8 "corrupted double-linked list", action=<optimized out>) at malloc.c:4923
#16 malloc_consolidate (av=av@entry=0x7ffff094a740 <main_arena>) at malloc.c:4094
#17 0x00007ffff0608898 in _int_free (av=0x7ffff094a740 <main_arena>, p=0x13cce60, have_lock=0) at malloc.c:3994
#18 0x00007ffff321b167 in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#19 0x00007ffff05c452a in __cxa_finalize (d=0x7ffff3585760) at cxa_finalize.c:55
#20 0x00007ffff310e1a3 in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#21 0x00007fffffffd300 in ?? ()
#22 0x00007ffff7de9f47 in _dl_fini () at dl-fini.c:253
Backtrace stopped: frame did not save the PC
(gdb) 

#11 Updated by Matthias Kuhn over 10 years ago

Should be fixed in f2fbb2f with help of the methods mentioned by EvanR/Etienne.

I could not reliably reproduce this error, but it seems to have gone. So if the problem persists, please reopen this issue.

#12 Updated by Matthias Kuhn over 10 years ago

  • Resolution changed from invalid to fixed/implemented

Also available in: Atom PDF