Crash on processing enter with a default button
Original Reporter info from Mantis: maaartinus
-
Reporter name: Maaartin
Original Reporter info from Mantis: maaartinus
- Reporter name: Maaartin
Description:
A single button with ModalResult=mrOK and Default=true, an edit field, and the following four lines suffice to crash an application.
WITH TCrashDialogForm.Create (Application) DO begin
ShowModal;
Free;
END;
Steps to reproduce:
Compile the attached program with Lazarus using GTK2. Click on the button to get the dialog and close it by pressing enter in the edit field.
An access to freed memory comes for sure. Use valgrind to see it or use a GTK2 compiled with --enable-mem-check (which sets all freed memory to 0xAA which leads to a sure crash in this case).
Without --enable-mem-check nothing happens, as the memory in this small example does not get overwritten. In a real application, non-reproducible crashes occur.
Mantis conversion info:
- Mantis ID: 29775
- Version: 1.4.2