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

HexEditor crashes Notepad++ v8 while launch Distraction Free mode with Dark mode activated #51

Open
donho opened this issue May 19, 2021 · 11 comments
Labels

Comments

@donho
Copy link
Contributor

donho commented May 19, 2021

HexEditor crashes Notepad++ v8 while launch Distraction Free mode with Dark mode activated.
To reproduce:

  1. Launch Notepad++ v8
  2. Open 2 files, put them side by side
  3. Enable Dark mode via preferences dialog
  4. Launch Distraction Free mode via menu "View->Distraction Free mode"
  5. Quit Distraction Free mode by clicking + sign on th upper-right corner
  6. Launch Distraction Free mode again: crash

Note that the crash could happen on step 4, or on step 6. If step 6 does not trigger crash, repeat step 4 & step 5, until crash happens.

@donho
Copy link
Contributor Author

donho commented May 19, 2021

@chcg
I have debugged HexEdit for fixing the crash. However, it's just a mess in the code and I don't even understand why it crashed on a null pointer. HexEdit was not even enabled so the "doDialog" function (it crash in it) should not be called.

If you keep maintaining this project could you please check it? Otherwise I have to remove it via installer once the crash is still present.

@chcg chcg added the bug label May 20, 2021
@chcg
Copy link
Owner

chcg commented May 20, 2021

@donho As this is just taken over by me to keep it usable to some degree I do not plan to do a major rewrite. I would concentrate on fixing major bugs like this one.

It is sufficient to have:

  1. 2 files and call "Move to other view"
  2. Launch Distraction Free mode via menu "View->Distraction Free mode"

So no relation to dark mode.

Furthermore the bug is already there before 8.0 (7.9.5 x64)

  1. 2 files
  2. call "Move to other view" on one of them
  3. call View->"Toggle Full Screen Mode" (F11)

The crash also happens. Seems to be an issue with the window handling for the second window instance.

@donho
Copy link
Contributor Author

donho commented May 20, 2021

@chcg

As this is just taken over by me to keep it usable to some degree I do not plan to do a major rewrite. I would concentrate on fixing major bugs like this one.

Understandable Christian. Thank you for willing to fix this bug.

donho added a commit to donho/notepad-plus-plus that referenced this issue May 30, 2021
@donho
Copy link
Contributor Author

donho commented May 30, 2021

@chcg
Please ping me when the crash is fixed, I'll revert the following PR:
notepad-plus-plus/notepad-plus-plus@219dfda

Thank you in advance

@fml2
Copy link

fml2 commented May 31, 2021

Do I understand it correctly that the crash only happens if some manipulations with views are made? I.e. that the crash does not happen if I just use the editor in one view?

Then: Could we leave the plugin in place (not actively remove it) and just have a warning that it may lead to a crash? And that it is used at one's own risk?

I like the plugin very much and use it quite often. And would not want to lose it.

@donho
Copy link
Contributor Author

donho commented May 31, 2021

@fml2

Do I understand it correctly that the crash only happens if some manipulations with views are made? I.e. that the crash does not happen if I just use the editor in one view?

Yes, in 2 views mode, but even HexEditor is not launched.

Then: Could we leave the plugin in place (not actively remove it) and just have a warning that it may lead to a crash? And that it is used at one's own risk?

No, I can't. HexEdit has been one of the most unstable plugins since long time ago. The best case is user gets the crash with HexEdit active or doing some HexEditor's commands. But it's not even the case. Users won't understand the reason of crash, Notepad++ will be blamed - that's why HexEditor plugin has to be removed by installer.

I like the plugin very much and use it quite often. And would not want to lose it.

However, you can, after HexEditor.dll has been removed into the folder named disabled, create "HexEditor2" folder and move "HexEditor.dll" into this folder and rename it as "HexEditor2.dll". So it won't be removed by installer in your future update.

@dodmi
Copy link

dodmi commented Aug 1, 2021

Is there any progress with the compatibility of HexEdit and NPP 8?

@aklink
Copy link

aklink commented Oct 25, 2021

However, you can, after HexEditor.dll has been removed into the folder named disabled, create "HexEditor2" folder and move "HexEditor.dll" into this folder and rename it as "HexEditor2.dll". So it won't be removed by installer in your future update.

Really Thank you for that hint! Since Notepad 6.8 (until Npp 6.7 HexEdit seemed to be very stable... but I might be wrong) there have been massive incompatibilies with HexEdit, but since development moved from Stackoverflow to Github (https://github.com/chcg/NPP_HexEdit) there was a big improvement in compatibility (Thanks to the autor!). In my opinion it is not necessary to deactivate HexEdit with every Npp update. It may have some incompatibilites in special cases, but in general it is very usefull and stable (I am not using new features of NPP like Dark Mode). After each Npp update I had to reactivate HexEdit manually... now I finally can keep it running!

@Neustradamus
Copy link

@donho: It is good with 0.9.10 (21-08-29)?

@kotenok2000
Copy link

Now someone needs to tell notepad++ developers that they need to stop removing hexedit during updates.

@Neustradamus
Copy link

@kotenok2000: @donho is the main developer of Notepad++...

Maybe you can send a message directly or open a new ticket?

chcg added a commit that referenced this issue Feb 2, 2022
…h Dark mode activated #51

- workaround to avoid the crash by disabling ::SetFocus(), this results in a flickering statusbar which is therefore also disabled until a better fix is found
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

7 participants