Need help repairing my Scintilla application

105 views
Skip to first unread message

TL McCaughn

unread,
Oct 11, 2023, 4:36:06 PM10/11/23
to scintilla-interest
I'm the forum admin for a programming language called IWBasic and designed the IDE for it around Scintilla more than 10 years ago. It can been seen here:https://www.ionicwind.com/   
The IDE source code is written in IWBasic itself.  I had help with the Scintilla portion of the code and that person has long since disappeared.
My problem: 
It appears that a recent window's upgrade to Windows 10 installations  has caused the IDE to crash any time the User tries to open a file. I' have tested the exact same installation on a laptop that hasn't been exposed to recent window's upgrades and the IDE works like it has for the last 10 years or so. After spending the day yesterday stripping code out to see how far it gets before it crashes I found this to be the offending line of code:
hwndSci = CreateWindow("scintilla", "", WS_SCINTILLA, 0, 0, 0, 0, *p.win.hwnd, IDC_SCI, 0, 0)
What am I seeking:
Someone to rebuild my Scintilla for me(considering I know zero).

Neil Hodgson

unread,
Oct 12, 2023, 10:21:47 PM10/12/23
to scintilla-interest

to see how far it gets before it crashes I found this to be the offending line of code:
hwndSci = CreateWindow("scintilla", "", WS_SCINTILLA, 0, 0, 0, 0, *p.win.hwnd, IDC_SCI, 0, 0)

The next step should be to see if the SciLexer DLL is loading. Check the result from a LoadLibrary or similar call. There may not be such a call if your application is linked to SciLexer through an import library or similar.

You can use WinDbg to see which DLLs successfully loaded and where they loaded from.
WinDbg: File | Open Executable; Debug | Go.

ModLoad: 76550000 76575000   C:\WINDOWS\SysWOW64\IMM32.DLL
ModLoad: 587f0000 588dc000   C:\u\arc\upload538\wscite32_538\wscite\Scintilla.DLL
ModLoad: 75570000 75653000   C:\WINDOWS\SysWOW64\ole32.dll

Neil

TL McCaughn

unread,
Oct 13, 2023, 12:04:35 AM10/13/23
to scintilla-interest
Neil
Thanks for responding

 This is what I got. The INT 3 was before anything displayed on the screen. I pressed Go and then asked it to load a file and got the 2nd fail.
************* Waiting for Debugger Extensions Gallery to Initialize 
************** >>>>>>>>>>>>> Waiting for Debugger Extensions Gallery to Initialize completed, duration 0.031 seconds ----> Repository : LocalInstalled, Enabled: true, Packages count: 36 ----> Repository : UserExtensions, Enabled: true, Packages count: 0 Microsoft (R) Windows Debugger Version 10.0.25921.1001 X86 Copyright (c) Microsoft Corporation. All rights reserved. 
 CommandLine: L:\IWBDev3\bin\IWBDev.exe 
 ************* Path validation summary
 ************** Response Time (ms) Location Deferred srv* Symbol search path is: srv* Executable search path is: 
 ModLoad: 00400000 005af000 image00400000 
ModLoad: 77950000 77af4000 ntdll.dll 
ModLoad: 76cc0000 76db0000 C:\WINDOWS\SysWOW64\KERNEL32.DLL 
ModLoad: 767f0000 76a2a000 C:\WINDOWS\SysWOW64\KERNELBASE.dll 
ModLoad: 757d0000 757e4000 C:\Program Files\AVG\Antivirus\x86\aswhook.dll 
ModLoad: 777b0000 777d4000 C:\WINDOWS\SysWOW64\GDI32.DLL 
ModLoad: 766a0000 766b8000 C:\WINDOWS\SysWOW64\win32u.dll 
ModLoad: 763e0000 764c5000 C:\WINDOWS\SysWOW64\gdi32full.dll 
ModLoad: 757f0000 7586b000 C:\WINDOWS\SysWOW64\msvcp_win.dll 
ModLoad: 759f0000 75b10000 C:\WINDOWS\SysWOW64\ucrtbase.dll 
ModLoad: 76a30000 76bcc000 C:\WINDOWS\SysWOW64\USER32.dll 
ModLoad: 75870000 7591f000 C:\WINDOWS\SysWOW64\COMDLG32.DLL 
ModLoad: 75920000 759df000 C:\WINDOWS\SysWOW64\msvcrt.dll 
ModLoad: 774b0000 77730000 C:\WINDOWS\SysWOW64\combase.dll 
ModLoad: 75ca0000 75d5f000 C:\WINDOWS\SysWOW64\RPCRT4.dll 
ModLoad: 77420000 774a7000 C:\WINDOWS\SysWOW64\shcore.dll 
ModLoad: 76340000 76385000 C:\WINDOWS\SysWOW64\SHLWAPI.dll 
ModLoad: 75d80000 76336000 C:\WINDOWS\SysWOW64\SHELL32.dll 
ModLoad: 71b60000 71d70000 C:\WINDOWS\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_a8625c1886757984\COMCTL32.dll 
ModLoad: 76bd0000 76cb3000 C:\WINDOWS\SysWOW64\OLE32.DLL 
ModLoad: 777e0000 7785c000 C:\WINDOWS\SysWOW64\ADVAPI32.DLL 
ModLoad: 752b0000 75326000 C:\WINDOWS\SysWOW64\WINSPOOL.DRV 
ModLoad: 77730000 777a6000 C:\WINDOWS\SysWOW64\sechost.dll 
ModLoad: 71760000 718c7000 C:\WINDOWS\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.19041.2251_none_d9513b1fe1046fc7\GDIPLUS.DLL 
ModLoad: 5bcc0000 5bd51000 C:\WINDOWS\SysWOW64\HHCTRL.OCX 
ModLoad: 766d0000 76766000 C:\WINDOWS\SysWOW64\OLEAUT32.dll 
ModLoad: 74d30000 74d36000 C:\WINDOWS\SysWOW64\MSIMG32.DLL 
ModLoad: 10010000 10037000 C:\WINDOWS\SysWOW64\CRTDLL.DLL 
ModLoad: 5c400000 5c419000 C:\WINDOWS\SysWOW64\OLEPRO32.DLL (94a0.f4ec): 
Break instruction exception - code 80000003 (first chance) eax=00000000 ebx=00000000 ecx=6f1d0000 edx=00000000 esi=77956a78 edi=779569fc eip=77a01c32 esp=018cfa1c ebp=018cfa48 iopl=0 nv up ei pl zr na pe nc cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00000246 
ntdll!LdrpDoDebuggerBreak+0x2b: 77a01c32 
cc int 3 0:000> 
ModLoad: 76e50000 76e75000 C:\WINDOWS\SysWOW64\IMM32.DLL 
ModLoad: 01980000 019fc000 L:\IWBDev3\bin\scilexer.dll 
ModLoad: 01980000 019fc000 L:\IWBDev3\bin\scilexer.dll 
ModLoad: 73c60000 73cd4000 C:\WINDOWS\SysWOW64\uxtheme.dll 
ModLoad: 77860000 77934000 C:\WINDOWS\SysWOW64\MSCTF.dll 
ModLoad: 713a0000 71434000 C:\WINDOWS\SysWOW64\TextShaping.dll 
ModLoad: 74670000 7467f000 C:\WINDOWS\SysWOW64\kernel.appcore.dll 
ModLoad: 75be0000 75c3f000 C:\WINDOWS\SysWOW64\bcryptPrimitives.dll 
ModLoad: 712e0000 71399000 C:\WINDOWS\SysWOW64\textinputframework.dll 
ModLoad: 711b0000 7124b000 C:\WINDOWS\SysWOW64\CoreMessaging.dll 
ModLoad: 70f30000 711ae000 C:\WINDOWS\SysWOW64\CoreUIComponents.dll 
ModLoad: 75b10000 75b73000 C:\WINDOWS\SysWOW64\WS2_32.dll 
ModLoad: 73bb0000 73bd9000 C:\WINDOWS\SysWOW64\ntmarta.dll 
ModLoad: 07430000 0750b000 C:\WINDOWS\SysWOW64\wintypes.dll 
ModLoad: 07350000 0742b000 C:\WINDOWS\SysWOW64\wintypes.dll 
ModLoad: 07350000 0742b000 C:\WINDOWS\SysWOW64\wintypes.dll 
ModLoad: 5f2b0000 5f421000 C:\WINDOWS\SysWOW64\WindowsCodecs.dll 
ModLoad: 75d60000 75d79000 C:\WINDOWS\SysWOW64\bcrypt.dll 
ModLoad: 5c3f0000 5c3f6000 C:\WINDOWS\SysWOW64\riched32.dll 
ModLoad: 5bc40000 5bcba000 C:\WINDOWS\SysWOW64\RICHED20.dll 
ModLoad: 5c3b0000 5c3e1000 C:\WINDOWS\SysWOW64\msls31.dll 
ModLoad: 74d60000 74d77000 C:\WINDOWS\SysWOW64\USP10.dll 
ModLoad: 76770000 767ee000 C:\WINDOWS\SysWOW64\clbcatq.dll 
ModLoad: 5c6d0000 5c701000 C:\WINDOWS\SysWOW64\dataexchange.dll 
ModLoad: 5f690000 5f7f4000 C:\WINDOWS\SysWOW64\dcomp.dll 
ModLoad: 73e80000 74060000 C:\WINDOWS\SysWOW64\d3d11.dll 
ModLoad: 718e0000 719a2000 C:\WINDOWS\SysWOW64\dxgi.dll 
ModLoad: 610f0000 61284000 C:\WINDOWS\SysWOW64\twinapi.appcore.dll 
(94a0.f4ec): Access violation - code c0000005 (first chance) First chance exceptions are reported before any exception handling. This exception may be expected and handled. eax=0059bf98 ebx=018cf400 ecx=000000ff edx=06f8d570 esi=0059bf98 edi=018cf3f8 eip=768f16f1 esp=018cdc04 ebp=018cdc34 iopl=0 
 nv up ei pl nz na pe nc cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00210206 
KERNELBASE!lstrcpynA+0x41: 768f16f1 c60000 mov byte ptr [eax],0 ds:002b:0059bf98=00 

TL

TL McCaughn

unread,
Oct 13, 2023, 1:57:33 PM10/13/23
to scintilla-interest
After studying my last post I realized I didn't post all I needed to post. The following shows the stoppage from when the FileOpen dialog was opened. Then I picked a file and clicked open and clicked open and that was the next stoppage..

0:000> g 
ModLoad: 74710000 74d1d000 C:\WINDOWS\SysWOW64\windows.storage.dll 
ModLoad: 746e0000 74705000 C:\WINDOWS\SysWOW64\Wldp.dll 
ModLoad: 75b80000 75bbb000 C:\WINDOWS\SysWOW64\CFGMGR32.dll 
ModLoad: 745a0000 74662000 C:\WINDOWS\SysWOW64\propsys.dll 
ModLoad: 74580000 74598000 C:\WINDOWS\SysWOW64\profapi.dll 
ModLoad: 74d80000 74da6000 C:\WINDOWS\SysWOW64\dwmapi.dll 
ModLoad: 5b350000 5b3d3000 C:\Program Files (x86)\Common Files\microsoft shared\ink\tiptsf.dll 
ModLoad: 74560000 7457b000 C:\WINDOWS\SysWOW64\edputil.dll 
ModLoad: 5b300000 5b348000 C:\Windows\SysWOW64\thumbcache.dll 
ModLoad: 5b2a0000 5b2fc000 C:\WINDOWS\SysWOW64\ntshrui.dll 
ModLoad: 75270000 75291000 C:\WINDOWS\SysWOW64\SspiCli.dll 
ModLoad: 73a60000 73a7d000 C:\WINDOWS\SysWOW64\srvcli.dll 
ModLoad: 5bd60000 5bd6e000 C:\WINDOWS\SysWOW64\cscapi.dll 
ModLoad: 5b210000 5b291000 C:\WINDOWS\SysWOW64\StructuredQuery.dll 
ModLoad: 5b180000 5b205000 C:\WINDOWS\SysWOW64\policymanager.dll 
ModLoad: 5b110000 5b175000 C:\WINDOWS\SysWOW64\msvcp110_win.dll    
ModLoad: 5b070000 5b103000 C:\Windows\SysWOW64\Windows.StateRepositoryPS.dll 
ModLoad: 5afd0000 5b06f000 C:\WINDOWS\SysWOW64\Windows.Storage.Search.dll 
ModLoad: 75330000 753d0000 C:\WINDOWS\SysWOW64\apphelp.dll 
ModLoad: 5ae40000 5afc7000 C:\Users\Larry\AppData\Local\Microsoft\OneDrive\23.194.0917.0001\i386\FileSyncShell.dll 
ModLoad: 76e80000 76f80000 C:\WINDOWS\SysWOW64\CRYPT32.dll 
ModLoad: 756b0000 756b8000 C:\WINDOWS\SysWOW64\VERSION.dll 
ModLoad: 755f0000 755ff000 C:\WINDOWS\SysWOW64\WTSAPI32.dll 
ModLoad: 74df0000 75245000 C:\WINDOWS\SysWOW64\WININET.dll 
ModLoad: 72990000 729b5000 C:\WINDOWS\SysWOW64\USERENV.dll 
ModLoad: 752a0000 752aa000 C:\WINDOWS\SysWOW64\Secur32.dll 
ModLoad: 74db0000 74dba000 C:\WINDOWS\SysWOW64\CRYPTBASE.DLL 
ModLoad: 5ab00000 5ae31000 C:\Program Files\AVG\Antivirus\x86\ashShell.dll 
ModLoad: 75460000 754a4000 C:\WINDOWS\SysWOW64\POWRPROF.dll 
ModLoad: 74dc0000 74dcd000 C:\WINDOWS\SysWOW64\UMPDC.dll (f768.e724): C++ EH exception - code e06d7363 (first chance) 
ModLoad: 5a860000 5aaf8000 C:\WINDOWS\SysWOW64\msi.dll 
ModLoad: 5a810000 5a859000 C:\Windows\SysWOW64\Windows.FileExplorer.Common.dll 
ModLoad: 73830000 73a5d000 C:\Windows\SysWOW64\iertutil.dll 
(f768.f348): Access violation - code c0000005 (first chance) 
First chance exceptions are reported before any exception handling. 
This exception may be expected and handled. 
eax=00000000 ebx=005670d8 ecx=005670d8 edx=00000000 esi=000e0a6a edi=00000888 
eip=005670d8 esp=018cc808 ebp=018cc830 iopl=0         nv up ei pl nz na pe nc 
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00210206 
IWBDev+0x1670d8: 
005670d8 55      push ebp 
0:000> g 
(f768.f348): Unknown exception - code c000041d (!!! second chance !!!) 
eax=00000000 ebx=005670d8 ecx=005670d8 edx=00000000 esi=000e0a6a edi=00000888 
eip=005670d8 esp=018cc808 ebp=018cc830 iopl=0         nv up ei pl nz na pe nc 
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00210206 
IWBDev+0x1670d8: 
005670d8 55      push ebp 

Neil Hodgson

unread,
Oct 14, 2023, 12:52:23 AM10/14/23
to scintilla-interest
The modloads look happy although its odd (but benign) that SciLexer is loaded twice.

SciLexer is loaded from the same place L:\IWBDev3\bin as the exe so its not getting the wrong version.


> (f768.f348): Access violation - code c0000005 (first chance)
c0000005 is reading or writing outside allocated memory so doesn't narrow things down much.

> (f768.f348): Unknown exception - code c000041d (!!! second chance !!!)
This is just continuing the failed state from c0000005.

Its possible that the version of SciLexer you are using has a crashing bug. You could try downloading a SciTE executable near in time to your SciLexer.

Old versions of SciTE are found in
Start with 2.02.
The files you want are full windows executable installations which contain SciTE.exe and SciLexer.dll: wscite***.zip.

Check if SciTE works.

If SciTE works then copy its SciLexer.dll into the directory of IWBDev and see if that works.

If SciTE fails like IWBDev then its likely that the included SciLexer has a bug and you should try newer versions of SciTE until finding one that works then copy its SciLexer.dll. Probably best to stop before 3.x.

While newer versions of SciLexer.dll are mostly compatible with older applications, there are sometimes mistakes or deliberate changes that break compatibility. This is more likely when the major version number changes.

Neil

TL McCaughn

unread,
Oct 14, 2023, 1:43:14 PM10/14/23
to scintilla-interest

I tried all the 2.xx versions of SciTE and they all work and I tried their SciLexer.dll with my program and my program is still broke.
In the downloads I did not find a Scintilla.dll to test in lieu of mine.
TL

Neil Hodgson

unread,
Oct 14, 2023, 5:37:33 PM10/14/23
to scintilla-interest

I tried all the 2.xx versions of SciTE and they all work and I tried their SciLexer.dll with my program and my program is still broke.
In the downloads I did not find a Scintilla.dll to test in lieu of mine.

Scintilla.dll is just SciLexer.dll without the language support code. It wasn't popular until 5.x when the lexers were made available as Lexilla.dll.

Running out of things to try. Are you running an accessibility tool like the NVDA screen reader? NVDA contains Scintilla-specific functions which can cause versioning problems.

You could closely examine the call to CreateWindow, perhaps logging the values to file to see what p and *p.win.hwnd are. WS_SCINTILLA is not defined by Scintilla and is likely locally defined as a combination of WS_ constants. HINSTANCE parameter should really be the HINSTANCE of the application but it only really mattered in the distant past. Also log immediately after the CreateWindow call to see if it returned. Could look at the messages processed by the main message loop during the CreateWindow call espcially if they call any application code.

> hwndSci = CreateWindow("scintilla", "", WS_SCINTILLA, 0, 0, 0, 0, *p.win.hwnd, IDC_SCI, 0, 0)

Here is the CreateWindowEx used by SciTE - CreateWindowEx differs from CreateWindow just in having extra flags as the first argument.

::CreateWindowEx(
     0,
     TEXT("Scintilla"),
     TEXT("Source"),
     WS_CHILD | WS_VSCROLL | WS_HSCROLL | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
     0, 0,
     100, 100,
     HwndOf(wContent),
     HmenuID(IDM_SRCWIN),
     hInstance,
     nullptr)

TL McCaughn

unread,
Oct 15, 2023, 6:33:26 PM10/15/23
to scintilla-interest
 I used the  CreateWindowEx function to no avail. It worked exactly the same as the non Ex function. The result of printing the message handler  messages when attempting to open a file was as follows:
36    WM_GETMINMAXINFO
129   WM_NCCREATE
131   WM_CALSIZE
1       WM_CREATE
528   WM_PARENTNOTIFY
and then I get the crash messagebox.

TL

TL McCaughn

unread,
Oct 16, 2023, 10:46:37 AM10/16/23
to scintilla-interest
I tried the exact  same program on my laptop(via a memory stick) and got the same sequence of messages and the next event after msg 528 was the scintilla window opening.

Neil Hodgson

unread,
Oct 16, 2023, 5:20:22 PM10/16/23
to scintilla-interest
mccau...@gmail.com:
...528   WM_PARENTNOTIFY
and then I get the crash messagebox.

According to Microsoft's documentation, that occurs just before the CreateWindow returns so there's not much code left to cause a failure.


   Neil

TL McCaughn

unread,
Oct 19, 2023, 2:57:55 PM10/19/23
to scintilla-interest
Exactly???????
Reply all
Reply to author
Forward
0 new messages