All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@gnu.org>
To: Brian Candler <b.candler@pobox.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>,
	qemu-devel@nongnu.org, Jan Kiszka <jan.kiszka@siemens.com>
Subject: Re: [Qemu-devel] Crashing in tcp_close
Date: Fri, 11 Nov 2016 23:09:11 +0100	[thread overview]
Message-ID: <20161111220911.GC2417@var.home> (raw)
In-Reply-To: <d0abe16e-4a34-50b5-8298-eb798276b602@pobox.com>

[-- Attachment #1: Type: text/plain, Size: 819 bytes --]

Brian Candler, on Fri 11 Nov 2016 20:53:12 +0000, wrote:
> On 11/11/2016 16:17, Samuel Thibault wrote:
> >Could you increase the value given to valgrind's --num-callers= so we
> >can make sure the context of this call?
> 
> OK: re-run with --num-callers=250. It took a few iterations, but I captured
> it again. (I have grepped out all the "invalid file descriptor" lines).

Thanks!

> ==1217== Thread 1:
> ==1217== Invalid read of size 4
> ==1217==    at 0x550B5B: if_start (if.c:230)
> ==1217==    by 0x5550E2: slirp_pollfds_poll (slirp.c:770)
> ==1217==    by 0x5891EB: main_loop_wait (main-loop.c:508)
> ==1217==    by 0x2F4430: main_loop (vl.c:1908)
> ==1217==    by 0x2F4430: main (vl.c:4604)

Ooh, I see.  Now it's obvious, now that it's not coming from the tcb
loop :) Could you try the attached patch?

Samuel

[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 415 bytes --]

diff --git a/slirp/socket.c b/slirp/socket.c
index 280050a..1a50d30 100644
--- a/slirp/socket.c
+++ b/slirp/socket.c
@@ -66,6 +66,13 @@ void
 sofree(struct socket *so)
 {
   Slirp *slirp = so->slirp;
+  struct mbuf *ifm;
+
+  for (ifm = slirp->next_m; ifm; ifm = ifm->ifq_next) {
+    if (ifm->ifq_so == so) {
+      ifm->ifq_so = NULL;
+    }
+  }
 
   if (so->so_emu==EMU_RSH && so->extra) {
 	sofree(so->extra);

  reply	other threads:[~2016-11-11 22:09 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-20 21:53 [Qemu-devel] Crashing in tcp_close Brian Candler
2016-11-04 11:14 ` Stefan Hajnoczi
2016-11-06 18:04   ` Samuel Thibault
2016-11-07  8:42     ` Brian Candler
2016-11-07  9:33       ` Brian Candler
2016-11-07 10:42       ` Stefan Hajnoczi
2016-11-07 11:09         ` Brian Candler
2016-11-07 13:57           ` Stefan Hajnoczi
2016-11-07 20:52           ` Brian Candler
2016-11-08 16:03             ` Stefan Hajnoczi
2016-11-08 17:31             ` Brian Candler
2016-11-08 21:22         ` Brian Candler
2016-11-09 11:27           ` Stefan Hajnoczi
2016-11-11 15:02             ` Brian Candler
2016-11-11 16:02               ` Brian Candler
2016-11-11 16:17                 ` Samuel Thibault
2016-11-11 20:53                   ` Brian Candler
2016-11-11 22:09                     ` Samuel Thibault [this message]
2016-11-12  9:33                       ` Brian Candler
2016-11-12  9:54                         ` Brian Candler
2016-11-12 10:44                         ` Samuel Thibault
2016-11-13 11:55                           ` Brian Candler
2016-11-14 13:47                             ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161111220911.GC2417@var.home \
    --to=samuel.thibault@gnu.org \
    --cc=b.candler@pobox.com \
    --cc=jan.kiszka@siemens.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.