Discussion:
Master crash on Linux & cygwin
İsmail Dönmez
2015-02-11 14:46:12 UTC
Permalink
Hi currently master branch seems to be crashing on me with Linux and
Cygwin, valgrind reports 2 errors which might be the culprit(s):

==21229== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
==21229==
==21229== 1 errors in context 1 of 2:
==21229== Invalid read of size 4
==21229== at 0x40ADAB: cmd_if_shell_free (cmd-if-shell.c:184)
==21229== by 0x42A019: job_free (job.c:130)
==21229== by 0x43FB9A: UnknownInlinedFun (job.c:188)
==21229== by 0x43FB9A: server_child_exited (server.c:454)
==21229== by 0x43FB9A: server_child_signal (server.c:427)
==21229== by 0x43FB9A: server_signal_callback (server.c:397)
==21229== by 0x54A5DFA: event_base_loop (in /usr/lib64/libevent-2.0.so.5.1.9)
==21229== by 0x43CEB9: server_loop (server.c:201)
==21229== by 0x43CEB9: server_start (server.c:192)
==21229== by 0x444E32: UnknownInlinedFun (client.c:152)
==21229== by 0x444E32: UnknownInlinedFun (client.c:262)
==21229== by 0x444E32: main (tmux.c:388)
==21229== Address 0x61844fc is 28 bytes inside a block of size 32 free'd
==21229== at 0x4C2A37C: free (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==21229== by 0x4111A3: cmdq_continue (cmd-queue.c:223)
==21229== by 0x4111A3: cmdq_continue (cmd-queue.c:223)
==21229== by 0x418FAE: cmd_source_file_exec (cmd-source-file.c:74)
==21229== by 0x410F1D: cmdq_continue (cmd-queue.c:190)
==21229== by 0x40AD6F: UnknownInlinedFun (cmd-queue.c:141)
==21229== by 0x40AD6F: cmd_if_shell_callback (cmd-if-shell.c:155)
==21229== by 0x43FB92: UnknownInlinedFun (job.c:187)
==21229== by 0x43FB92: server_child_exited (server.c:454)
==21229== by 0x43FB92: server_child_signal (server.c:427)
==21229== by 0x43FB92: server_signal_callback (server.c:397)
==21229== by 0x54A5DFA: event_base_loop (in /usr/lib64/libevent-2.0.so.5.1.9)
==21229== by 0x43CEB9: server_loop (server.c:201)
==21229== by 0x43CEB9: server_start (server.c:192)
==21229== by 0x444E32: UnknownInlinedFun (client.c:152)
==21229== by 0x444E32: UnknownInlinedFun (client.c:262)
==21229== by 0x444E32: main (tmux.c:388)
==21229==
==21229==
==21229== 1 errors in context 2 of 2:
==21229== Invalid read of size 8
==21229== at 0x410F21: cmdq_guard (cmd-queue.c:123)
==21229== by 0x410F21: cmdq_continue (cmd-queue.c:193)
==21229== by 0x40AD6F: UnknownInlinedFun (cmd-queue.c:141)
==21229== by 0x40AD6F: cmd_if_shell_callback (cmd-if-shell.c:155)
==21229== by 0x43FB92: UnknownInlinedFun (job.c:187)
==21229== by 0x43FB92: server_child_exited (server.c:454)
==21229== by 0x43FB92: server_child_signal (server.c:427)
==21229== by 0x43FB92: server_signal_callback (server.c:397)
==21229== by 0x54A5DFA: event_base_loop (in /usr/lib64/libevent-2.0.so.5.1.9)
==21229== by 0x43CEB9: server_loop (server.c:201)
==21229== by 0x43CEB9: server_start (server.c:192)
==21229== by 0x444E32: UnknownInlinedFun (client.c:152)
==21229== by 0x444E32: UnknownInlinedFun (client.c:262)
==21229== by 0x444E32: main (tmux.c:388)
==21229== Address 0x61911b8 is 8 bytes inside a block of size 104 free'd
==21229== at 0x4C2A37C: free (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==21229== by 0x40AF56: UnknownInlinedFun (cmd-queue.c:55)
==21229== by 0x40AF56: cmd_if_shell_done (cmd-if-shell.c:171)
==21229== by 0x4111A3: cmdq_continue (cmd-queue.c:223)
==21229== by 0x4111A3: cmdq_continue (cmd-queue.c:223)
==21229== by 0x418FAE: cmd_source_file_exec (cmd-source-file.c:74)
==21229== by 0x410F1D: cmdq_continue (cmd-queue.c:190)
==21229== by 0x40AD6F: UnknownInlinedFun (cmd-queue.c:141)
==21229== by 0x40AD6F: cmd_if_shell_callback (cmd-if-shell.c:155)
==21229== by 0x43FB92: UnknownInlinedFun (job.c:187)
==21229== by 0x43FB92: server_child_exited (server.c:454)
==21229== by 0x43FB92: server_child_signal (server.c:427)
==21229== by 0x43FB92: server_signal_callback (server.c:397)
==21229== by 0x54A5DFA: event_base_loop (in /usr/lib64/libevent-2.0.so.5.1.9)
==21229== by 0x43CEB9: server_loop (server.c:201)
==21229== by 0x43CEB9: server_start (server.c:192)
==21229== by 0x444E32: UnknownInlinedFun (client.c:152)
==21229== by 0x444E32: UnknownInlinedFun (client.c:262)
==21229== by 0x444E32: main (tmux.c:388)
==21229==
==21229== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)


Regards,
ismail
Nicholas Marriott
2015-02-11 18:11:28 UTC
Permalink
Try this please:

Index: cmd-queue.c
===================================================================
RCS file: /cvs/src/usr.bin/tmux/cmd-queue.c,v
retrieving revision 1.21
diff -u -p -r1.21 cmd-queue.c
--- cmd-queue.c 5 Feb 2015 10:26:29 -0000 1.21
+++ cmd-queue.c 11 Feb 2015 18:08:58 -0000
@@ -163,6 +163,7 @@ cmdq_continue(struct cmd_q *cmdq)
int empty, flags;
char s[1024];

+ cmdq->references++;
notify_disable();

empty = TAILQ_EMPTY(&cmdq->queue);
@@ -220,11 +221,13 @@ empty:
if (cmdq->client_exit > 0)
cmdq->client->flags |= CLIENT_EXIT;
if (cmdq->emptyfn != NULL)
- cmdq->emptyfn(cmdq); /* may free cmdq */
+ cmdq->emptyfn(cmdq);
empty = 1;

out:
notify_enable();
+ cmdq_free(cmdq);
+
return (empty);
}
Post by İsmail Dönmez
Hi currently master branch seems to be crashing on me with Linux and
==21229== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
==21229==
==21229== Invalid read of size 4
==21229== at 0x40ADAB: cmd_if_shell_free (cmd-if-shell.c:184)
==21229== by 0x42A019: job_free (job.c:130)
==21229== by 0x43FB9A: UnknownInlinedFun (job.c:188)
==21229== by 0x43FB9A: server_child_exited (server.c:454)
==21229== by 0x43FB9A: server_child_signal (server.c:427)
==21229== by 0x43FB9A: server_signal_callback (server.c:397)
==21229== by 0x54A5DFA: event_base_loop (in /usr/lib64/libevent-2.0.so.5.1.9)
==21229== by 0x43CEB9: server_loop (server.c:201)
==21229== by 0x43CEB9: server_start (server.c:192)
==21229== by 0x444E32: UnknownInlinedFun (client.c:152)
==21229== by 0x444E32: UnknownInlinedFun (client.c:262)
==21229== by 0x444E32: main (tmux.c:388)
==21229== Address 0x61844fc is 28 bytes inside a block of size 32 free'd
==21229== at 0x4C2A37C: free (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==21229== by 0x4111A3: cmdq_continue (cmd-queue.c:223)
==21229== by 0x4111A3: cmdq_continue (cmd-queue.c:223)
==21229== by 0x418FAE: cmd_source_file_exec (cmd-source-file.c:74)
==21229== by 0x410F1D: cmdq_continue (cmd-queue.c:190)
==21229== by 0x40AD6F: UnknownInlinedFun (cmd-queue.c:141)
==21229== by 0x40AD6F: cmd_if_shell_callback (cmd-if-shell.c:155)
==21229== by 0x43FB92: UnknownInlinedFun (job.c:187)
==21229== by 0x43FB92: server_child_exited (server.c:454)
==21229== by 0x43FB92: server_child_signal (server.c:427)
==21229== by 0x43FB92: server_signal_callback (server.c:397)
==21229== by 0x54A5DFA: event_base_loop (in /usr/lib64/libevent-2.0.so.5.1.9)
==21229== by 0x43CEB9: server_loop (server.c:201)
==21229== by 0x43CEB9: server_start (server.c:192)
==21229== by 0x444E32: UnknownInlinedFun (client.c:152)
==21229== by 0x444E32: UnknownInlinedFun (client.c:262)
==21229== by 0x444E32: main (tmux.c:388)
==21229==
==21229==
==21229== Invalid read of size 8
==21229== at 0x410F21: cmdq_guard (cmd-queue.c:123)
==21229== by 0x410F21: cmdq_continue (cmd-queue.c:193)
==21229== by 0x40AD6F: UnknownInlinedFun (cmd-queue.c:141)
==21229== by 0x40AD6F: cmd_if_shell_callback (cmd-if-shell.c:155)
==21229== by 0x43FB92: UnknownInlinedFun (job.c:187)
==21229== by 0x43FB92: server_child_exited (server.c:454)
==21229== by 0x43FB92: server_child_signal (server.c:427)
==21229== by 0x43FB92: server_signal_callback (server.c:397)
==21229== by 0x54A5DFA: event_base_loop (in /usr/lib64/libevent-2.0.so.5.1.9)
==21229== by 0x43CEB9: server_loop (server.c:201)
==21229== by 0x43CEB9: server_start (server.c:192)
==21229== by 0x444E32: UnknownInlinedFun (client.c:152)
==21229== by 0x444E32: UnknownInlinedFun (client.c:262)
==21229== by 0x444E32: main (tmux.c:388)
==21229== Address 0x61911b8 is 8 bytes inside a block of size 104 free'd
==21229== at 0x4C2A37C: free (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==21229== by 0x40AF56: UnknownInlinedFun (cmd-queue.c:55)
==21229== by 0x40AF56: cmd_if_shell_done (cmd-if-shell.c:171)
==21229== by 0x4111A3: cmdq_continue (cmd-queue.c:223)
==21229== by 0x4111A3: cmdq_continue (cmd-queue.c:223)
==21229== by 0x418FAE: cmd_source_file_exec (cmd-source-file.c:74)
==21229== by 0x410F1D: cmdq_continue (cmd-queue.c:190)
==21229== by 0x40AD6F: UnknownInlinedFun (cmd-queue.c:141)
==21229== by 0x40AD6F: cmd_if_shell_callback (cmd-if-shell.c:155)
==21229== by 0x43FB92: UnknownInlinedFun (job.c:187)
==21229== by 0x43FB92: server_child_exited (server.c:454)
==21229== by 0x43FB92: server_child_signal (server.c:427)
==21229== by 0x43FB92: server_signal_callback (server.c:397)
==21229== by 0x54A5DFA: event_base_loop (in /usr/lib64/libevent-2.0.so.5.1.9)
==21229== by 0x43CEB9: server_loop (server.c:201)
==21229== by 0x43CEB9: server_start (server.c:192)
==21229== by 0x444E32: UnknownInlinedFun (client.c:152)
==21229== by 0x444E32: UnknownInlinedFun (client.c:262)
==21229== by 0x444E32: main (tmux.c:388)
==21229==
==21229== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
Regards,
ismail
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
tmux-users mailing list
https://lists.sourceforge.net/lists/listinfo/tmux-users
İsmail Dönmez
2015-02-11 18:16:28 UTC
Permalink
Hi,

On Wed, Feb 11, 2015 at 8:11 PM, Nicholas Marriott
Fixes both Cygwin and Linux. Thank you!
Post by Nicholas Marriott
Index: cmd-queue.c
===================================================================
RCS file: /cvs/src/usr.bin/tmux/cmd-queue.c,v
retrieving revision 1.21
diff -u -p -r1.21 cmd-queue.c
--- cmd-queue.c 5 Feb 2015 10:26:29 -0000 1.21
+++ cmd-queue.c 11 Feb 2015 18:08:58 -0000
@@ -163,6 +163,7 @@ cmdq_continue(struct cmd_q *cmdq)
int empty, flags;
char s[1024];
+ cmdq->references++;
notify_disable();
empty = TAILQ_EMPTY(&cmdq->queue);
if (cmdq->client_exit > 0)
cmdq->client->flags |= CLIENT_EXIT;
if (cmdq->emptyfn != NULL)
- cmdq->emptyfn(cmdq); /* may free cmdq */
+ cmdq->emptyfn(cmdq);
empty = 1;
notify_enable();
+ cmdq_free(cmdq);
+
return (empty);
}
Post by İsmail Dönmez
Hi currently master branch seems to be crashing on me with Linux and
==21229== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
==21229==
==21229== Invalid read of size 4
==21229== at 0x40ADAB: cmd_if_shell_free (cmd-if-shell.c:184)
==21229== by 0x42A019: job_free (job.c:130)
==21229== by 0x43FB9A: UnknownInlinedFun (job.c:188)
==21229== by 0x43FB9A: server_child_exited (server.c:454)
==21229== by 0x43FB9A: server_child_signal (server.c:427)
==21229== by 0x43FB9A: server_signal_callback (server.c:397)
==21229== by 0x54A5DFA: event_base_loop (in /usr/lib64/libevent-2.0.so.5.1.9)
==21229== by 0x43CEB9: server_loop (server.c:201)
==21229== by 0x43CEB9: server_start (server.c:192)
==21229== by 0x444E32: UnknownInlinedFun (client.c:152)
==21229== by 0x444E32: UnknownInlinedFun (client.c:262)
==21229== by 0x444E32: main (tmux.c:388)
==21229== Address 0x61844fc is 28 bytes inside a block of size 32 free'd
==21229== at 0x4C2A37C: free (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==21229== by 0x4111A3: cmdq_continue (cmd-queue.c:223)
==21229== by 0x4111A3: cmdq_continue (cmd-queue.c:223)
==21229== by 0x418FAE: cmd_source_file_exec (cmd-source-file.c:74)
==21229== by 0x410F1D: cmdq_continue (cmd-queue.c:190)
==21229== by 0x40AD6F: UnknownInlinedFun (cmd-queue.c:141)
==21229== by 0x40AD6F: cmd_if_shell_callback (cmd-if-shell.c:155)
==21229== by 0x43FB92: UnknownInlinedFun (job.c:187)
==21229== by 0x43FB92: server_child_exited (server.c:454)
==21229== by 0x43FB92: server_child_signal (server.c:427)
==21229== by 0x43FB92: server_signal_callback (server.c:397)
==21229== by 0x54A5DFA: event_base_loop (in /usr/lib64/libevent-2.0.so.5.1.9)
==21229== by 0x43CEB9: server_loop (server.c:201)
==21229== by 0x43CEB9: server_start (server.c:192)
==21229== by 0x444E32: UnknownInlinedFun (client.c:152)
==21229== by 0x444E32: UnknownInlinedFun (client.c:262)
==21229== by 0x444E32: main (tmux.c:388)
==21229==
==21229==
==21229== Invalid read of size 8
==21229== at 0x410F21: cmdq_guard (cmd-queue.c:123)
==21229== by 0x410F21: cmdq_continue (cmd-queue.c:193)
==21229== by 0x40AD6F: UnknownInlinedFun (cmd-queue.c:141)
==21229== by 0x40AD6F: cmd_if_shell_callback (cmd-if-shell.c:155)
==21229== by 0x43FB92: UnknownInlinedFun (job.c:187)
==21229== by 0x43FB92: server_child_exited (server.c:454)
==21229== by 0x43FB92: server_child_signal (server.c:427)
==21229== by 0x43FB92: server_signal_callback (server.c:397)
==21229== by 0x54A5DFA: event_base_loop (in /usr/lib64/libevent-2.0.so.5.1.9)
==21229== by 0x43CEB9: server_loop (server.c:201)
==21229== by 0x43CEB9: server_start (server.c:192)
==21229== by 0x444E32: UnknownInlinedFun (client.c:152)
==21229== by 0x444E32: UnknownInlinedFun (client.c:262)
==21229== by 0x444E32: main (tmux.c:388)
==21229== Address 0x61911b8 is 8 bytes inside a block of size 104 free'd
==21229== at 0x4C2A37C: free (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==21229== by 0x40AF56: UnknownInlinedFun (cmd-queue.c:55)
==21229== by 0x40AF56: cmd_if_shell_done (cmd-if-shell.c:171)
==21229== by 0x4111A3: cmdq_continue (cmd-queue.c:223)
==21229== by 0x4111A3: cmdq_continue (cmd-queue.c:223)
==21229== by 0x418FAE: cmd_source_file_exec (cmd-source-file.c:74)
==21229== by 0x410F1D: cmdq_continue (cmd-queue.c:190)
==21229== by 0x40AD6F: UnknownInlinedFun (cmd-queue.c:141)
==21229== by 0x40AD6F: cmd_if_shell_callback (cmd-if-shell.c:155)
==21229== by 0x43FB92: UnknownInlinedFun (job.c:187)
==21229== by 0x43FB92: server_child_exited (server.c:454)
==21229== by 0x43FB92: server_child_signal (server.c:427)
==21229== by 0x43FB92: server_signal_callback (server.c:397)
==21229== by 0x54A5DFA: event_base_loop (in /usr/lib64/libevent-2.0.so.5.1.9)
==21229== by 0x43CEB9: server_loop (server.c:201)
==21229== by 0x43CEB9: server_start (server.c:192)
==21229== by 0x444E32: UnknownInlinedFun (client.c:152)
==21229== by 0x444E32: UnknownInlinedFun (client.c:262)
==21229== by 0x444E32: main (tmux.c:388)
==21229==
==21229== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
Regards,
ismail
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
tmux-users mailing list
https://lists.sourceforge.net/lists/listinfo/tmux-users
İsmail Dönmez
2015-02-12 15:44:54 UTC
Permalink
Hi,
Post by İsmail Dönmez
Hi,
On Wed, Feb 11, 2015 at 8:11 PM, Nicholas Marriott
Fixes both Cygwin and Linux. Thank you!
Do you mind pushing your fix to master?

Thanks!
Nicholas Marriott
2015-02-12 21:47:55 UTC
Permalink
Hi

It'll be there next time Thomas syncs, shouldn't be too long




-------- Original message --------
From: İsmail Dönmez <***@donmez.ws>
Date:12/02/2015 15:44 (GMT+00:00)
To: Nicholas Marriott <***@gmail.com>
Cc: tmux-users <tmux-***@lists.sourceforge.net>
Subject: Re: Master crash on Linux & cygwin

Hi,
Post by İsmail Dönmez
Hi,
On Wed, Feb 11, 2015 at 8:11 PM, Nicholas Marriott
Fixes both Cygwin and Linux. Thank you!
Do you mind pushing your fix to master?

Thanks!

Loading...