Bug 1729070

Summary: Unable to mmap trace file dump.blktrace.0, err Invalid argument
Product: Red Hat Enterprise Linux 8 Reporter: Karel Srot <ksrot>
Component: blktraceAssignee: Eric Sandeen <esandeen>
Status: CLOSED UPSTREAM QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: low Docs Contact:
Priority: unspecified    
Version: 8.0CC: esandeen
Target Milestone: rc   
Target Release: 8.0   
Hardware: aarch64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-09-23 19:25:13 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: 1746605    

Description Karel Srot 2019-07-11 10:50:35 UTC
Description of problem:

on aarch64 and s390x I am getting following error:

# blktrace -d /dev/mapper/rhel_apm--mustang--b0--10-root -o dump &
# dd if=/dev/zero of=foo bs=1K count=1
# kill -s SIGINT $!
# ls
dump.blktrace.0  dump.blktrace.2  dump.blktrace.4  dump.blktrace.6  
dump.blktrace.1  dump.blktrace.3  dump.blktrace.5  dump.blktrace.7
# iowatcher -t dump.blktrace.0 -o movie.ogg  --movie=rect Using movie style: rect
Unable to mmap trace file dump.blktrace.0, err Invalid argument

on x86_64 and ppc64le it works.

Version-Release number of selected component (if applicable):
blktrace-1.2.0-10.el8.aarch64

How reproducible:
always, see instractions above

Comment 2 Eric Sandeen 2019-07-11 17:12:12 UTC
A quick try here didn't reproduce it.

Can you do:

# ls -l dump.blktrace.*
and also strace the iowatcher process (probably with -e open -e mmap) ?

Thanks
-Eric

Comment 3 Eric Sandeen 2019-07-11 18:10:30 UTC
OK, I bet your dump.blktrace.0 is zero bytes.

# iowatcher -t dump.blktrace.1 -o movie.ogg  --movie=rect
Using movie style: rect
Unable to mmap trace file dump.blktrace.1, err Invalid argument
# ls -l dump.blktrace.1
-rw-r--r--. 1 root root 0 Jul 11 13:11 dump.blktrace.1

Agreed that a nicer error would be nicer, but this comes from trying to mmap a zero-length file.

This would be the normal way I'd invoke it:

# iowatcher -t dump -o movie.ogg  --movie=rect
Using movie style: rect
Start blkparse -O -d dump.dump -i dump.blktrace.0
Input file dump.blktrace.0 added
Input file dump.blktrace.3 added
Input file dump.blktrace.6 added
Input file dump.blktrace.7 added
Exit (0): blkparse
Converting svg files in io-movie-eE2lDR
...

setup_file() skips zero-length files:

        if (stat(pci->fname, &st) < 0)
                return 0;
        if (!st.st_size)
                return 1;

-Eric

Comment 4 Karel Srot 2019-07-12 07:35:35 UTC
You are right of course, I didn't give blktrace enough time to start before terminating it in the test. Fixing it now. Would you like to keep the bug open for tracking the error message improvement?

Comment 6 Eric Sandeen 2019-08-20 16:20:52 UTC
I sent a patch upstream to make the error more clear.

# iowatcher -t dump.blktrace.1 -o movie.ogg  --movie=rect
Using movie style: rect
skipping zero-length file dump.blktrace.1
#

Honestly it doesn't matter much to me whether we get that included for RHEL8,
or just fix it upstream and close this bug.

Comment 7 Eric Sandeen 2019-09-23 19:25:13 UTC
I don't think this issue is probably severe enough to warrant a respin and new package version in RHEL.