[Sheepdog] Segmentation fault

jjxiong2009 at hotmail.com jjxiong2009 at hotmail.com
Tue Mar 9 12:39:01 CET 2010


It seems that I missed the parameter of vdiname :)
the patch looks good, thank you very much.

[root at f12kvm shepherd]# ./shepherd info -t vdi
  name        id    size    used  shared    creation time  object id
--------------------------------------------------------------------
  test01.img     0  3.0 GB  0.0 MB  0.0 MB 2010-03-09 15:23      40000
[root at f12kvm shepherd]# ./shepherd info -t obj
Please specify the vdiname
[root at f12kvm shepherd]# ./shepherd info -t obj test01.img
Looking for the inode object 0x40000 with 4 nodes

192.168.10.81:7000: has the version 0 (should be 3 copies)
192.168.10.78:7000: has the version 0 (should be 3 copies)
192.168.10.80:7000: has the version 0 (should be 3 copies)
192.168.10.79:7000: has the version 0 (should be 3 copies)
[root at f12kvm shepherd]#



--------------------------------------------------
From: "MORITA Kazutaka" <morita.kazutaka at lab.ntt.co.jp>
Sent: Tuesday, March 09, 2010 7:00 PM
To: <jjxiong2009 at hotmail.com>
Cc: <sheepdog at lists.wpkg.org>
Subject: Re: [Sheepdog] Segmentation fault

> Hi,
> 
> On 2010/03/09 14:32, jjxiong2009 at hotmail.com wrote:
>> Hi, List,
>> 
>> I met a Segmentation fault error with the command './shepherd info -t obj', below the the full information,
>> is there any solution from you?
>> 
> Thanks for your report.
> Could you try the following patch?
> 
> ---
> shepherd/shepherd.c |   12 ++++++++++--
> 1 files changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/shepherd/shepherd.c b/shepherd/shepherd.c
> index 78037ed..db28f77 100644
> --- a/shepherd/shepherd.c
> +++ b/shepherd/shepherd.c
> @@ -682,9 +682,9 @@ static void get_oid(uint64_t oid, char *name, uint32_t tag,
>  struct get_oid_info *info = data;
>  char *p;
> 
> - p = strchr(info->name, ':');
> -
>  if (info->name) {
> + p = strchr(info->name, ':');
> +
>  if (p) {
>  if (!strncmp(name, info->name, p - info->name) &&
>      tag == strtoul(p + 1, NULL, 16))
> @@ -806,6 +806,10 @@ static void print_obj(char *vdiname, unsigned index)
>  ret = parse_vdi(get_oid, &info);
> 
>  oid = info.oid;
> + if (oid == 0) {
> + printf("No such vdi\n");
> + return;
> + }
> 
>  if (index == ~0) {
>  printf("Looking for the inode object 0x%" PRIx64 " with %d nodes\n\n",
> @@ -956,6 +960,10 @@ rerun:
>  ret = 0;
>  break;
>  case INFO_OBJ:
> + if (!name) {
> + printf("Please specify the vdiname\n");
> + break;
> + }
>  print_obj(name, index);
>  ret = 0;
>  break;
> -- 
> 1.5.6.5
> 


More information about the sheepdog mailing list