[Lazarus] Lazreport of master-detail

Jesus Reyes jesusrmx at yahoo.com.mx
Thu Jun 26 12:27:38 CEST 2014



> El Jueves, 26 de junio, 2014 3:08:23, Koenraad Lelong <lazarus2 at de-brouwerij.be> escribió:
...
> Hi,
> 
> Since I did not find a way to backtrace in Lazarus, I did it via 
> gdb-commandline. This is what I get (Windows XP) :
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x004036bb in SYSTEM_FORWARDS_SSE_3 ()
> (gdb) bt
> #0  0x004036bb in SYSTEM_FORWARDS_SSE_3 ()
> #1  0x005dc7a4 in 
> BUFDATASET_TCUSTOMBUFDATASET_$__CURRENTRECORDTOBUFFER$PCHAR
>      ()
> #2  0x0009b908 in ?? ()
> #3  0x00594cee in DB_TDATASET_$__GETPRIORRECORD$$BOOLEAN ()
> #4  0x00596fa7 in DB_TDATASET_$__RESYNC$TRESYNCMODE ()
> #5  0x0059692e in DB_TDATASET_$__GOTOBOOKMARK$POINTER ()
> #6  0x00000001 in ?? ()
> #7  0x0007da50 in ?? ()
> #8  0x005c677a in RESTOREBOOKMARKS (parentfp=0x260f1e8) at lr_class.pas:7171
> #9  0x005c5ecb in TFRPAGE__FORMPAGE (this=<error reading variable>)
>      at lr_class.pas:7438


...

The problem here is sqldb bookmark handling on detail datasets. In some circumstances it's broken, see bug reports http://bugs.freepascal.org/view.php?id=26132 and http://bugs.freepascal.org/view.php?id=26146

LazReport backup datasets current positions before the report is processed and then it tries to restore them when done. 

It does this because sometimes the datasets are linked to visual components which, in the end, would show incorrect "current" records. The implemented solution is by using a notification, when LazReport is about to backup the bookmarks, it triggers an event which on return instruct LazReport to do the backup/restore bookmark action or not. 

If "not backup/restore bookmarks" is (most of the time) the expected behavior, we can replace the current solution and implement a LazReport option, roDontBackupBookmarks enabled by default. So it doesnt backup/restore the bookmarks automatically.

Suggestions are welcomed.

Jesus Reyes A.


> 
> Since it's not my application that's behaving bad (AFAICT) I'm going 
> to 
> try to reproduce this with a "public" database. Then I'll write a 
> bug-report.
> 
> 
> Koenraad.
> 




More information about the Lazarus mailing list