[Crash-utility] Problem with crash-7.2.6 and certain print commands?

Moore, Martin (CSC Americas (Linux RTCC)) martin.moore at hpe.com
Wed May 15 20:20:24 UTC 2019


As a workaround, you can put the argument inside another pair of parentheses.  I see this:

A failure similar to yours:

crash64> pd ((struct seq_file *) 0xffff88013c717400)->size
p: invalid option -- '>'
p: invalid option -- 's'
p: invalid option -- 'i'
p: invalid option -- 'z'
p: invalid option -- 'e'
Usage:
  p [-x|-d][-u] [expression | symbol[:cpuspec]]
Enter "help p" for details.

Adding another pair of parens works:

crash64> pd (((struct seq_file *) 0xffff88013c717400)->size)
$4 = 4096

But as Dave A. said, this syntax is even easier:

crash64> seq_file.size 0xffff88013c717400
  size = 4096

Martin Moore
Linux/Tru64 RTCC Engineer
CSC Americas
HPE Technology Services
Hewlett Packard Enterprise

Martin.Moore at hpe.com 
8AM-5PM EDT (GMT-4) Monday-Friday
Manager: Karl Bryant (Karl.Bryant at hpe.com)


-----Original Message-----
From: crash-utility-bounces at redhat.com [mailto:crash-utility-bounces at redhat.com] On Behalf Of Dave Wysochanski
Sent: Wednesday, May 15, 2019 3:36 PM
To: Discussion list for crash utility usage, maintenance and development <crash-utility at redhat.com>
Subject: Re: [Crash-utility] Problem with crash-7.2.6 and certain print commands?

Ok no worries have a nice vacation.

I'll see if I can track it down - getting closer.



On Wed, 2019-05-15 at 14:38 -0400, anderson wrote:
> I'm on vacation until next Tuesday, but it's certainly easier to just
> enter:
> 
>   zone.min_slab_pages <address>
> 
> I can't see what's going on with the p command, but I'll take a look
> next week.
> 
> Dave
> 
> 
> 
> Sent from my Verizon, Samsung Galaxy smartphone
> 
> -------- Original message --------
> From: Dave Wysochanski <dwysocha at redhat.com>
> Date: 5/15/19 12:40 PM (GMT-05:00)
> To: "Discussion list for crash utility usage, maintenance and
> development" <crash-utility at redhat.com>
> Subject: [Crash-utility] Problem with crash-7.2.6 and certain print
> commands?
> 
> We rebuilt crash with the tarball from:
> http://people.redhat.com/anderson/crash-7.2.6.tar.gz
> 
> I thought initially something had gone wrong with the tarball, so I
> redownloaded it myself and did an md5sum.  This checked out ok.  I
> 
> We had a report that the print command was broken, specifically this
> failed:
> 
> crash> pd ((struct zone *)0xffff901e3ffda000)->min_slab_pages
> p: invalid option -- '>'
> p: invalid option -- 'm'
> p: invalid option -- 'i'
> p: invalid option -- 'n'
> p: invalid option -- '_'
> p: invalid option -- 's'
> p: invalid option -- 'l'
> p: invalid option -- 'a'
> p: invalid option -- 'b'
> p: invalid option -- '_'
> p: invalid option -- 'p'
> p: invalid option -- 'a'
> p: invalid option -- 'g'
> p: invalid option -- 'e'
> p: invalid option -- 's'
> Usage:
>   p [-x|-d][-u] [expression | symbol[:cpuspec]]
> Enter "help p" for details.
> 
> 
> 
> We thought we didn't have this commit:
> 
> commit 977c3a20a053eaff5b1f0c95246f88cd66712f27
> Author: Dave Anderson <anderson at redhat.com>
> Date:   Thu Jan 24 13:36:02 2019 -0500
> 
>     Fix for the "p" command if the expression contains more than one
>     opening parenthesis character and a minus/dash sign.  Without the
>     patch, the minus/dash sign will get dropped from the command
> prior
>     to it being passed on to gdb for evaluation, and the command will
>     fail with the message "p: gdb request failed: <expression>",
>     where the <expression> string will not contain the minus/dash
> sign.
>     (anderson at redhat.com)
> 
> diff --git a/symbols.c b/symbols.c
> index 5f77e27..6814723 100644
> --- a/symbols.c
> +++ b/symbols.c
> @@ -1,8 +1,8 @@
> /* symbols.c - core analysis suite
>   *
>   * Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc.
> - * Copyright (C) 2002-2018 David Anderson
> - * Copyright (C) 2002-2018 Red Hat, Inc. All rights reserved.
> + * Copyright (C) 2002-2019 David Anderson
> + * Copyright (C) 2002-2019 Red Hat, Inc. All rights reserved.
>   *
>   * This program is free software; you can redistribute it and/or
> modify
>   * it under the terms of the GNU General Public License as published
> by
> @@ -7201,7 +7201,7 @@ cmd_p(void)
>                         *(cpuspec-1) = ':';
>         }
> 
> -       process_gdb_output(concat_args(buf1, 0, TRUE), radix,
> +       process_gdb_output(concat_args(buf1, 0, FALSE), radix,
>                            sp ? sp->name : NULL,
> do_load_module_filter);
> }
> 
> 
> 
> But this was reverted again in:
> 
> commit e082c372c7f1a782b058ec359dfbbbee0f0b6aad
> Author: Dave Anderson <anderson at redhat.com>
> Date:   Thu Jan 31 12:08:43 2019 -0500
> 
>     Fix for the internal parse_line() utility function to account for
>     embedded sets of parentheses, which may be used for expressions
> that
>     are passed to gdb by the "p" command.  Without the patch,
> expressions
>     containing embedded sets of parentheses are broken up into
> multiple
>     argument tokens instead of just one.  The previous commit has
> been
>     reverted by this one.
>     (anderson at redhat.com)
> 
> diff --git a/symbols.c b/symbols.c
> index 6814723..e73e735 100644
> --- a/symbols.c
> +++ b/symbols.c
> @@ -7201,7 +7201,7 @@ cmd_p(void)
>                         *(cpuspec-1) = ':';
>         }
> 
> -       process_gdb_output(concat_args(buf1, 0, FALSE), radix,
> +       process_gdb_output(concat_args(buf1, 0, TRUE), radix,
>                            sp ? sp->name : NULL,
> do_load_module_filter);
> }
> 
> 
> --
> Crash-utility mailing list
> Crash-utility at redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility
> 
> --
> Crash-utility mailing list
> Crash-utility at redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility


--
Crash-utility mailing list
Crash-utility at redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility




More information about the Crash-utility mailing list