All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"lirans@il.ibm.com" <lirans@il.ibm.com>,
	Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] Re: [STAGING]: Block migration segfaults
Date: Thu, 03 Dec 2009 13:44:09 -0600	[thread overview]
Message-ID: <4B181509.3030705@codemonkey.ws> (raw)
In-Reply-To: <4B18051F.4040207@siemens.com>

Jan Kiszka wrote:
> Luiz Capitulino wrote:
>   
>>  Hi there,
>>
>>  Got this while testing block migration in staging:
>>
>> """
>> Program terminated with signal 11, Segmentation fault.
>> #0  0x0000000000410cf9 in monitor_vprintf (mon=0x0, fmt=0x5ae5e7 "Start full migration for %s\n",
>> ap=0x7fff1f830a40) at /home/lcapitulino/src/aliguori-queue/monitor.c:192
>> 192         if (mon->mc && !mon->mc->print_enabled) {
>> """
>>
>>  The problem here is that init_blk_migration() calls monitor_printf() with
>> a NULL 'mon' and the backtrace shows that this is true for the entire call
>> chain.
>>     
>
> What is the backtrace? And how did you start the migration?
>
>   
>>  You probably didn't note it before because the lowest-level monitor
>> print function would just return if the 'mon' parameter was NULL.
>>     
>
> I was aware that mon might be NULL, but the existing code handled this
> gracefully.
>
>   
>>  A patch from me (4a29a in staging) changes a higher level monitor
>> function to touch 'mon' before passing it down and here's the segfault.
>>
>>  Now, the point is: I could give the old behavior back but I think we're
>> hiding a bug there. Why would you call monitor_printf() with a NULL 'mon'?
>>     
>
> If there is no monitor associated with the current context, it can be
> NULL. This is mostly the case during early startup. One may also use
> this to suppress output (though I don't recall any real case ATM).
>   

I'm a bit concerned with this explanation as there is no reason 
something should be printing to the monitor unless it's in response to a 
monitor command.  I'd like to see the full call chain to see what's 
happening too.

>>  Anyways, the following patch adds the old behavior back just in case
>> you want to see it working...
>>     
>
> Yes, better restore the check. Still, your call stack would be
> interesting. Maybe there is actual another bug behind it.
>   

I think we should have an assert in this path because mon==NULL is 
definitely wrong.

Regards,

Anthony Liguori

      parent reply	other threads:[~2009-12-03 19:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-03 18:21 [Qemu-devel] [STAGING]: Block migration segfaults Luiz Capitulino
2009-12-03 18:36 ` [Qemu-devel] " Jan Kiszka
2009-12-03 18:59   ` Luiz Capitulino
2009-12-03 19:10     ` Jan Kiszka
2009-12-03 19:47       ` Anthony Liguori
2009-12-03 19:44   ` Anthony Liguori [this message]

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=4B181509.3030705@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=jan.kiszka@siemens.com \
    --cc=lcapitulino@redhat.com \
    --cc=lirans@il.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /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.