[BUG] Access Violation on invalid Align value lazarus / 10-Designer ---------------------------------------------------------------------- Eugene Loza · 2017-09-08 16:08 Access Violation error on inputting an invalid Align value. Steps to reproduce the bug: 1. Start a fresh Application. 2. Switch to Form Editor. 3. Put any control on the form (I've tested for TButton and TGroupBox) 4. Edit Align and delete a symbol there (e.g. alCustom -> lCustom) 5. Push Enter. 6. Get Access Violation Error the Lazarus cannot work properly further, showing Access Violation every time something is edited at the Form Editor. Lazarus 1.8.0RC3 FPC 3.0.3 Debian Jessie 64 bit. ---------------------------------------------------------------------- Almir.Bispo · 2017-09-08 18:42 This is not a bug,but a bad use.Don't put a empty value because is not permited ---------------------------------------------------------------------- Noodly · 2017-09-08 18:57 @Almir.Bispo Any program that crashes for any reason has a bug - except O/S or hardware failure. All programs should cater for any input or sequence of events without crashing and at the very worst show an accurate error message before gracefully exiting. ---------------------------------------------------------------------- SunyD · 2017-09-08 19:35 I can't confirm that with Lazarus 1.6.4 and 1.8 RC 4 on windows 7. When I write wrong value i.e. lcustom or blabla it changes to alCustom. Maybe Linux or gtk problem. ---------------------------------------------------------------------- wp · 2017-09-08 21:37 Quote from: Soner A. on September 08, 2017, 09:35:16 pmI can't confirm that with Lazarus 1.6.4 and 1.8 RC 4 on windows 7. When I write wrong value i.e. lcustom or blabla it changes to alCustom. Maybe Linux or gtk problem. Same behavior (i.e., no error) on Linux Mint 18.1 KDE 32-bit / Laz trunk / fpc 3.02 ---------------------------------------------------------------------- howardpc · 2017-09-08 21:51 Seems to be a gtk 64-bit-related bug. Happens for me 'reliably' with Mint 18 64-bit. ---------------------------------------------------------------------- Jurassic Pork · 2017-09-08 22:31 hello, on LUBUNTU 16.04  64 bits gtk2 Lazarus 1.8RC3, the first time i try to put a wrong align property i have a small error dialog window with the message access violation but no crash and after to have validate this dialog window no more error. Friendly, J.P ---------------------------------------------------------------------- JuhaManninen · 2017-09-10 10:13 Quote from: Noodly on September 08, 2017, 08:57:19 pmAny program that crashes for any reason has a bug - except O/S or hardware failure. True, such unhandled Access Violation is always a bug. It was reproducible. It did not depend on widgetset nor OS nor CPU architecture. Only setting all debug compiler flags for building Lazarus IDE affected. Then more likely an exception was raised instead of doing something unpredictable later. I fixed it in r55831 in trunk. Please test. If there are no negative side-effects, it will be merged to 1.8. Interestingly my fix actually reverts r185 by Marco from 2001-02-19, which had message:  "* Fix from maillist." The "exit" is needed in TEnumPropertyEditor.SetValue when an invalid value is given. Maybe it was commented out because the Combobox in OI was then read- only and valid values only could be selected.(?) I don't think Marco remembers the details either, it has been over 16.5 years... ---------------------------------------------------------------------- guest58172 · 2017-09-10 12:51 Quote from: Eugene Loza on September 08, 2017, 06:08:42 pmAccess Violation error on inputting an invalid Align value. Steps to reproduce the bug: 1. Start a fresh Application. 2. Switch to Form Editor. 3. Put any control on the form (I've tested for TButton and TGroupBox) 4. Edit Align and delete a symbol there (e.g. alCustom -> lCustom) 5. Push Enter. 6. Get Access Violation Error the Lazarus cannot work properly further, showing Access Violation every time something is edited at the Form Editor. Lazarus 1.8.0RC3 FPC 3.0.3 Debian Jessie 64 bit. Before creating a duplicated entry, this is the bug: https://bugs.freepascal.org/view.php?id=29240 It's actually a more generic problem related to TI controls. ____ A workaround is to use a setter that verifies the value when you publish an enum property. (must be >= low(Stuff) and <= high(Stuff)). Unfortunately this only possible for custom components and other persistents. ---------------------------------------------------------------------- JuhaManninen · 2017-09-10 18:35 r55831 will be merged to 1.8. In r55832 I changed the logic so that OI shows '(Invalid)' instead of the old restored value when an invalid enum value is typed. What do you think?