Skip to content
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

Segfaulting on master #663

Closed
edi9999 opened this issue Jul 13, 2017 · 17 comments
Closed

Segfaulting on master #663

edi9999 opened this issue Jul 13, 2017 · 17 comments
Labels

Comments

@edi9999
Copy link
Contributor

edi9999 commented Jul 13, 2017

Hello,

I was using tig-2.2.1 before, and it never segfaulted.

Now on almost master : a628e9d, I see segfaults sometimes when I start tig. It happens immediately on startup, I don't even have the time to see the main view.

I cannot reproduce the bug however, it seems to happen quite randomly.

Do you know how I could give more information ? I have tried with gdb, but it never segfaults then.

@jonas
Copy link
Owner

jonas commented Jul 14, 2017

Thank you for the report.

If you have time and it "semi-reliably" segfaults it would be very helpful if you could do a git bisect. Else I can try to add in some code to generate a stack trace to the terminal.

@jonas jonas added the type:bug label Jul 14, 2017
@edi9999
Copy link
Contributor Author

edi9999 commented Jul 17, 2017

It doesn't segfault with 2.2.2 (I'm on this version since these 3 days)

@edi9999
Copy link
Contributor Author

edi9999 commented Aug 1, 2017

I have switched to master again because of the new + feature which I really appreciate. However it is segfaulting quite often.

Can you add the code to generate a stack trace to the terminal please ?

@jonas
Copy link
Owner

jonas commented Aug 2, 2017

@edi9999 I just pushed a commit 8c0a7c0 which allows you to have stacktraces. However, you need to compile Tig with make all-debug. Hope that will help us get the info required to fix this issue.

@edi9999
Copy link
Contributor Author

edi9999 commented Aug 2, 2017

There was a crash after I installed it, however it doesn't show any useful info I think :

Tig crashed!

Please report this issue along with all info printed below to

  https://github.com/jonas/tig/issues/new

Tig version: 2.2.2-160-g8c0a7c0-dirty

Aborted (core dumped)

@jonas
Copy link
Owner

jonas commented Aug 2, 2017

Ah, can you try to build using this command then: make all-debug CPPFLAGS=-DHAVE_EXECINFO_H

@jonas
Copy link
Owner

jonas commented Aug 2, 2017

Else start Tig via the debugger:

> gdb ./src/tig
gdb> run

When it segfaults run bt in the gdb shell to get the backtrace.

@edi9999
Copy link
Contributor Author

edi9999 commented Aug 3, 2017

It seems to be some race condition of some sort, I was never able to reproduce it with gdb, also, it seems to happen 5% of the time, so not so easy to reproduce.

It just did it again, with a stacktrace

Tig crashed!

Please report this issue along with all info printed below to

  https://github.com/jonas/tig/issues/new

Tig version: 2.2.2-160-g8c0a7c0-dirty

tig[0x40452d]
/lib64/libc.so.6(+0x366f0)[0x7f9fc3b5e6f0]
tig[0x434993]
tig[0x431cc8]
tig[0x42e0e1]
tig[0x41c79c]
tig[0x419bd0]
tig[0x415cde]
tig[0x41619a]
tig[0x40471d]
tig[0x4049cc]
/lib64/libc.so.6(__libc_start_main+0xea)[0x7f9fc3b484da]
tig[0x402dca]
Aborted (core dumped)

@jonas
Copy link
Owner

jonas commented Aug 3, 2017

Without the symbol info exposed withmake all-debug this is not useful. If you can find the core file and email it to me I can take a look at it.

@edi9999
Copy link
Contributor Author

edi9999 commented Aug 3, 2017

I couldn't find your email.
Here is the coredump :

core.tig.1000.f5e8e956caa34fb58397103889b2c24e.22447.1501753363000000.lz4.txt

I have added the .txt extension to be able to upload it to github, but the extension is lz4

@edi9999
Copy link
Contributor Author

edi9999 commented Aug 28, 2017

Any update ? It still segfaults quite often (10 times a day approximately)

@jonas
Copy link
Owner

jonas commented Aug 30, 2017

Sorry, I didn't have time to investigate this yet.

@edi9999
Copy link
Contributor Author

edi9999 commented Sep 15, 2017

It is possible that I found a patch :

diff --git a/src/graph-v2.c b/src/graph-v2.c
index ced6838..9b3dfc9 100644
--- a/src/graph-v2.c
+++ b/src/graph-v2.c
@@ -258,7 +258,9 @@ done_graph(struct graph *graph_ref)
 	struct graph_v2 *graph = graph_ref->private;
 
 	free(graph);
-	htab_empty(intern_string_htab);
+
+	if (intern_string_htab)
+		htab_empty(intern_string_htab);
 }
 
 #define graph_column_has_commit(col) ((col)->id)

@jonas
Copy link
Owner

jonas commented Sep 15, 2017

That's great news. Thanks a lot for looking into this.

The problematic change was introduced in 2932c9b back in July.

@jonas
Copy link
Owner

jonas commented Sep 15, 2017

BTW, care to make a PR?

@edi9999
Copy link
Contributor Author

edi9999 commented Sep 15, 2017

Yes, I will do the PR, I just wanted to test it for a while to see if it still segfaults or not

@edi9999
Copy link
Contributor Author

edi9999 commented Sep 15, 2017

Done #745 :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants