[Lazarus] Strange access violation
Mattias Gaertner
nc-gaertnma at netcologne.de
Wed May 4 17:36:38 CEST 2011
Luca Olivetti <luca at wetron.es> hat am 4. Mai 2011 um 13:44 geschrieben:
> Lately I'm getting a bunch of those. I thought it was because I was
> using an old version of lazarus, but now I upgraded to 0.9.30 (self
> compiled from http:://svn.freepascal.org/svn/lazarus/tags_lazarus_0_9_30
> with fpc 2.4.2 under win32) and I got another strange one.
>
> The exception, according to the stack trace, is in line 27 of monitor.inc:
>
> function TMonitor.GetInfo(out Info: TMonitorInfo): Boolean;
> begin
> Info.cbSize := SizeOf(TMonitorInfo);
> Result := GetMonitorInfo(Handle, @Info); <<--here
> end;
>
>
> Called from here:
>
> function TMonitor.GetBoundsRect: TRect;
> var
> Info: TMonitorInfo;
> begin
> if GetInfo(Info) then <<--here
> Result := Info.rcMonitor
> else
> Result := Rect(0, 0, 0, 0);
> end;
>
> So I don't understand how an access violation is possible (unless
> windows doesn't look at the cbSize field and tries to access past its
> size). I suspect that the PC where the program is running has some
> problem (maybe a virus?), since I got another access violation on the
> same PC (actually I don't know, I didn't manage to get a stack trace,
> the main form just "vanished" after pressing a button, a different one
> than this time, and that prompted me to upgrade lazarus) but I'm worried.
>
> Of course it isn't reproducible (it happened only once, inside a
> TOpendialog.Execute, I tried many many times after the access violation
> with no problem).
>
> Any idea?
Maybe a heap/stack corruption. Compile with many checks: -ghtl -Criot -Sa
The problem is probably in some package you installed.
Mattias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20110504/deb27eec/attachment-0003.html>
More information about the Lazarus
mailing list