Intermittent crashes (and the culprit is CS-Script)
Closed this issue · 6 comments
Intermittent crashes while running Notepad++
I just installed the latest version 8.3.1 and was looking at the log changes, and it crashed (my shortcut for Notepad++ has run as Administrator by default)
OR
I copied and pasted a bunch of bookmarks from Chrome (about 30 of them) and was scrolling down and Notepad++ crashed
OR
I copied and pasted the debug information from Notepad++ into a new document window, I highlighted a line of text and right clicked my mouse and clicked copy, then I was just scrolling and Notepad++ crashed
Steps to Reproduce the Issue
This is a new Dell latitude 5521 laptop with Windows 10, Visual Studio 2019
Microsoft Visual Studio Enterprise 2019 Version 16.11.10
I have InstallShield premiere 2020/2018/2016 installed
I have MS Office installed: Microsoft® Outlook® for Microsoft 365 MSO (16.0.14326.20782) 64-bit
I have Chrome installed (latest version)
Expected Behavior
Not to crash
Actual Behavior
crashed, Notepad++ disappears, it is almost to the point where I want to install a older version, because it is almost unusable :(
Debug Information
Notepad++ v8.3.1 (64-bit)
Build time : Feb 13 2022 - 15:41:12
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line :
Admin mode : ON
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows 10 Enterprise (64-bit)
OS Version : 2009
OS Build : 19043.1526
Current ANSI codepage : 1252
Plugins : BracketsCheck.dll ComparePlugin.dll CSScriptNpp.dll DSpellCheck.dll mimeTools.dll NppConverter.dll NppExport.dll XMLTools.dll
Okay weird, I ran NPP with -noPlugin and no issues ( I open change.log, and 2 C# files)
I then uninstalled all plugins and only installed the 3 main ones that are installed by default (Mime Tools, Npp Converter, NppExport) and did copy/paste etc no crashes
I then added BracketCheck and no crashes
I then added Compare and no crashes
I then added CS-Script -C# Intellisense, I start to copy and paste and crashes
I remove CS-Script, and add DSpellCheck, XML Tools one by one and no crashes..
Add back CS-Script - C# Intellisense and open a .CS file copy the copyright text and right click to copy (no menu pops up, the cursor changes to busy, and crashes right away...
so CS Script is the culprit!! (I made sure I was using the latest version as well)
Seems to be a duplicate to #64.
More specifically, a duplicate of this observation:
To cause a crash right now, the plugin only needs to be loaded while the buffer contains a file with active syntax highlight (e.g. a Markdown page does it for me). Selecting any region of text will bring down the application.
The problem path is CSScriptIntellisense.NppExtensions.TextBeforePosition
:
As I said before, this is a "traceless" crash, at least from the Event Viewer's perspective. I had to inspect a memory dump to get the whole story: notepad++.dmp.log
I was delaying the release of the #64 patch until I can bundle it with the new CS-Script engine. But since more reports are coming I will release a HotFix and will handle the engine update separately.
I am not very optimistic about https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net addressing this hosting problem long term. So did the patch by myself and with rdipardo help.
Please test the prerelease: https://github.com/oleg-shilo/cs-script.npp/releases/tag/1.7.27.0
Fixed.
The fix is available via the v1.7.28 release with the transparent dynamic API invoke for the new N++ API:
https://github.com/oleg-shilo/cs-script.npp/releases/tag/v1.7.28.0
It is a proper release but just in case I will let it some time for the user feedback. And if none will push it to PluginAdmin for the normal distribution to the users.