RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1250035 - xfs_logprint -c coredumps
Summary: xfs_logprint -c coredumps
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: xfsprogs
Version: 7.1
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Eric Sandeen
QA Contact: Filesystem QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-04 11:57 UTC by Pavel Moravec
Modified: 2021-09-09 11:40 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-05-08 16:07:24 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
abrt report with the coredump (38.64 KB, application/x-xz)
2015-08-04 11:58 UTC, Pavel Moravec
no flags Details
compressed copy of the log (936.06 KB, application/x-bzip)
2015-08-04 17:43 UTC, Eric Sandeen
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3560241 0 None None None 2018-08-10 15:32:38 UTC

Description Pavel Moravec 2015-08-04 11:57:39 UTC
Description of problem:
Having quite fresh installation of RHEL7.1, "xfs_logprint -c /dev/mapper/rhel-root" coredumps. Running it without "-c" does not coredump.

Running the same command on other RHEL7 machines, no coredump seen.

Attaching abrt report and to provide access to the reproducer machine.


Version-Release number of selected component (if applicable):
xfsprogs-3.2.1-6.el7.x86_64


How reproducible:
??? (100% on the machine I have)


Steps to Reproduce:
1. ???
2. xfs_logprint -c /dev/mapper/rhel-root


Actual results:
xfs_logprint coredumps


Expected results:
No coredump


Additional info:

Comment 1 Pavel Moravec 2015-08-04 11:58:00 UTC
Created attachment 1059053 [details]
abrt report with the coredump

Comment 3 Eric Sandeen 2015-08-04 17:34:09 UTC
Asking logprint to parse the log on a still-mounted filesystem is fairly unusual, though we still shouldn't coredump.  I'm curious, what prompted you to point xfs_logprint at the mounted root filesystem?

-Eric

Comment 4 Eric Sandeen 2015-08-04 17:37:33 UTC
Note, the first thing logprint says is:

# xfs_logprint -c /dev/mapper/rhel-root
xfs_logprint: /dev/mapper/rhel-root contains a mounted and writable filesystem
...

I'm a little surprised we even proceed after that.

Comment 5 Eric Sandeen 2015-08-04 17:43:35 UTC
Created attachment 1059193 [details]
compressed copy of the log

xfs_logprint -c -f logfile seems to fail in the same way, for this copy of the log.

Comment 6 Pavel Moravec 2015-08-05 11:08:52 UTC
(In reply to Eric Sandeen from comment #3)
> Asking logprint to parse the log on a still-mounted filesystem is fairly
> unusual, though we still shouldn't coredump.  I'm curious, what prompted you
> to point xfs_logprint at the mounted root filesystem?
> 
> -Eric

sosreport :) See /usr/lib/python2.7/site-packages/sos/plugins/xfs.py, when enabling logprint option.

The easiest way of reproducing it via sosreport:

sosreport -o xfs -e xfs -a --batch -v
..
[plugin:xfs] collecting output of 'xfs_logprint -c /dev/mapper/rhel-root'
[plugin:xfs] collecting output of 'xfs_logprint -c /dev/vda1'
..

(-a means enabling all plugin options).


I don't know how often / meaningful / useful this option is, though.

Comment 7 Eric Sandeen 2015-08-05 15:54:31 UTC
Yeah, that's not a useful thing for sosreport to do.... Any idea why it was added?

Comment 8 Eric Sandeen 2015-08-05 19:33:09 UTC
So, while I'll look at logprint, I think this highlights a more important issue - we need to make the xfs plugin collect useful information.  Logprint is almost never going to be relevant, especially when the fs is mounted.  It's also going to produce potentially very large files.  I'd drop it from sos.

xfs-specific information which *would* be useful is things like:

* xfsprogs version (xfs_repair -V) (I suppose we have this already from rpm data?)
* xfs_info output for all filesystems
* xfs mount options (probably gathered already?)
* xfs_stats output /proc/fs/xfs/stat & /proc/fs/xfs/xqmstat

-Eric

Comment 9 Pavel Moravec 2015-08-10 07:26:25 UTC
(In reply to Eric Sandeen from comment #8)
> So, while I'll look at logprint, I think this highlights a more important
> issue - we need to make the xfs plugin collect useful information.  Logprint
> is almost never going to be relevant, especially when the fs is mounted. 
> It's also going to produce potentially very large files.  I'd drop it from
> sos.
> 
> xfs-specific information which *would* be useful is things like:
> 
> * xfsprogs version (xfs_repair -V) (I suppose we have this already from rpm
> data?)
> * xfs_info output for all filesystems
> * xfs mount options (probably gathered already?)
> * xfs_stats output /proc/fs/xfs/stat & /proc/fs/xfs/xqmstat
> 
> -Eric

Makes sense, I raised https://github.com/sosreport/sos/issues/621 and will propose a patch for sosreport, once the discussion there will settle down the desired final state. Thanks for input.

Comment 11 Eric Sandeen 2016-06-27 21:59:45 UTC
In logprint we do this, around line 754 of log_print.c:

            *ptr += be32_to_cpu(op_head->oh_len);
            if (op_head->oh_flags & XLOG_CONTINUE_TRANS)
                return 1;
            op_head = (xlog_op_header_t *)*ptr;

and in this case, oh_len seems invalid; with debugging:

op_head->oh_flags 0x0 oh_len 0x34000000

so we move the op_head pointer to invalid memory.  I'm not sure offhand what sanity testing we can put on that value in this case...

Comment 12 Eric Sandeen 2018-05-08 16:07:24 UTC
logprint is a semi-fragile debug-only tool.  We're more tolerant of failure, tbh, as it's not generally customer- or user-facing.  As such I'm closing this WONTFIX, and we should probably remove its use from sosreport.


Note You need to log in before you can comment on or make changes to this bug.