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

Note++ Crashes on exit. #260

Closed
jsarcone opened this issue Jun 15, 2021 · 13 comments
Closed

Note++ Crashes on exit. #260

jsarcone opened this issue Jun 15, 2021 · 13 comments

Comments

@jsarcone
Copy link

When DSpellCheck is enabled closing NotePad++ crashes. NotePad++7.9.5 and 8.0. DSpellCheck 1.4.20.
image

This is consistent and reproducible.

@Predelnik
Copy link
Owner

Can you share a dump file via Task Manager->right click Notepad++->Create dump file?
You can send it via link on any file sharing service to predelnik@gmail.com or file itself if it fits as an attachment
It would really help me to figure it out. I haven't tested 8.0 yet but 7.9.5 doesn't seem to exhibit such behavior for me.

@Predelnik
Copy link
Owner

By the way could it be that you also using ExtSetitngs plugin?
We came to a bit of impasse at fixing this issue unfortunately (see #173)

@jsarcone
Copy link
Author

I don't have this plugin. Are you suggesting try to use this plugin?
image

@Predelnik
Copy link
Owner

No, it's the other way 'round, having it was causing the issue similar to the one you are describing. If you do not have it then it means this issue must be a different one.

@Predelnik
Copy link
Owner

So analyzing your crash dump I observe that it crashes via some actions from epclient64.dll.
It seems to be something from Citrix workspace app, I found it causing crashes here also but might be unrelated. I will try installing it and see if it is reproducted from my side.

@jsarcone
Copy link
Author

jsarcone commented Jun 15, 2021 via email

@jsarcone
Copy link
Author

jsarcone commented Jun 15, 2021 via email

@Predelnik
Copy link
Owner

It all seems clear now, thank you for posting plugin list even if it was not explicitly requested.
Looks like it is SpeechPlugin unfortunately.

Technical details

It calls CoUnitialize from DllMain which Microsoft recommends not to do. Basically the thing similar to ExtSettings

But luckily it seems to be maintained by @chcg now, so I'll probably be able to make pull request to fix this.

@chcg
Copy link
Contributor

chcg commented Jun 16, 2021

@Predelnik Yes, i did a rebuild of the speech plugin mainly for arm64 support. The plugin uses COINIT_APARTMENTTHREADED as yours, so this should cause no problems. From my understanding of this discussion and https://docs.microsoft.com/en-us/windows/win32/api/combaseapi/nf-combaseapi-coinitializeex:

Because there is no way to control the order in which in-process servers are loaded or unloaded, do not call CoInitialize, CoInitializeEx, or CoUninitialize from the DllMain function.

these calls should be moved to e.g.
setInfo()
beNotified()

Is this correct?

I did a fix for that, see
chcg/SpeechPlugin@90a91cb

Could you please test with
https://github.com/chcg/SpeechPlugin/actions/runs/942365527#artifacts

if the issue is gone. I can't reproduce it so far on my own.

chcg added a commit to chcg/SpeechPlugin that referenced this issue Jun 16, 2021
fix issue with calling CoInitializeEx and CoUninitialize in DllMain, see
https://docs.microsoft.com/en-us/windows/win32/api/combaseapi/nf-combaseapi-coinitializeex:

Because there is no way to control the order in which in-process servers are loaded or unloaded, do not call CoInitialize, CoInitializeEx, or CoUninitialize from the DllMain function.
@jsarcone
Copy link
Author

Thank you both for looking into this. I have had both plug-ins for years. I don't know why this just started happening but thank you for looking into this.

@Predelnik
Copy link
Owner

@chcg Thank you very much! I confirm that fix seems to be correct and it fixes the problem for me.

On my side it was manifesting as a fast fail exception on exit during debug in visual studio, but like I commented in #173 it seems to lead to pretty random effects unfortunately.

@jsarcone
Copy link
Author

Sorry, I finally had a chance to test this. Works like a champ. Thank you so much for your help please let me know when it gets published. Thank you!

@Predelnik
Copy link
Owner

@jsarcone SpeechPlugin 0.3.1 is available in releases section on github (link). It would probably be updated on plugins admin with the next N++ release.

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

3 participants