[Gdal-dev] ECW Still hanging - is running on SMP a problem?

James Browne James.Browne at liu.edu
Sat Sep 10 01:21:26 EDT 2005


Hi all,

   I am still trying to understand why the ECW SDK 3.2 hangs 100% on my SMP linux box. I am testing it with gdalinfo (ver 1.3.0.0) in an attempt to minimize the code used. I am testing versions that are patched with your corrections, unpatched, and a version with some additional changes I wish I could test and submit if I can get past this. The behavior is the same for all. 

   I have traced my problem to the CNCSJP2FileView::CNCSJP2FileView constructor. One thread starts when the library is loaded and then seems to run this constructor twice, but without triggering sm_Views.Spawn(). Perhaps the second one is the inherited version in CNCSJP2FileView::CNCSJP2FileViewVector. When gdalinfo makes its request to open the file, it runs a third time and triggers sm_Views.Spawn(). The second thread seems to get to __pthread_manager() then __pthread_handle_create() but at that point the first thread dies with a SISSEGV segmentation fault. The program is then hung with a suspended thread waiting for a signal from a thread that died.     

  Maybe someone more familiar with the logic of the code can spot the problem faster than I can, although I am still looking. If it is a configuration problem, I can't see what it could be. Everything seems to compile and link fine and gdalinfo works on other file types.

  Thanks for all the effort.
                                  Jim


-----Original Message-----
From: Bill Binko [mailto:bill at binko.net]
Sent: Thu 9/1/2005 3:23 PM
To: James Browne; Tom Lynch
Cc: GDAL Developer List
Subject: RE: [Gdal-dev] ECW Still hanging -  is running on SMP a problem?
 

I have also unfortunately found a different hanging situation as I tried 
to build low-res overviews for my ECW set.  Worse, it is hanging at 100% 
CPU!

I will try to see if I can get to the bottom of it, but right now I'm very 
interested in getting this conversion done, so I need to babysit it.

Tom, does this mesh with any bugs that are fixed in your new version 
(which we're anxious for)?

Bill

On Wed, 31 Aug 2005, James Browne wrote:

> Bill,
>      Yes,I tried versions with it and without it. (and thanks for that work) It doesn't seem to even get that far in the code. In a day or two I will have the time to double check to see if I just did something dumb, or otherwise, to step through the code more closely. 
>                         Jim
> 
> 
> -----Original Message-----
> From: Bill Binko [mailto:bill at binko.net]
> Sent: Tue 8/30/2005 8:42 PM
> To: James Browne
> Cc: gdal-dev at lists.maptools.org
> Subject: Re: [Gdal-dev] ECW Still hanging -  is running on SMP a problem?
>  
> Have you applied my patch?
> 
> I know I said that compiling with -g should solve it, but you might try 
> the patch as well.
> 
> Bill
> 
> On Tue, 30 Aug 2005, James Browne wrote:
> 
> > Hi all,
> > 
> > After a few tweaks and tries, the latest ECW SDK 3.2 beta is building nicely and GDAL 1.3 builds against it.
> > 
> > However, now it hangs every time, even compiled as debug. It seems to hang at the first spawn.
> > 
> > I am running a dual Pentium 2.6G box with Debian Sarge as the OS. Is anyone else trying to run this on a Linux based SMP, and is that making threading break?
> > 
> > I will not have time to study this more for a few days. Any ideas will be appreciated greatly.
> > 
> >     Thanks
> >                     Jim
> > 
> > 
> > I tested using both gdal_translate and gdalinfo and the debugging output was the same:
> > 
> > GNU gdb 6.3-debian
> > Copyright 2004 Free Software Foundation, Inc.
> > GDB is free software, covered by the GNU General Public License, and you are
> > welcome to change it and/or distribute copies of it under certain conditions.
> > Type "show copying" to see the conditions.
> > There is absolutely no warranty for GDB.  Type "show warranty" for details.
> > This GDB was configured as "i386-linux"...Using host libthread_db library "/lib/libthread_db.so.1".
> > 
> > (gdb) run --debug ON April1994_raw.ecw
> > Starting program: /usr/local/bin/gdalinfo --debug ON /home/samba/basemap/images/4_94coast/2foot_as_1ft_ecw/April1994_raw.ecw
> > [Thread debugging using libthread_db enabled]
> > [New Thread 16384 (LWP 12685)]
> > [New Thread 32769 (LWP 12686)]
> > 
> > Program received signal SIGSEGV, Segmentation fault.
> > [Switching to Thread 32769 (LWP 12686)]
> > 0x4058a150 in pthread_handle_create () from /lib/libpthread.so.0
> > (gdb) bt
> > #0  0x4058a150 in pthread_handle_create () from /lib/libpthread.so.0
> > #1  0x40589c18 in __pthread_manager () from /lib/libpthread.so.0
> > #2  0x40589d57 in __pthread_manager_event () from /lib/libpthread.so.0
> > #3  0x40bf992a in clone () from /lib/libc.so.6
> > (gdb) s
> > Single stepping until exit from function pthread_handle_create,
> > which has no line number information.
> > 
> > <CTR-C>
> > 
> > Program received signal SIGINT, Interrupt.
> > [Switching to Thread 16384 (LWP 12685)]
> > 0x4058c604 in __pthread_sigsuspend () from /lib/libpthread.so.0
> > (gdb) bt
> > #0  0x4058c604 in __pthread_sigsuspend () from /lib/libpthread.so.0
> > #1  0x4058c3c8 in __pthread_wait_for_restart_signal () from /lib/libpthread.so.0
> > #2  0x4058bc42 in pthread_create@@GLIBC_2.1 () from /lib/libpthread.so.0
> > #3  0x40c7b2c0 in NCSThreadSpawn (pThread=0x407c4c84, pFunc=0x40c74b74 <CNCSThread::ThreadFunc(void*)>, pData=0x407c4c80,
> >     bCreateSuspended=0) at ../../thread.c:390
> > #4  0x40c74d6f in CNCSThread::Spawn (this=0x407c4c80, pData=0x0, bCreateSuspended=false) at ../../NCSThread.cpp:52
> > #5  0x406d0d79 in CNCSJP2FileView (this=0x80534d8) at ../../../NCSJP2/NCSJP2FileView.cpp:52
> > #6  0x4068ccc3 in CNCSFile (this=0x80534d8) at ../../NCSFile.cpp:57
> > #7  0x400f6d86 in ECWDataset::Open () from /usr/local/lib/libgdal.so.1
> > #8  0x400f6c0c in ECWDataset::OpenECW () from /usr/local/lib/libgdal.so.1
> > #9  0x401b432f in GDALOpen () from /usr/local/lib/libgdal.so.1
> > #10 0x08049951 in main ()
> > 
> > 
> > $ gdal-config --formats
> > gxf gtiff hfa aigrid aaigrid ceos ceos2 iso8211 xpm sdts raw dted mem jdem envisat elas fit vrt usgsdem l1b nitf bmp pcidsk airsar rs2 ilwis rmf rik bsb ecw jpeg2000 hdf4 gif jpeg png
> > $ gdal-config --version
> > 1.3.0
> > 
> > 
> >   
> > 
> > _______________________________________________
> > Gdal-dev mailing list
> > Gdal-dev at lists.maptools.org
> > http://lists.maptools.org/mailman/listinfo/gdal-dev
> > 
> > 
> 
>   
> 
> 

 




More information about the Gdal-dev mailing list