Skip to content

Access violation when accessing a specific table in Firebird database

Summary

Trying to access one of many tables in a Firebird DB results in Lazarus shutting down or AV

System Information

  • Lazarus/FPC Version: Lazarus 2.2.6 (rev lazarus_2_2_6) FPC 3.2.2 x86_64-win64-win32/win64
  • Operating System: Windows 11 Pro
  • CPU / Bitness: 64>

Steps to reproduce

I do have a Firebird 4.0 database (UTF-8) with 7 tables in it. I am trying to access it via the simplest GUI app I could make: An IBConnection, a transcation, a SQL query and datasource connected to a database grid and a [Connect] button.

Note that I can access all 7 tables without any issues whatsoever from any other tool: FlameRobin, IBExport, SQLMaestro etc.

From my mini-app I can open 6 of these tables both in design mode and @ runtime just fine.

However, if I do attempt this with table 7, one of 2 things will happen:

At design time, Lazarus will simply shut down on its own without any messages after a few seconds. At run time, I get an AV (reading from address $FFFFFFFFFFFFFFFF) after pressing the [Connect] button that simply sets the query component to active.

The issue can be reproduced reliably on my PC.

The only discernable difference between the other tables and table 7 is that tables is much wider than any other: 69 columns, containing integer, boolean, date, char, varchar & text blob fields. The table data cannot be made available for testing as it contains medical patient data

Example Project

What is the current bug behavior?

When I try to open the table in question at design time, Lazarus will simply shut down on its own without any messages after a few seconds. At run time, I get an AV (reading from address $FFFFFFFFFFFFFFFF) after pressing the [Connect] button that simply sets the query component to active.

What is the expected (correct) behavior?

That I would be able to open the patient table without any problems and view the records in the database grid.

Relevant logs and/or screenshots

Metadata for the problematic table

RECREATE TABLE T_PATIENT

(

p_no INTEGER GENERATED By Default AS IDENTITY PRIMARY KEY,

off_no INTEGER NOT NULL, -- References T_OFFICE(off_no)

fname Varchar(40),

lname Varchar(40),

noon BOOLEAN,

tobebilled BOOLEAN,

c2p BOOLEAN,

nof BOOLEAN,

wc BOOLEAN,

addr1 Varchar(40),

addr2 Varchar(40),

city Varchar(40),

state State, -- domain Char(2)

zip ZIP, -- domain Char(5)

phone1 VARCHAR(15),

phone2 VARCHAR(15),

employer Varchar(40),

insurer Varchar(40),

inscode VARCHAR(8),

patientss VARCHAR(12),

patientdob DATE,

memwho VARCHAR(12),

memid VARCHAR(20),

memname Varchar(40),

memss VARCHAR(12),

memdob DATE,

planno Varchar(40),

phoneins VARCHAR(15),

payerid Varchar(40),

claimsaddr1 Varchar(40),

claimsaddr2 Varchar(40),

claimscity Varchar(40),

claimsstate State,

claimszip ZIP,

ins1800 VARCHAR(15),

dateact DATE,

dateterm DATE,

oonben BOOLEAN,

deductperc VARCHAR(4),

pocketperc VARCHAR(4),

maxperyear VARCHAR(10),

IsTrigger BOOLEAN,

tppervisit VARCHAR(4),

restr1 BOOLEAN,

nervecode VARCHAR(6),

nerve BOOLEAN,

restr2 BOOLEAN,

tpnb BOOLEAN,

preauth BOOLEAN,

datever DATE,

paymentp BOOLEAN,

doctor Varchar(40),

up VARCHAR(8),

low VARCHAR(8),

frontnote BLOB SUB_TYPE TEXT,

vnote VARCHAR(80),

note1 BLOB SUB_TYPE TEXT,

showfnote BOOLEAN,

verno VARCHAR(16),

paydest VARCHAR(12),

auto BOOLEAN,

reason varchar(40),

eob BOOLEAN,

mednote BOOLEAN,

inactive BOOLEAN,

innet BOOLEAN,

dateinput DATE,

mailpaper Boolean,

tfilling VarChar(40)

);

Possible fixes

N/A

Edited by Kai Peters
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information