Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1723638

Summary: Profile and speed up 'search -k' where possible for common vmcore types
Product: Red Hat Enterprise Linux 8 Reporter: Dave Young <ruyang>
Component: crashAssignee: Dave Wysochanski <dwysocha>
Status: CLOSED WONTFIX QA Contact: Emma Wu <xiawu>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.2CC: cye, dwysocha, fsorenso, ghalat, ruyang, xiawu
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1596305 Environment:
Last Closed: 2021-01-06 11:39:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1674330    

Comment 2 Dave Wysochanski 2019-08-06 15:01:14 UTC
Side but related topic.  While the existing search command is very powerful and covers A LOT of cases, it looks like search is fundamentally unreliable especially if you are not really careful to know how it works.  For example, you need to know the alignment ahead of time for any given search pattern or search fails.  In short, it does not look like 'search' really finds a pattern reliably in memory in all cases and it's easy to use it incorrectly.

In practice, I am not sure how much people know this or it is a problem.  But to me it seems like there's room for improvement beyond just speeding up search.

Here are a few examples:
crash> 
crash> rd -8 ffff88ee18eebde0 96
ffff88ee18eebde0:  30 21 19 81 ff ff ff 00 80 f7 00 f2 f4 88 ff ff   0!..............
ffff88ee18eebdf0:  a8 da 90 a4 7e 88 ff ff 25 fe ff ff 00 00 00 00   ....~...%.......
ffff88ee18eebe00:  00 d0 ff 2b 3c 7f 00 00 ff cf ff 2b 3c 7f 00 00   ...+<......+<...
ffff88ee18eebe10:  a8 ed 3a 59 01 ea ff ff 00 00 00 00 00 00 00 00   ..:Y............
ffff88ee18eebe20:  90 96 a9 3b 00 ea ff ff 60 f0 32 28 00 88 ff ff   ...;....`.2(....
ffff88ee18eebe30:  00 d0 ff 2b 00 00 00 00 00 d0 ff 2b 3c 7f 00 00   ...+.......+<...

Here I would expect it would find '0xffff' but it does not:
crash> search -s 0xffff88ee18eebde0 -e 0xffff88ee18eebe40 0xffff

You need to specify the length or a mask.  Technically, a more thorough output would show 0xe5 as well as 0xe4 address since both match (alignment issue though)
crash> search -s 0xffff88ee18eebde0 -e 0xffff88ee18eebe40 -h 0xffff
ffff88ee18eebde4: ffff 
ffff88ee18eebdee: ffff 
ffff88ee18eebdf6: ffff 
ffff88ee18eebdfa: ffff 
ffff88ee18eebe16: ffff 
ffff88ee18eebe26: ffff 
ffff88ee18eebe2e: ffff 

I'm more concerned about cases like this, where if the bytes are misaligned (and you don't know it ahead of time or don't want to assume alignment) search does not work at all:
crash> search -s 0xffff88ee18eebde0 -e 0xffff88ee18eebe40 -h 0x2b3c
crash> search -s 0xffff88ee18eebde0 -e 0xffff88ee18eebe40 -h 0x3c2b
crash> 

To find that you have to use masks and if you don't want to assume alignment, use multiple searches which will be very expensive.
crash> search -s 0xffff88ee18eebde0 -e 0xffff88ee18eebe40 0x0000003c2b000000 -m 0xffffff0000ffffff
ffff88ee18eebe00: 7f3c2bffd000 
ffff88ee18eebe08: 7f3c2bffcfff 
ffff88ee18eebe38: 7f3c2bffd000 

Not sure how important this is in practice since most of the time my guess is we do know alignment.  However I know I've seen pointers written misaligned, scribbling over one byte of memory.  I suppose those are fairly obvious though so maybe not relevant to search.

I'll see if I can get some other opinions on this - how well know limitations are and whether people think these are an issue or not, or if just speed is the issue.
The good news is many algorithms should also take care of this limitation, though I'm not sure how important it is to tackle and there's often many ways to improve performance.

Comment 10 Dave Wysochanski 2019-12-04 20:30:18 UTC
I didn't get any time to look at this for 8.2.  Hope springs eternal, at least for 8.3, after which it may not.  ;-)