View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0036192||Lazarus||IDE||public||2019-10-16 22:35||2021-03-13 20:36|
|Reporter||A Rasm||Assigned To||Michl|
|Fixed in Version||2.1 (SVN)|
|Summary||0036192: IDE crashes when auto-scrollbars in a Memo are selected (containing large body of text)|
|Description||The attached project contains a memo with (quite a bit) of text.|
If you select
Object inspector > Memo > Scrollsbars > ssAutoBoth
the IDE produces the following message:
"Failed to create win32 control, error 2147943568 : Element not found"
|Steps To Reproduce||(See attached project for specific memo contents)|
1. Create new project
2. Create memo
(3. Select wordwrap = false)
4. fill memo lines with text
5. Select "scrollbars" "ssAutoBoth"
IDE crashes with error message.
|Tags||No tags attached.|
|Fixed in Revision||64796|
project_bug.zip (156,451 bytes)
Ok, so I did all the steps you specified, filled the memo with lots of garbage using the OI string editor..
Set the scroll feature as specified and it works here in both the 32 and 64 bit of 2.0.4?
One note I wish to add, you shouldn't be able to load up the Memo like that from resource, it puts a strain on the system.
I reproduced on a different Windows 7 machine.
Did a minimal install of lazarus-2.0.4-fpc-3.0.4-win64.exe on a fresh Windows 7 home edition machine. Language Danish .
New lazarus project ( saved it to a new folder ), created the memo, disabled wordwrap,
Entered Lines TString property.
Copy/pasted the entire/exact contents of the attached textfile
(from Windows notepad) 6600 lines into the memo. Pressed ok to close the dialog.
Set memo scrollbars to auto,
Triggers Win32 exception in lazarus.exe ( a slightly different error # on that machine, so maybe some sort of memory corruption )
badmemo.zip (6,888 bytes)
The result appears identical using a project with just a button and an empty memo.
procedure TForm1.Button1Click(Sender: TObject);
(where badmemo.txt is the attached 622kb file)
On Win10, Lazarus 2.1 32-bit loading a 645.120 bytes textfile (360K time 'A') in a TMemo completely freezes the application.
This is even before setting the scrollbars to ssAutoBoth (from ssNone to begin with).
No error or exception dialog.
No such problem with a TSynEdit.
re: Bart Broersma, loading 360K x 'A'
(I think mine can load the large textfile, even though it takes in the order of minutes), it eventually finishes.
As for the other exception w. ssAuto-scroll:
When I single-step the ssAuto line,
the exception eventually (after quite a few operations) happens here:
177 procedure FinishCreateWindow(const AWinControl: TWinControl; var Params: TCreateWindowExParams;
. const AlternateCreateWindow: boolean; SubClass: Boolean = False);
212 Window := CreateWindowExW(FlagsEx, PWideChar(WideString(pClassName)),
. PWideChar(UTF8ToUTF16(WindowTitle)), Flags,
. Left, Top, Width, Height, Parent, 0, HInstance, @NCCreateParams);
216 if Window = 0 then
. AErrorCode := GetLastError;
. DebugLn(['Failed to create win32 control, error: ', AErrorCode, ' : ', GetLastErrorText(AErrorCode)]);
220 raise Exception.Create('Failed to create win32 control, error: ' + IntToStr(AErrorCode) + ' : ' + GetLastErrorText(AErrorCode));
Some of the values of the parameters (as per mouse-over) to CreateWindowExW are :
WindowTitle <------------------ appears to contain (all?) the Memo lines
(don't know the relevant ones)
> (I think mine can load the large textfile, even though it takes in the order of minutes), it eventually finishes.
Yes, indeed it does finish: about 5 minutes ....
No error on the scrollbars though.
I believe I'm seeing this in 2.0.10 (r63526) on 32-bit Windows 7. I have a form with memos that have ssAutoBoth set in form designer, and they are filled with a lot of text (json dump from youtube-dl, quite a few kB).
Changing the scrollbars to only ssBoth does not fix the problem. Changing to ssNone does not fix the problem, either. Curiously, I can't reproduce the problem in my situation reliably. The data, components, screen position,... are the same, but sometimes it survives most of the time, so I have to repeat the action to get the crash. I estimate 1 in 5-40 cases actually error out for me. (The variable factor influencing the survival rate is the text, of course.)
Not sure if that is useful.
> Not sure if that is useful.
Vladimir Slavik, you should build Lazarus trunk (development version) and its libraries (LazUtils, LCL) with all debug flags enabled.
Then build your own application with debug flags, too.
Then you may get meaningful exception messages. The best would be to run your app under debugger. It gives a proper backtrace after a crash.
A debugger backtrace would be very useful here.
Fixed in Trunk revision 64796. Please test and close if ok.
There is no defined max length for a window title on Windows. Even 100.000 characters are working. 1.200.000 like in the example are to much, there is raised a range check error - the reason for IDE crash. IMHO even 256 characters would be enough, I use MaxWord as maximal length for a window title.
|2019-10-16 22:35||A Rasm||New Issue|
|2019-10-16 22:35||A Rasm||File Added: project_bug.zip|
|2019-10-16 23:11||jamie philbrook||Note Added: 0118637|
|2019-10-16 23:13||jamie philbrook||Note Edited: 0118637||View Revisions|
|2019-10-17 18:15||A Rasm||File Added: badmemo.zip|
|2019-10-17 18:15||A Rasm||Note Added: 0118644|
|2019-10-17 18:26||A Rasm||Note Added: 0118646|
|2019-10-17 18:55||Bart Broersma||Note Added: 0118647|
|2019-10-17 21:23||A Rasm||Note Added: 0118648|
|2019-10-17 21:26||A Rasm||Note Edited: 0118644||View Revisions|
|2019-10-17 21:53||Bart Broersma||Note Added: 0118649|
|2021-01-30 18:52||Vladimir Slavik||Note Added: 0128680|
|2021-01-30 18:58||Vladimir Slavik||Note Edited: 0128680||View Revisions|
|2021-01-30 18:59||Vladimir Slavik||Note Edited: 0128680||View Revisions|
|2021-01-30 19:58||Juha Manninen||Note Added: 0128685|
|2021-03-13 20:26||Michl||Assigned To||=> Michl|
|2021-03-13 20:26||Michl||Status||new => assigned|
|2021-03-13 20:36||Michl||Status||assigned => resolved|
|2021-03-13 20:36||Michl||Resolution||open => fixed|
|2021-03-13 20:36||Michl||Fixed in Version||=> 2.1 (SVN)|
|2021-03-13 20:36||Michl||Fixed in Revision||=> 64796|
|2021-03-13 20:36||Michl||LazTarget||=> -|
|2021-03-13 20:36||Michl||Widgetset||Win32/Win64 => Win32/Win64|
|2021-03-13 20:36||Michl||Note Added: 0129636|