Opened 11 years ago

Closed 11 years ago

#2261 closed defect (fixed)

pagc Crashers

Reported by: robe Owned by: robe
Priority: critical Milestone: PostGIS 2.1.0
Component: pagc_address_parser Version: master
Keywords: pagc_normalize_address Cc: swoodbri

Description

Found some addresses that crash the pagc normalizer (well at least on windows anyway both my 32-bit and 64-bit).

SELECT pagc_normalize_address('25 Wizard of Oz, Walaford, KS 99912323') 

output is this before it kicks the bucket:

NOTICE:  Start standardize_address
CONTEXT:  SQL statement "SELECT (SELECT standardize_address( 'select seq, word::text, stdword::text, token from tiger.pagc_gaz union all select seq, word::text, stdword::text, token from tiger.pagc_lex '
       , 'select seq, word::text, stdword::text, token from tiger.pagc_gaz order by id'
       , 'select * from tiger.pagc_rules order by id'
, 'select 0::int4 as id, ' || quote_literal(address1) || '::text As micro, 
   ' || quote_literal(city || ', ' || state || ' ' || zip) || '::text As macro') As pagc_addr
 FROM  (SELECT * FROM parse_address(rawInput) ) As a )"
PL/pgSQL function pagc_normalize_address(character varying) line 13 at assignment
NOTICE:  start load_lex

I notice the first step parse_address returns no zip, so think this is something I need to fix in the pagc_normalize_address function to have it never send NULL to the function and coalesce things that return empty

SELECT * FROM parse_address('25 Wizard of Oz, Walaford, KS 99912323')

25;Wizard of Oz, Walaford;;25 Wizard of Oz, Walaford;KS 99912323;;;;US

We should probably put a null exception into pagc if you don't have it already.

Change History (3)

comment:1 by robe, 11 years ago

Okay patch at r11247 took care of this crasher and I suspect some others. I'll leave open until I've verified with a couple more tests.

comment:2 by robe, 11 years ago

seems to work , though we probably should add some null protection to pagc so if null is passed into parse_address or standardize_address it shouldn't crash the service.

I think just adding perhaps a STRICT on those functions will be sufficient.

comment:3 by robe, 11 years ago

Resolution: fixed
Status: newclosed

going to close this for now.

Note: See TracTickets for help on using tickets.