* Re: mdadm segfault at assemble
[not found] <201202150854.32303.arekm@maven.pl>
@ 2012-02-16 3:12 ` NeilBrown
0 siblings, 0 replies; only message in thread
From: NeilBrown @ 2012-02-16 3:12 UTC (permalink / raw)
To: Arkadiusz Miśkiewicz; +Cc: linux-raid
[-- Attachment #1: Type: text/plain, Size: 1962 bytes --]
On Wed, 15 Feb 2012 08:54:32 +0100 Arkadiusz Miśkiewicz <arekm@maven.pl>
wrote:
>
> Hi,
>
> mapfile.c:434
>
> struct mddev_ident *match = conf_match(st, info, NULL, 0, NULL);
>
> so devname is NULL and that's passed down to fnmatch in match_oneof causing
> segfault.
>
> Looked at git and it seems to be the same as in mine 3.2.3 version.
>
> Starting program: /sbin/mdadm --assemble --scan --auto=yes
>
> Program received signal SIGSEGV, Segmentation fault.
> 0xb7ef9f15 in fnmatch () from /lib/libc.so.6
> (gdb) bt
> #0 0xb7ef9f15 in fnmatch () from /lib/libc.so.6
> #1 0x08051caf in match_oneof (devices=0x80dea79 ",/dev/sdb3", devname=0x0) at
> config.c:958
> #2 0x08052051 in conf_match (st=0x80def50, info=0x80e11b8, devname=0x0,
> verbose=0, rvp=0x0) at config.c:1049
> #3 0x080a8e0c in RebuildMap () at mapfile.c:434
> #4 0x080a865b in map_read (melp=0xbffff8a4) at mapfile.c:201
> #5 0x080a8526 in map_lock (melp=0xbffff8a4) at mapfile.c:145
> #6 0x0804e0f6 in main (argc=4, argv=0xbffffc54) at mdadm.c:1320
>
Thanks for the report.
This should fix it.
NeilBrown
commit 9f1b0f0f1ed0dd4752be65348a24971335cd50e8
Author: NeilBrown <neilb@suse.de>
Date: Thu Feb 16 14:11:57 2012 +1100
config: conf_match should ignore devname when not set.
mapfile:RebuildMap calls conf_match with no devname, so we must be
careful not to use it.
Reported-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
Signed-off-by: NeilBrown <neilb@suse.de>
diff --git a/config.c b/config.c
index 6027b2f..d8f48e1 100644
--- a/config.c
+++ b/config.c
@@ -1045,7 +1045,7 @@ struct mddev_ident *conf_match(struct supertype *st,
array_list->devname);
continue;
}
- if (array_list->devices &&
+ if (array_list->devices && devname &&
!match_oneof(array_list->devices, devname)) {
if (verbose >= 2 && array_list->devname)
fprintf(stderr, Name
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-02-16 3:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <201202150854.32303.arekm@maven.pl>
2012-02-16 3:12 ` mdadm segfault at assemble NeilBrown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).