Lazarus

Programming => Packages and Libraries => LazReport => Topic started by: gelinp on April 09, 2016, 09:16:08 pm

Title: strange "access denied" error with lazreport 0.9.9
Post by: gelinp on April 09, 2016, 09:16:08 pm
Hi,

I'm using Lazarus 1.7 (svn trunk this evening) / lazreport 0.9.9 and FPC 3.0. I've got a strange bug (Access violation), only when I run my application to display a Master/Detail report with lazreport. I've already read thread about this, and I take care to close my lazarus and my database before to run my application...

This is the bug with Linux target. The memory leak is an other Bug, I'm working about this second problem too... May be there is a link between them... :
Code: Pascal  [Select][+][-]
  1. Exception Class Name = EAccessViolation
  2. Exception message = Access violation
  3. Heap dump by heaptrc unit
  4. 94643 memory blocks allocated : 9641986/9934968
  5. 94247 memory blocks freed     : 9600194/9892456
  6. 396 unfreed memory blocks : 41792
  7. True heap size : 2228224
  8. True free heap : 2155008
  9. Should be : 2160368
  10. Call trace for block $B58AA2E0 size 138
  11.   $080982A0 line 384 of src/vues/main.pas
  12.   $083227DA
  13.   $0832630C
  14.   $08325762
  15.   $0837F8ED
  16.   $082F4E33
  17.   $082F4EF7
  18.  

With Windows Target, the bug error message is "File not open"...

I tested a lot of manner to build the Master/Detail query and lazareport. I think my report is well formed, with a detail dataset (PEDAGLesSeances) using one parameter as Forward Key to the Prmiary Key of an other master report (PEDAGOLesSequences)... 

I've got some informations to debug:

I uploaded my the project at this link (Version bug only,  windows 32 bits and linux 32 bit targets with binaries) :
http://patrick.gelin.free.fr/typodoc_bug.zip (http://patrick.gelin.free.fr/typodoc_bug.zip) (28 Mo, zipped)


If someone could tell me what is wrong, I'll be really happy. I tested all yesterday long and I can't find my bug with same eyes... !

Thank you very much if you can help me !
Title: Re: strange "access denied" error with lazreport 0.9.9
Post by: jesusr on April 24, 2016, 03:23:58 am
You were hit by a bookmarks bug in sqldb, see issue http://bugs.freepascal.org/view.php?id=26132 and the related one http://bugs.freepascal.org/view.php?id=26146

Fortunatelly the solution is simple, just create a TfrReport OnFormPageBookmarks event handler, let it empty (don't forget to add an empty commented line or the IDE might try to remove the empty event handler).

Moreover in r52241 I have disabled by default this LazReport's feature of trying to preserve the bookmarks, so the creating of an empty event handler is not necessary anymore.
TinyPortal © 2005-2018