[postgis-tickets] [PostGIS] #2260: Benchmarking speed between built-in tiger normalizer and pagc_address_parser
PostGIS
trac at osgeo.org
Wed Apr 17 06:33:35 PDT 2013
#2260: Benchmarking speed between built-in tiger normalizer and
pagc_address_parser
---------------------------------+------------------------------------------
Reporter: robe | Owner: robe
Type: task | Status: new
Priority: medium | Milestone: PostGIS 2.1.0
Component: pagc_address_parser | Version: trunk
Keywords: |
---------------------------------+------------------------------------------
Comment(by woodbri):
I'm at a loss on this one.
This works fine on Linux.
This crashes on Windows. I seems that the crash is not related to the code
below, but rather something that has happened prior to this point and the
server is just now recognizing the issue. I say this because it does not
always crash at the same point just near this location. So sometimes a few
statements before this. This is the only process using the database other
than autovacuum.
When I allocate memory for std, I copy the pointer to _gp_std_ just so I
could check if it is getting changed and it does not look like it is. So
the big picture is:
{{{
std = calloc()
do stuff
free(std) -- crash!
}}}
Here is the problem code:
{{{
void std_free(STANDARDIZER *std)
{
STANDARDIZER *tmp = std;
DBG("In std_free -----------------");
if (std != _gp_std_) {
DBG("!!! std != _gp_std_ !!!");
}
if ( std == NULL ) return;
DBG("Calling close_stand_process");
if ( std -> pagc_p != NULL ) close_stand_process( std -> pagc_p ) ;
if ( std -> pagc_p -> process_errors != NULL ) {
DBG("Calling close_errors");
close_errors( std -> pagc_p -> process_errors );
DBG("Calling FREE_AND_NULL");
FREE_AND_NULL( std -> pagc_p ) ;
}
DBG("Calling close_stand_context");
close_stand_context( std -> misc_stand );
DBG("Calling free");
if (tmp != std) {
DBG("std trashed");
}
if (std == NULL) {
DBG("std is null");
}
free( std );
std = NULL ;
}
}}}
And here is my output
{{{
$ psql -U postgres -h localhost -f ../a test1
psql:../a:1: NOTICE: In std_free -----------------
psql:../a:1: NOTICE: Calling close_stand_process
psql:../a:1: NOTICE: remove_default_defs(__pagc_global__)
psql:../a:1: NOTICE: destroy_rules(__pagc_global__->rules) ;
psql:../a:1: NOTICE: destroy_rules 1
psql:../a:1: NOTICE: destroy_rules 2
psql:../a:1: NOTICE: destroy_rules 3
psql:../a:1: NOTICE: destroy_rules 4
psql:../a:1: NOTICE: destroy_rules 5
psql:../a:1: NOTICE: destroy_lexicon(__pagc_global__->addr_lexicon)
psql:../a:1: NOTICE: destroy_lexicon: i=7561
psql:../a:1: NOTICE: leaving destroy_lexicon
psql:../a:1: NOTICE: destroy_lexicon(__pagc_global__->poi_lexicon)
psql:../a:1: NOTICE: destroy_lexicon(__pagc_global__->gaz_lexicon)
psql:../a:1: NOTICE: destroy_lexicon: i=7561
psql:../a:1: NOTICE: leaving destroy_lexicon
psql:../a:1: NOTICE: Calling close_errors
psql:../a:1: NOTICE: Calling FREE_AND_NULL
psql:../a:1: NOTICE: Calling close_stand_context
psql:../a:1: NOTICE: Calling free
psql:../a:1: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
psql:../a:1: connection to server was lost
}}}
I also tried your idea of changing palloc calls to SPI_palloc because the
later reverse to palloc if it is outside an SPI context which seems safe,
but as you found out it did not help.
I have also run this under valgrind on linux a while back and it reported
no issues. Since I have made some changes since then maybe I should run
that again.
I'm at a loss here. Does anyone have any good debugging tools under window
that they could check into this with?
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2260#comment:6>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-tickets
mailing list