Gnucash segmentation fault - Postgresql

John Ralls jralls at ceridwen.us
Thu May 10 07:35:43 EDT 2012


On May 10, 2012, at 5:20 AM, h0l0fernes wrote:

> 
> Dear John Ralls, 
> Thank you for assistance!, I managed to solve my problem, with your help and guidance, and by the way learnt a lot how the internal gnucash structure looks like/works, and how to analyze/debug problems related to such software. Thousands thanks!
> Solution is as always simple ;-), improper datestyle variable for my database.
> 
>> The only documentation is the SQL wiki page [1] and the attendant ERD.
> This ERD chart with short description is exactly what I was looking for!
> 
>> Those dates look seriously malformed, and the field that's causing the error is start_date in schedxactions. Try a 
>> SELECT guid, start_date FROM schedxactions;
>> and look through them to see if any (or all) of the date fields look bad. 
> 
> The results from above select is OK:
> 
> gnucash=# SELECT guid, start_date FROM public.schedxactions;
>               guid               | start_date 
> ----------------------------------+------------
> d056957f75be14b065a4ccd6d95b8a32 | 23-12-2010
> 2912e5e01ff3b0f9517c3aeab207f4c2 | 10-12-2010
> 7c457d9f5909d2ffa6cd9e385e2562a7 | 07-11-2010
> (3 rows)
> 
>> They should be of the form YYYYMMDD. 
> 
> Therefore I checked datestyle set for database:
> 
> gnucash=# show datestyle;
>   DateStyle   
> ---------------
> Postgres, DMY
> (1 row)
> 
> I modified datestyle option to YMD, as you suggested, and Gnucash stopped crashing:
> 
> gnucash=# alter database gnucash SET datestyle TO 'iso, ymd';
> ALTER DATABASE
> gnucash=# show datestyle;
>   DateStyle   
> ---------------
> Postgres, DMY
> (1 row)
> 
>> The proximate cause of the crash itself is obvious enough: Unchecked dereferencing of a NULL pointer. *That* I can fix.
> Maybe you could use my case to implement some datestyle check into Gnucash, and notify user what is root cause of similar problems.

Interesting, thanks.

Yes, I'll look at adjusting that setting in the database setup.

Regards,
John Ralls




More information about the gnucash-user mailing list