-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2045 from majestrate/windows-service-issues
windows platform bug fixes
- Loading branch information
Showing
32 changed files
with
660 additions
and
623 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
commit 56d816014d5e8a7eb055169c7e13a303dad5e50f | ||
Author: Jason Rhinelander <[email protected]> | ||
Date: Mon Oct 31 22:07:03 2022 -0300 | ||
|
||
Set tube->ev_listen to NULL to prevent double unregister | ||
|
||
On windows when using threaded mode (i.e. `ub_ctx_async(ctx, 1)`) | ||
tube_remove_bg_listen gets called twice: once when the thread does its | ||
own cleanup, then again in `tube_delete()`. Because `ev_listen` doesn't | ||
get cleared, however, we end we calling ub_winsock_unregister_wsaevent | ||
with a freed pointer. | ||
|
||
This doesn't always manifest because, apparently, for various compilers | ||
and settings that memory *might* be overwritten in which case the | ||
additional check for ev->magic will prevent anything actually happening, | ||
but in my case under mingw32 that doesn't happen and we end up | ||
eventually crashing. | ||
|
||
This fixes the crash by properly NULLing the pointer so that the second | ||
ub_winsock_unregister_wsaevent(...) becomes a no-op. | ||
|
||
diff --git a/util/tube.c b/util/tube.c | ||
index 43455fee..a92dfa77 100644 | ||
--- a/util/tube.c | ||
+++ b/util/tube.c | ||
@@ -570,6 +570,7 @@ void tube_remove_bg_listen(struct tube* tube) | ||
{ | ||
verbose(VERB_ALGO, "tube remove_bg_listen"); | ||
ub_winsock_unregister_wsaevent(tube->ev_listen); | ||
+ tube->ev_listen = NULL; | ||
} | ||
|
||
void tube_remove_bg_write(struct tube* tube) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule gui
updated
50 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.