Prevent plugin from crash on v8.3 and later version: Recompile x64 plugins with new header
-
Dear all plugin authors,
You might notice that Notepad++ v8.3 x64 binary will support opening 2GB+ files.
If your plugins are also released in x64 binary, you should replace Sci_Position.h by the new one (or just replace
bytypedef long Sci_PositionCR;
typedef intptr_t Sci_PositionCR;
in Sci_Position.h of your project), then recompile your plugins.It can prevent from crash and to have the best compatibility with Notepad++ v8.3 and later versions.
Feel free to leave your questions/concerning requests here. I will do my best to answer your questions/requests.
Edit: Once you release a new version, please update nppPluginList with your new release, so users can update the incompatible version of plugins to the new ones directly via their new version of Notepad++.
-
D donho pinned this topic on
-
D donho referenced this topic on
-
@donho Shouldn’t it be at least 8.3 with such a breaking change?
-
Don’t forget the x64 plugins that target .NET Framework, for example:
These are based on a .NET plugin template that re-implements the Scintilla interface in C#.
Looking at the template code, it seems character ranges are defined using the
int
type:[StructLayout(LayoutKind.Sequential)] public struct CharacterRange { public CharacterRange(int cpmin, int cpmax) { cpMin = cpmin; cpMax = cpmax; } public int cpMin; public int cpMax; }
That will surely overflow as
int
is an alias for the Common Language Runtime’sInt32
type. -
@rdipardo said in Recompile your x64 plugins with new header:
Don’t forget the x64 plugins that target .NET Framework, for example:
Good point and I’ve looked at some. I think (correct me if I’m wrong) the crash only manifests if you actually use a Scintilla call that would return a
Sci_TextRange
object and looking on Scintilla Docs, there seem to be only 2:I checked my version of Markdown Panel and although the “bad” Scintilla interface code is there, the plugin never uses / calls it and in my daily use of Notepad++ (using the latest dev build) Markdown Panel has not crashed for me.
On the other hand, CsvQuery does crash Notepad++ and it does indeed make a
getTextRange()
call here and here. An issue has been opened.I can’t speak for the rest as I don’t use them nor do I know C# programming in the least.
Cheers.
-
CS-Script is confirmed vulnerable. Haven’t tried the others yet.
I’ve taken the issue upstream, but even if
NppPlugin.NET
gets patched (a new version has been in pre-release for over a year), there’s no telling when/if the dependent plugins will upgrade. (At least the migration path looks easy enough.) -
M Michael Vincent referenced this topic on
-
D donho referenced this topic on
-
D donho referenced this topic on
-
M Michael Vincent referenced this topic on
-
-
D donho referenced this topic on
-
P PeterJones referenced this topic on
-
M Michael Vincent referenced this topic on
-
M Michael Vincent referenced this topic on
-
A tracking issue has been opened.
-
D donho referenced this topic on
-
D donho referenced this topic on
-
D donho referenced this topic on
-
M Michael Vincent referenced this topic on
-
M Michael Vincent referenced this topic on
-
M Michael Vincent referenced this topic on
-
-
-
-
V8.3.3 ussualy crash, hope v8.4.6 better than
-
A few months ago, I’ve created a PR which was already merged to the plugins pack origin repo which targets at least some of the pointers:
https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net/pull/91
And there is still one open:
https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net/pull/95 -
D donho unpinned this topic on