Ticket #108 (closed defect: duplicate)
Segmentation fault in pj_insert_initcache
| Reported by: | apalade | Owned by: | warmerdam |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | Core | Version: | 4.7.0 |
| Keywords: | segmentation fault cache init | Cc: |
Description
Segmentation fault happens when trying to create more than a certain number of projection definitions (on my platform this was 14 definitions).
I found the bug using the Perl interface, Geo::Proj4. Some platform details:
- 2.6.36-gentoo x86_64
- perl 5.12.2
- Geo::Proj4 0.99
Repro code here:
use strict;
use warnings;
use Geo::Proj4;
my @projections = qw( esri:37001 esri:37002 esri:37003 esri:37004 esri:37005 esri:37006 esri:37007 esri:37008 esri:37201 esri:37202 esri:37203 esri:37204 esri:37205 esri:37206 esri:37207 epsg:2045 epsg:2000 epsg:2094 epsg:2095 );
foreach ( @projections ) {
Geo::Proj4->new( "+init=" . $_ );
}
The problem was caused by a faulty memcpy in pj_initcache.c which was happening when trying to enlarge the cache to hold more projections definitions. I've attached a patch that fixes the bug.
Cheers, Alexandru Palade
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

