Skip site navigation (1) Skip section navigation (2)

Re: Invalid Page Fault in PSQLODBC.DLL

From: "Johann Zuschlag" <zuschlag2(at)online(dot)de>
To: "David Zoll" <dzoll(at)nyscul(dot)org>, "Julia A (dot) Case" <julie(at)MageNet(dot)com>, "pgsql-odbc(at)postgresql(dot)org" <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: Invalid Page Fault in PSQLODBC.DLL
Date: 2001-02-06 22:34:31
Message-ID: E14QGil-0007ph-00@mrelay00.kundenserver.de (view raw or flat)
Thread:
Lists: pgsql-odbc
Hi,

I got exactly the same fault. When I traced it I found that the program
tried to access the memory 0x00000001( well here it's 0x00000090).

It happens during following INSERT of my small ERP-application:
(any other table and insert will do the same)

INSERT INTO KUNDE  ( Kundenid, Kundennumm, Name, 
Lname, Rname, Sperrkennz, Mwstkennun, Sprachnumm, 
Auslandsar, Versandkos, EDatum, Keyaccount, Sammelrech, 
Matchcode ) VALUES 
( ?, ?, ?, ?, ?, ?, ?, 00, ?, 0, {ts '2000-12-28 00:00:00.296'}, ?, ?, ? )\ 0"

Same application works flawless with MS-SQL-ODBC and ORACLE-ODBC.

I did some tracing with different versions of psqlodbc (except the last one):

It crashes in module convert.c / copy_statement_with_parameters 
in function: 

convert_special_chars(char *si, char *dst, int used)

The access violation appears at:

if (si[i] == '\r' && i+1 < strlen(si) && si[i+1] == '\n')

si = 0x00000001
used = -103

It seems that it runs into an access violation, since 'si' has 
been assigned a wrong value. Also 'used = -103' doesn't
seem to be healthy value. 'dst' seems to be alright.

convert_special_chars was called in
copy_statement_with_parameters:

convert_special_chars(buf, &new_statement[npos], used);

'buf' seems to be the same like 'buffer':

So 'used' and 'buffer' where assigned at (in copy_statement_with_parameters):

	/*	Assign correct buffers based on data at exec param or not */
	if ( stmt->parameters[param_number].data_at_exec) {
		used = stmt->parameters[param_number].EXEC_used ? *stmt->parameters[param_number].EXEC_used : SQL_NTS;
		buffer = stmt->parameters[param_number].EXEC_buffer;
	}
	else {
		used = stmt->parameters[param_number].used ? *stmt->parameters[param_number].used : SQL_NTS;
		buffer = stmt->parameters[param_number].buffer;
	}

Well I don't know anything about ODBC. Who can help?

***********************

On Mon, 05 Feb 2001 12:06:35 -0500, David Zoll wrote:

>
>Whenever I try to access a Postgresql database from Visual Basic 6.0
>with a Data Control or a Remote Data Control, the program crashes with
>an invalid page fault error such as the one below.
>
>  USER caused an invalid page fault in
>  module PSQLODBC.DLL at 0247:10012923.
>  Registers:
>  EAX=00000090 CS=0247 EIP=10012923 EFLGS=00010297
>  EBX=00000088 SS=024f ESP=0063f5e4 EBP=00000000
>  ECX=00000028 DS=024f ESI=02cd7b8c FS=689f
>  EDX=00010022 ES=024f EDI=00000022 GS=0000
>  Bytes at CS:EIP:
>  8b 68 10 85 ed 7e 55 c6 44 24 20 01 55 57 68 90 
>  Stack dump:
>  01eb092c 01eb028c 0063f62c 00000000 00000000 00000000 00000000
>1f7e0fe2 02cd7b00 00010022 00000007 00000000 00000000 0063f676 0063f7bc
>00000000 
>
>The server is Postgresql 7.0.2 running on Debian Woody.  The same
>problem appears with the psqlodbc.dll versions 6.50.0000 from
>ftp.postgresql.org and version 7.01.00.01 from Great Bridge.
>
>Accessing a non-psqlodbc DSN with the same data in the same table with
>the exact same controls and settings works fine.
>
>Below is the log file generated by the Great Bridge version of the
>driver, using the Remote Data Control.  I can post the other logs as
>well if they would be useful, but they are quite similar, and they all
>end after the last column is listed in the SQLColumns section.
>
>Is there a bug in the driver, or am I doing something wrong?  I would be
>more than happy to do any further tests neeeded (I have both cygwin and
>a full Visual Studio 6.0 installation on this machine).
>
>Thank you very much in advance.
>
>Sincerely,
>-David Zoll, Programmer
>NYS Credit Union League
>
>-----
>
>conn=103415928, SQLDriverConnect( in)='DSN=Testdb;PWD=;',
>fDriverCompletion=3
>DSN info:
>DSN='Testdb',server='sqltest1',port='5432',dbase='testdb',user='dzoll',passwd=''
>         
>onlyread='0',protocol='6.4',showoid='0',fakeoidindex='0',showsystable='0'
>          conn_settings=''
>          translation_dll='',translation_option=''
>Global Options: Version='07.01.0001', fetch=100, socket=4096,
>unknown_sizes=0, max_varchar_size=254, max_longvarchar_size=4094
>                disable_optimizer=0, ksqo=1, unique_index=1,
>use_declarefetch=0
>                text_as_longvarchar=0, unknowns_as_longvarchar=0,
>bools_as_char=0
>                extra_systable_prefixes='dd_;', conn_settings=''
>conn=103415928, query=' '
>conn=103415928, query='set DateStyle to 'ISO''
>conn=103415928, query='set ksqo to 'ON''
>conn=103415928, query='select oid from pg_type where typname='lo''
>    [ fetched 0 rows ]
>conn=103415928, query='select version()'
>    [ fetched 1 rows ]
>    [ PostgreSQL version string = 'PostgreSQL 7.0.3 on
>i586-pc-linux-gnu, compiled by gcc 2.95.2' ]
>    [ PostgreSQL version number = '7.0' ]
>conn=103415928,
>SQLDriverConnect(out)='DSN=Testdb;DATABASE=testdb;SERVER=sqltest1;PORT=5432;UID=dzoll;PWD=;READONLY=0;PROTOCOL=
6.4;FAKEOIDINDEX=0;SHOWOIDCOLUMN=0;ROWVERSIONING=0;SHOWSYSTEMTABLES=0;CONNSETTINGS='
>conn=103415928, query='select * from tbl_cu_base'
>    [ fetched 672 rows ]
>conn=103415928, query='select u.usename, c.relname, a.attname,
>a.atttypid, t.typname, a.attnum, a.attlen, a.atttypmod, a.attnotnull,
>c.relhasrules from pg_user u, pg_class c, pg_attribute a, pg_type t
>where u.usesysid = c.relowner and c.oid= a.attrelid and a.atttypid =
>t.oid and (a.attnum > 0) and c.relname like 'tbl_cu_base' order by
>attnum'
>    [ fetched 40 rows ]
>SQLColumns:
>table='tbl_cu_base',field_name='charter_no',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='rt_number',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='cuna_id',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='census_track_nbr',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='fomfcc_code',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='axis_id',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='cu_name',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='cu_contact',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='contact_title',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='tel_areacode',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='tel_prefix',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='tel_suffix',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='tel_ext',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='altel_areacode',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='altel_prefix',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='altel_suffix',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='altel_ext',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='fax_areacode',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='fax_prefix',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='fax_suffix',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='fax_broadcast',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='phys_addr1',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='phys_addr2',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='phys_city',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='phys_state',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='phys_zip',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='phys_zip4',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='mail_addr1',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='mail_addr2',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='mail_city',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='mail_state',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='mail_zip',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='mail_zip4',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='county',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='district_code',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='region_code',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='seg',type=1042,sqltype=103025040,name='bpchar'
>SQLColumns:
>table='tbl_cu_base',field_name='cong_district',type=1700,sqltype=103025040,name='numeric'
>SQLColumns:
>table='tbl_cu_base',field_name='senate_district',type=1700,sqltype=103025040,name='numeric'
>SQLColumns:
>table='tbl_cu_base',field_name='assembly_district',type=1700,sqltype=103025040,name='numeric'


In response to

pgsql-odbc by date

Next:From: Kovacs ZoltanDate: 2001-02-07 10:19:21
Subject: Re: Visio, new DLL
Previous:From: Dave PageDate: 2001-02-06 09:45:27
Subject: Updated ODBC Driver Download

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group