-
Notifications
You must be signed in to change notification settings - Fork 621
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
BUG: Sigsegv while holding the key 'Stage/Unstage current line' #971
Comments
I bisected this bug:
|
Yes, there should be a check on graph->colors.id_map before doing the htab_delete. However you shouldn't be able to reach this point without having id_map. Do you use any unusual setting ? Can you detail step by step how to reproduce ? |
I used the default configuration. For reproduce:
diff --git a/Makefile b/Makefile
index f17419d..3963eda 100644
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,7 @@ TIG_NCURSES ?= -lcurses
LDFLAGS ?= $(TIG_LDFLAGS)
CPPFLAGS ?= $(TIG_CPPFLAGS)
LDLIBS ?= $(TIG_NCURSES) $(TIG_LDLIBS)
-CFLAGS ?= -Wall -O2 $(TIG_CFLAGS)
+CFLAGS ?= -fsanitize=address -fsanitize=undefined -g -Wall -O2 $(TIG_CFLAGS)
prefix ?= $(HOME)
bindir ?= $(prefix)/bin
for i in $(seq 1 100); do echo "" >> NEWS.adoc; done
|
No luck. How does it behave with the following patch ? diff --git a/src/graph-v2.c b/src/graph-v2.c
index 46504a8..69ac158 100644
--- a/src/graph-v2.c
+++ b/src/graph-v2.c
@@ -257,7 +257,8 @@ done_graph(struct graph *graph_ref)
{
struct graph_v2 *graph = graph_ref->private;
- htab_delete(graph->colors.id_map);
+ if (graph->colors.id_map)
+ htab_delete(graph->colors.id_map);
free(graph); |
Yep, this patch works. |
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For reproduce:
WITH DIFF
To debug the crash, I used the address sanitizer:
It show full trace:
The text was updated successfully, but these errors were encountered: