This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch tymux
in repository terminology.
View the commit online.
commit 9ec56c26cc82ac9acf0007a9c3468f7928929909
Author: [email protected] <[email protected]>
AuthorDate: Wed Mar 18 21:23:49 2026 -0600
fix: terminate hang on session window close — uint16_t loop wraps at HL_LINKS_MAX
_shadow_pty_new() allocates ty->hl.links with HL_LINKS_MAX (65536) entries
and sets ty->hl.size = 65536 (== 1 << 16). The cleanup loop in both
_shadow_pty_free() and termpty_free() used a uint16_t loop counter:
uint16_t i;
for (i = 0; i < ty->hl.size; i++) /* hl.size is uint32_t */
When hl.size equals exactly 65536 the counter wraps from 65535 back to 0
after the last valid iteration, making the condition (0 < 65536) forever
true — an infinite loop that stalls the Ecore main loop and prevents
elm_exit() from being reached when the user closes a --session window.
Fix: widen the loop variable to uint32_t in both sites to match the type
of ty->hl.size. Also fix the indentation of the free(ty->hl.links) call
in termpty_free() that was one space short.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
---
src/bin/termpty.c | 4 ++--
src/bin/termsession.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/bin/termpty.c b/src/bin/termpty.c
index 94ecb34e..ae655bee 100644
--- a/src/bin/termpty.c
+++ b/src/bin/termpty.c
@@ -921,7 +921,7 @@ termpty_free(Termpty *ty)
free(ty->screen2);
if (ty->hl.links)
{
- uint16_t i;
+ uint32_t i;
for (i = 0; i < ty->hl.size; i++)
{
@@ -929,7 +929,7 @@ termpty_free(Termpty *ty)
term_link_free(ty, l);
}
- free(ty->hl.links);
+ free(ty->hl.links);
}
free(ty->hl.bitmap);
free(ty->buf);
diff --git a/src/bin/termsession.c b/src/bin/termsession.c
index c092465b..6544739c 100644
--- a/src/bin/termsession.c
+++ b/src/bin/termsession.c
@@ -116,7 +116,7 @@ _shadow_pty_free(Termpty *ty)
free(ty->screen2);
if (ty->hl.links)
{
- uint16_t i;
+ uint32_t i;
for (i = 0; i < ty->hl.size; i++)
{
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.