Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2014-06

Lazreport of master-detail

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Koenraad Lelong

Hi,

I got a strange problem when I show a Lazreport of a master-detail relationship.
If the master-table contains an odd number of items, the report is OK. If it contains an even number of items it crashes with this error :

Program received signal SIGSEGV, Segmentation fault. 0x00000000004df6d4 in SYSTEM_MOVE$formal$formal$INT64 () (gdb) bt
#0 0x00000000004df6d4 in SYSTEM_MOVE$formal$formal$INT64 () #1 0x00000000008c2893 in
BUFDATASET_TCUSTOMBUFDATASET_$__CURRENTRECORDTOBUFFER$PCHAR () #2 0x00007ffff7fb6701 in ?? ()
#3 0x0000000000000000 in ?? ()

That's with Lazarus 1.2.2, on Linux 64bit. But I think I do have the same problem on 32bit Windows. I switched to linux to be able to backtrace. Can I have a backtrace in Windows ?

Koenraad.

Reply by email

Reinier Olislagers
to Koenraad Lelong
Koenraad Lelong wrote
backtrace. Can I have a backtrace in Windows ?

Yes. Use e.g. -gw2 -gl -O-1 (Lazarus: dwarf 2 format, line number, no optimization, add -O-1 in extra options or whatever it's called) when compiling.
Run gdb as usual and you should get the backtrace.... or run it in the debugger under Lazarus to do things the GUI way ;)

Reply by email

Koenraad Lelong
to Reinier Olislagers
Reinier Olislagers wrote 9 lines
On 24/06/2014 10:29, Koenraad Lelong wrote: > backtrace. Can I have a backtrace in Windows ? Yes. Use e.g. -gw2 -gl -O-1 (Lazarus: dwarf 2 format, line number, no optimization, add -O-1 in extra options or whatever it's called) when compiling. Run gdb as usual and you should get the backtrace.... or run it in the debugger under Lazarus to do things the GUI way ;)

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
#10 0x005cef0e in TFRREPORT__DOBUILDREPORT (this=<error reading variable>) at lr_class.pas:9873
#11 0x005cdf8a in TFRREPORT__BUILDBEFOREMODAL (SENDER=0x9bb48, this=<error reading variable>) at lr_class.pas:9517 #12 0x00612e5f in TFRPROGRESSFORM__DOBEFOREMODAL (DATA=0, this=<error reading variable>) at lr_progr.pas:88
#13 0x0042309d in TAPPLICATION__PROCESSASYNCCALLQUEUE ( this=<error reading variable>) at ./include/application.inc:1079 #14 0x0042192f in TAPPLICATION__IDLE (WAIT=true,
this=<error reading variable>) at ./include/application.inc:389 #15 0x0041d46c in TCUSTOMFORM__SHOWMODAL (this=<error reading variable>) at ./include/customform.inc:2907
#16 0x00612db1 in TFRPROGRESSFORM__SHOW_MODAL (DOC=0x2f88228, this=<error reading variable>) at lr_progr.pas:70
#17 0x005ce45e in TFRREPORT__DOPREPAREREPORT (this=<error reading variable>) at lr_class.pas:9671
#18 0x005ce0eb in TFRREPORT__PREPAREREPORT (this=<error reading variable>) at lr_class.pas:9567
#19 0x005cf151 in TFRREPORT__SHOWREPORT (this=<error reading variable>) at lr_class.pas:9927
#20 0x00426f09 in TFORM1__BTNPREVIEWCLICK (SENDER=0x2f3fc10, this=<error reading variable>) at modmain.pas:65
#21 0x00513068 in TCONTROL__CLICK (this=<error reading variable>) at ./include/control.inc:2711
#22 0x0052fe6f in TBUTTONCONTROL__CLICK (this=<error reading variable>) at ./include/buttoncontrol.inc:54
#23 0x005305c6 in TCUSTOMBUTTON__CLICK (this=<error reading variable>) at ./include/buttons.inc:169
#24 0x00530c21 in TBUTTON__CLICK (this=<error reading variable>) at ./include/buttons.inc:349
#25 0x0052fd7a in TBUTTONCONTROL__WMDEFAULTCLICKED (MESSAGE=..., this=<error reading variable>) at ./include/buttoncontrol.inc:20 #26 0x0040b846 in SYSTEM_TOBJECT_$__DISPATCH$formal () #27 0x0052fd60 in TBUTTONCONTROL__ISCHECKEDSTORED ( this=<error reading variable>) at ./include/buttoncontrol.inc:16 #28 0x00506b1f in TWINCONTROL__WNDPROC (MESSAGE=..., this=<error reading variable>) at ./include/wincontrol.inc:5327 #29 0x0055e8db in DELIVERMESSAGE (TARGET=0x2f3fc10, AMESSAGE=void) at lclmessageglue.pas:112
#30 0x004de361 in WINDOWPROC (WINDOW=66834, MSG=273, WPARAM=64528, LPARAM=66846) at win32callback.inc:2478
#31 0x00587338 in CUSTOMFORMWNDPROC (WINDOW=66834, MSG=273, WPARAM=64528, LPARAM=66846) at win32wsforms.pp:395
#32 0x7e398734 in USER32!GetDC () from C:\WINDOWS\system32\user32.dll #33 0x00010512 in ?? ()
#34 0x7e398816 in USER32!GetDC () from C:\WINDOWS\system32\user32.dll #35 0x00587230 in ADJUSTFORMBOUNDS (AFORM=0x0, SIZERECT=...) at win32wsforms.pp:316
#36 0x7e3a927b in USER32!GetParent () from C:\WINDOWS\system32\user32.dll #37 0x00000000 in ?? ()
(gdb)

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.

Reply by email

Jesus Reyes
to Koenraad Lelong: Since I did not find a way to backtrace in Lazarus, I did it via gdb-commandline. This is…
El Jueves, 26 de junio, 2014 3:08:23, Koenraad Lelong escribi?:

...

Show quoted text 21 lines
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>) ? :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.

Show quoted text 9 lines
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.

Reply by email