Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Hardening" of the NppShell code needed. #67

Open
xomx opened this issue Feb 14, 2025 · 0 comments
Open

"Hardening" of the NppShell code needed. #67

xomx opened this issue Feb 14, 2025 · 0 comments

Comments

@xomx
Copy link
Contributor

xomx commented Feb 14, 2025

Some reports of the Explorer shell crashes caused by this extension:

https://community.notepad-plus-plus.org/topic/26565/notepad-v8-7-1-32-bit-nppshell-dll-is-intermittently-crashing-windows-explorer
notepad-plus-plus/notepad-plus-plus#15683
notepad-plus-plus/notepad-plus-plus#15788
notepad-plus-plus/notepad-plus-plus#12448

I was unable to identify exact culprit in the NppShell code, partly due to the current nature of Microsoft's way of dealing with such crashes (instead of a direct crash where the app callstack leading to a crash is preserved, they decided to invoke their CRT func handlers like abort(), which then make it impossible to reveal the callstack from the dump, thus making the dumps useless).

Anyway, I reviewed the NppShell code and found several issues, some of which are fundamental and need a major revision of the code design.

Most importantly, the code uses throwing (of unhandled exceptions) when detecting a problem - this is unacceptable in a shell extension because of it then leads to the entire Explorer shell crashing!

Furthermore, the code does not assume at all that an unexpected situation could occur when handling inputs (e.g. reading from the Registry, i.e. invalid or corrupted key data), while using WINAPIs or CRT funcs, which will generate an exception itself in such a situation...

I will try to do some PRs to fix this and hopefully that will solve these crash issues reported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant