-
Notifications
You must be signed in to change notification settings - Fork 614
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
eats all memory and goes into swap #1087
Comments
Thanks for reporting. To avoid the loop until we have a fix, the workaround is
|
The file is encoded ISO-8859 and we likely try to read it as UTF-8. Related: |
@krobelus, with the following, LICENSE doesn't loop anymore, but mime.html still does. We have some translation in place when showing the blob view but we don't have any when reading the output of git show in the diff view. Maybe we need some kind of sanitizing... Not easy though as we have no indication of the encoding. diff --git a/src/string.c b/src/string.c
index 2638d92..3e8f7d9 100644
--- a/src/string.c
+++ b/src/string.c
@@ -313,7 +313,7 @@ utf8_length(const char **start, int max_chars, size_t skip, int *width, size_t m
unicode = utf8_to_unicode(string, bytes);
/* FIXME: Graceful handling of invalid Unicode character. */
if (!unicode)
- break;
+ unicode = '?';
ucwidth = unicode == '\t' ? tab_size - (*width % tab_size) :
utf8proc_charwidth((utf8proc_int32_t) unicode); |
The fix looks good. |
I definitely still have the loop with mime.html (make sure you have |
Changes utf8_char_length(), utf8_to_unicode() and utf8_length() implementation to rely on utf8proc. Fixes jonas#1087
Changes utf8_char_length(), utf8_to_unicode() and utf8_length() implementation to rely on utf8proc. Fixes jonas#1087
Changes utf8_char_length(), utf8_to_unicode() and utf8_length() implementation to rely on utf8proc. Fixes jonas#1087
Changes utf8_char_length(), utf8_to_unicode() and utf8_length() implementation to rely on utf8proc. Fixes jonas#1087
Changes utf8_char_length(), utf8_to_unicode() and utf8_length() implementation to rely on utf8proc. Fixes jonas#1087
Changes utf8_char_length(), utf8_to_unicode() and utf8_length() implementation to rely on utf8proc. Fixes jonas#1087
Changes utf8_char_length(), utf8_to_unicode() and utf8_length() implementation to rely on utf8proc. Fixes jonas#1087
Changes utf8_char_length(), utf8_to_unicode() and utf8_length() implementation to rely on utf8proc. Fixes #1087
Recently I upgraded from tig-2.5.0 to tig-2.5.2. I can no longer view big commits: tig eats up all memory and goes into swap.
Steps to reproduce:
top
and pressM
to sort by memory usage.killall tig
.tig --all
and position to the second to last commit, the one with0ad-0.0.24b-alpha-unix-build.tar.xz
.Enter
to view the commit.top
and executekillall tig
. After those few seconds, you won't be able to abort tig gracefully, it'll send the whole machine into swap.The problem is exacerbated by the fact that tig traps signals. So by the time you realize that
C-C
doesn't work, and you want to open another terminal, it's already too late. I think it must be possible to trap signals in such a way that the first arrival resets the handler, so that the secondC-C
is a sure-fire way to kill the program.I think I was able to bisect the problem to 484aa21.
The text was updated successfully, but these errors were encountered: