-
Notifications
You must be signed in to change notification settings - Fork 612
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
SIGSEGV or assertion failure on search #1312
Comments
Discovered that this happens when tig is built with
Something in this causes memory corruption as reported by ASAN:
Just as a test, I tried increasing the size allocated for the diff --git a/src/search.c b/src/search.c
index f786620..843a985 100644
--- a/src/search.c
+++ b/src/search.c
@@ -69,7 +69,7 @@ setup_and_find_next(struct view *view, enum request request)
regex_flags |= REG_ICASE;
if (!view->regex) {
- view->regex = calloc(1, sizeof(*view->regex));
+ view->regex = calloc(1, sizeof(*view->regex) * 2);
if (!view->regex)
return ERROR_OUT_OF_MEMORY;
} This is under Linux (Ubuntu 18.04) with |
Maybe |
I remember having similar problems on Ubuntu 16, without custom CFLAGS. I worked around it by disabling PCRE support.. |
There's a failed assertion (or if assertions are disabled, a SIGSEGV) when loading
tig
astig blame path/to/file
and then immediately executing/search-token<CR>
, first observed in 06f7d75 and confirmed still present inmaster
as of e543cfe.The assertion:
The call stack (without line numbers, but it's pretty clear):
I haven't looked into it at all yet, but logging it here for posterity.
The text was updated successfully, but these errors were encountered: