From: "Stoermeldung Infrastruktur-Ukr" <Stoermeldung.Infrastruktur-Ukr@rz.uni-regensburg.de>
To: "linux-mm@kvack.org" <linux-mm@kvack.org>
Cc: Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>,
linux-kernel@vger.kernel.org
Subject: Q: si_code for SIGBUS caused by mmap() write error
Date: Mon, 08 May 2017 11:27:37 +0200 [thread overview]
Message-ID: <59103A09020000D3000127FA@gwsmtp1.uni-regensburg.de> (raw)
In-Reply-To: <59103A09020000D3000127FA@gwsmtp1.uni-regensburg.de>
[-- Attachment #1.1: Type: text/plain, Size: 1024 bytes --]
Hi!
I observed this for 3.0.101-97 kernel (SLES11 SP4, x86_64): When a mmap()ed file has a write error (e.g. bad sector), the program is terminated with SIGBUS. Trying to handle the situation, I noticed that the error code in siginfo is 2 (BUS_ADRERR, nonexistent physical address). My expectation was that the error would be 3 (BUS_OBJERR, object-specific hardware error).
For debugging I created this dummy device with a bad block:
DEV=bad_disk
dmsetup create "$DEV" <<EOF
0 8 zero
8 1 error
9 255 zero
EOF
The kernel error logged is " kernel: [2932614.419355] Buffer I/O error on device dm-8, logical block 1"
Is my expectation on the si_code wrong, or is the implementation wrong?
At a quick glance at do_sigbus() of /usr/src/linux/arch/x86/mm/fault.c I see that only codes BUS_ADRERR (default) and BUS_MCEERR_AR are used. However I don't know whether I looked at the correct source.
(The code in 4.4.62 still looks similar)
Regards,
Ulrich Windl
P.S: Keep me on CC: in your replies, please!
[-- Attachment #1.2: HTML --]
[-- Type: text/html, Size: 1653 bytes --]
next parent reply other threads:[~2017-05-08 9:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-08 9:27 Stoermeldung Infrastruktur-Ukr [this message]
2017-05-08 13:09 ` Antw: " Ulrich Windl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=59103A09020000D3000127FA@gwsmtp1.uni-regensburg.de \
--to=stoermeldung.infrastruktur-ukr@rz.uni-regensburg.de \
--cc=Ulrich.Windl@rz.uni-regensburg.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox