[fpc-pascal] self corrupted after jump to overridden method

Mattias Gaertner nc-gaertnma at netcologne.de
Wed Feb 17 19:06:10 CET 2021


On Wed, 17 Feb 2021 15:27:40 +0100
Mattias Gaertner via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:

> Hi,
> 
> I have a strange bug, that suddenly Self becomes a random value when
> calling an overridden virtual method. It happens when activating a
> TCustomSQLQuery.
> Below is a gdb stacktrace with fpc 3.3.1, where Self became 0. On
> other runs I saw various other values.

My patch turns the crash into a normal Exception:
https://bugs.freepascal.org/view.php?id=38503

 
> Where to start looking?
> It happens in Lazarus at designtime, so maybe some vmt issue?

Turns out it was an evil combination of optimization and misleading gdb
output.

Mattias


More information about the fpc-pascal mailing list