Deadlock reading GeoTiffs
-------------------------

                 Key: GEOT-3739
                 URL: https://jira.codehaus.org/browse/GEOT-3739
             Project: GeoTools
          Issue Type: Bug
          Components: geotiff
    Affects Versions: 2.7.2
         Environment: Ubuntu 11.04
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)

            Reporter: Sheldon Young
         Attachments: DeadlockExample.java

A deadlock occurs when several threads each create a GeoTiff reader.  Simply 
run the attached example and notice it never completes.  

The first stack trace below is where most of the threads are blocked.

{noformat}
Thread [pool-1-thread-1] (Suspended)    
        LongitudeFirstEpsgDecorator(DeferredAuthorityFactory).getBackingStore() 
line: 131       
        LongitudeFirstEpsgDecorator(BufferedAuthorityFactory).isAvailable() 
line: 234   
        LongitudeFirstEpsgDecorator(DeferredAuthorityFactory).isAvailable() 
line: 118   
        FactoryCreator(FactoryRegistry).isAvailable(Object) line: 666   
        FactoryCreator(FactoryRegistry).isAcceptable(T, Class<T>, Hints, 
Filter) line: 500      
        FactoryRegistry$1.filter(Object) line: 191      
        FilterIterator<T>.advance() line: 793   
        FilterIterator<T>.next() line: 811      
        LazySet<E>.addNext() line: 71   
        LazySet<E>.get(int) line: 121   
        LazySet$Iter.next() line: 140   
        LinkedHashSet<E>(AbstractCollection<E>).addAll(Collection<? extends E>) 
line: 305       
        AllAuthoritiesFactory.getFactories() line: 102  
        
AllAuthoritiesFactory(ManyAuthoritiesFactory).getAuthorityFactory(Class<T>, 
String) line: 421   
        
AllAuthoritiesFactory(ManyAuthoritiesFactory).getCSAuthorityFactory(String) 
line: 533   
        AllAuthoritiesFactory(AuthorityFactoryAdapter).createUnit(String) line: 
779     
        GeoTiffMetadata2CRSAdapter.createUnit(int, int, Unit, Unit, 
GeoTiffIIOMetadataDecoder) line: 1739       
        
GeoTiffMetadata2CRSAdapter.createProjectedCoordinateSystem(GeoTiffIIOMetadataDecoder)
 line: 284 
        
GeoTiffMetadata2CRSAdapter.createCoordinateSystem(GeoTiffIIOMetadataDecoder) 
line: 235  
        GeoTiffReader.getHRInfo(Hints) line: 301        
        GeoTiffReader.<init>(Object, Hints) line: 219   
        GeoTiffFormat.getReader(Object, Hints) line: 271        
        GeoTiffFormat.getReader(Object) line: 237       
        DeadlockExample.call() line: 39 
        FutureTask$Sync.innerRun() line: 303    
        FutureTask<V>.run() line: 138   
        ThreadPoolExecutor$Worker.runTask(Runnable) line: 886   
        ThreadPoolExecutor$Worker.run() line: 908       
        Thread.run() line: 662  
{noformat}

This second stack trace is where one thread is blocked.

{noformat}
Thread [pool-1-thread-2] (Suspended)    
        ReferencingFactoryFinder.getAuthorityFactory(Class<T>, String, Hints, 
Key) line: 216    
        ReferencingFactoryFinder.getCRSAuthorityFactory(String, Hints) line: 
437        
        LongitudeFirstEpsgDecorator.createBackingStore() line: 177      
        LongitudeFirstEpsgDecorator(DeferredAuthorityFactory).getBackingStore() 
line: 132       
        LongitudeFirstEpsgDecorator(BufferedAuthorityFactory).isAvailable() 
line: 234   
        LongitudeFirstEpsgDecorator(DeferredAuthorityFactory).isAvailable() 
line: 118   
        FactoryCreator(FactoryRegistry).isAvailable(Object) line: 666   
        FactoryCreator(FactoryRegistry).isAcceptable(T, Class<T>, Hints, 
Filter) line: 500      
        FactoryRegistry$1.filter(Object) line: 191      
        FilterIterator<T>.advance() line: 793   
        FilterIterator<T>.next() line: 811      
        LazySet<E>.addNext() line: 71   
        LazySet<E>.get(int) line: 121   
        LazySet$Iter.next() line: 140   
        LinkedHashSet<E>(AbstractCollection<E>).addAll(Collection<? extends E>) 
line: 305       
        AllAuthoritiesFactory.getFactories() line: 100  
        
AllAuthoritiesFactory(ManyAuthoritiesFactory).getAuthorityFactory(Class<T>, 
String) line: 421   
        
AllAuthoritiesFactory(ManyAuthoritiesFactory).getCSAuthorityFactory(String) 
line: 533   
        AllAuthoritiesFactory(AuthorityFactoryAdapter).createUnit(String) line: 
779     
        GeoTiffMetadata2CRSAdapter.createUnit(int, int, Unit, Unit, 
GeoTiffIIOMetadataDecoder) line: 1739       
        
GeoTiffMetadata2CRSAdapter.createProjectedCoordinateSystem(GeoTiffIIOMetadataDecoder)
 line: 284 
        
GeoTiffMetadata2CRSAdapter.createCoordinateSystem(GeoTiffIIOMetadataDecoder) 
line: 235  
        GeoTiffReader.getHRInfo(Hints) line: 301        
        GeoTiffReader.<init>(Object, Hints) line: 219   
        GeoTiffFormat.getReader(Object, Hints) line: 271        
        GeoTiffFormat.getReader(Object) line: 237       
        DeadlockExample.call() line: 39 
        FutureTask$Sync.innerRun() line: 303    
        FutureTask<V>.run() line: 138   
        ThreadPoolExecutor$Worker.runTask(Runnable) line: 886   
        ThreadPoolExecutor$Worker.run() line: 908       
        Thread.run() line: 662  
{noformat}


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Storage Efficiency Calculator
This modeling tool is based on patent-pending intellectual property that
has been used successfully in hundreds of IBM storage optimization engage-
ments, worldwide.  Store less, Store more with what you own, Move data to 
the right place. Try It Now! http://www.accelacomm.com/jaw/sfnl/114/51427378/
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to