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

-- Nothing to see here, anymore -- #9514

Closed
dodmi opened this issue Feb 15, 2021 · 15 comments
Closed

-- Nothing to see here, anymore -- #9514

dodmi opened this issue Feb 15, 2021 · 15 comments
Assignees
Labels

Comments

@dodmi
Copy link

dodmi commented Feb 15, 2021

-- Nothing to see here, anymore --

@mere-human
Copy link
Contributor

mere-human commented Feb 15, 2021

This is probably due to dropping Windows XP support.
The extension should be rebuilt.

@mere-human
Copy link
Contributor

I provided some info in the issue Hsilgos/nppsaveasadmin#24 (comment)
Is it possible to disable the extension temporarily? OR is it done once per release?

@mere-human
Copy link
Contributor

If only the Notepad++ could somehow catch the exception being thrown from the plugin's DllMain...
But it seems impossible. The uncaught exception leads to the abortion of the entire process.

@mere-human
Copy link
Contributor

Catching the exception would really be helpful, if a useful error message will be raised afterwards.

The problem is that it is not possible to catch an exception thrown from a DLL when it's being loaded.
Otherwise, Notepad++ catches exceptions from a plugin once it has been loaded (even the access violation).

@donho
Copy link
Member

donho commented Mar 16, 2021

@dodmi
(ref: #9660 (comment))

You had a block list in the installer for old versions of HexEditor, which offered to remove the plugin at install - it would be handy to handle old versions of SaveAsAdmin this way, so that users of upcoming versions of NPP would be aware of the issue at install time (please read my suggestions in the issue here, before closing).

Yes, that's the only solution I can see so far - however, there's no way to distinguish the version of plugin.
Once this critical issue is not solved, auto-updater cannot be triggered.

Any other suggestions are welcome.

@ArkadiuszMichalski
Copy link
Contributor

@donho

however, there's no way to distinguish the version of plugin.

Why, there is no way to read the dll version?
https://stackoverflow.com/questions/940707/how-do-i-programmatically-get-the-version-of-a-dll-or-exe-file

You had a block list...

If a block list is will be created for such situations, it is best to make it officially available as a download. It should contain known cases of broken plug-ins (name, plug-in version, and NPP version from which it doesn't work). At least it will be possible to write some static tool that will verify the status of plugins against this list and actual Notepad++ version, and if it detects such a situation, it will either remove the plugin or inform the user abaout the exact plugin causing the problem.

@donho
Copy link
Member

donho commented Mar 16, 2021

@ArkadiuszMichalski

Why, there is no way to read the dll version?

I know how to do it in C++, but not in NSIS (installer).
And I prefer to process it in installer rather than in Notepad++.
That's the problem.

Edit: Maybe there's a way:
https://nsis.sourceforge.io/GetFileVersion

@ArkadiuszMichalski
Copy link
Contributor

Ah, ok . I don't know what NSIS (installer) is capable of. I suppose this verification (if it is created) will not work for the portable version?

@donho
Copy link
Member

donho commented Mar 16, 2021

this verification (if it is created) will not work for the portable version?

No. Otherwise I have to integrate the verification code into Notepad++ for a specific plugin - that is not reasonable IMO.

@donho
Copy link
Member

donho commented Mar 16, 2021

@mere-human

What if the Notepad++ installer could offer an option to upgrade plugins during while installing a new version?
If a user agrees, then the installer would do this:
Remember the installed plugin list
Remove any existing plugins
Install the latest version for each plugin in the list
Or do a similar check for the latest plugin version via Plugin Admin and prompt the user.

The idea that a wheel has the capacity to fly and to dive is attractive. In reality I prefer to have a wheel, a pair of wings and a scuba set, because it's much more reliable.

@donho donho closed this as completed in f44e6c4 Mar 18, 2021
@ArkadiuszMichalski
Copy link
Contributor

@donho
I check all plugins from both plugin list regarding to crash. Results:

Plugin List:
version: 1.3.0
arch: 32
plugins: 160

totalTime: 1 [min] 34 [s]

pluginsOK: 160
pluginsBAD: 0

and

Plugin List:
version: 1.3.0
arch: 64
plugins: 117

totalTime: 1 [min] 14 [s]

pluginsOK: 117
pluginsBAD: 0

So actually there is no any "very bad" plugin. Quite a few display some dialogs on startup, including that they are incompatible with the current version, but none causes a crash. Additional information:

  • all 32-bit .zip plugins (160) have size 76,8 MB (bytes: 80 592 212)
  • all 64-bit .zip plugins (117) have size 77,1 MB (bytes: 80 947 423)

If someone plans to write a script for checking, it should rather run on a virtual machine, because some plugins may change system settings, like NotepadStarterPlugin.

@donho
I have one more question regarding the version in the .dll file and in the plugin list: sometimes in the plug-in list the version number is shorter than in the .dll file. This makes it impossible to compare version from the .dll against to the plug-in list. Can the plug-in list contain the same version as in the .dll file? I can catch all these cases very quickly.

@donho
Copy link
Member

donho commented Mar 18, 2021

@ArkadiuszMichalski

Wow! Thank you for working on that. I didn't mean to prevent Notepad++ startup from crash due to all the plugins though.

Can the plug-in list contain the same version as in the .dll file? I can catch all these cases very quickly.

Plugin list publishes the version of plugins for displaying the plugin version to users, so plugin authors should provide the version of binary (plugin) to plugin list (via their PR). OTOH, I don't see anyway that plugin list get dll files from the distance via the links provided by plugin authors.

The solution I provided is for the known critical issue (this specific case of NPP Save as Admin plugin), so I think you may overlook and try to find a preventive solution - that is good, but I don't think it's possible.

@ArkadiuszMichalski
Copy link
Contributor

ArkadiuszMichalski commented Mar 18, 2021

Sure, but I wrote some local tools that can analyze some plugin list (32- or 64-bit) so you can test different version plugin list and different version NPP portable (in various configurations). It just uses the list which we give it (inside some NPP folder) and:

  • download .zip if it's not cached
  • unpack .zip to plugins folder
  • run NPP
  • closes any dialog boxes that may appear and detect if not crash due this plugin
  • if all is ok, NPP will close by itself
  • remove previouse plugin and try next .zip untli the end.

Once we have a cache, it checks quickly, as in the logs above. Before creating a new nppPluginList.dll file or new NPP relase, we can simply check whether a some plugin does not crash a whole NPP. Otherwise, you have to wait for a report from users.

image

@chcg
Copy link
Contributor

chcg commented Mar 19, 2021

@ArkadiuszMichalski There was already the idea to implement something similar, see notepad-plus-plus/nppPluginList#250 to avoid/detect incompatibilities.

@donho
Copy link
Member

donho commented Mar 19, 2021

There was already the idea to implement something similar, see notepad-plus-plus/nppPluginList#250 to avoid/detect incompatibilities.

@ArkadiuszMichalski
So I assign both you & @chcg to this issue. The script should be applied to AppVeyor but not to dev's desktop automatically during the build of NppPluginList, since some plugins can change system settings.

@dodmi dodmi changed the title NPP Save as Admin crashes NPP 7.9.3 --- Jun 21, 2023
@dodmi dodmi changed the title --- -- Nothing to see here, anymore -- Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants