Bug 146514 - mdadm --assemble core dumps on uuid
Summary: mdadm --assemble core dumps on uuid
Status: RESOLVED FIXED
: 147376 148240 148617 150210 (view as bug list)
Alias: None
Product: SUSE Linux 10.1
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Beta 2
Hardware: All Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Marian Jancar
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-29 16:29 UTC by Greg Edwards
Modified: 2006-02-16 06:16 UTC (History)
4 users (show)

See Also:
Found By: Third Party Developer/Partner
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
fix update test (710 bytes, patch)
2006-01-29 16:31 UTC, Greg Edwards
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Edwards 2006-01-29 16:29:25 UTC
I have the following two disk raid0 md device:

# cat /etc/mdadm.conf
DEVICE /dev/sdc1 /dev/sdd1
ARRAY /dev/md0 level=raid0 UUID=e8a209ab:4e9060be:702493b4:04034197

I converted over to mdadm yesterday from raidtools when I upgraded to 10.1 beta2,
and raidtools was dropped.  It wasn't starting up the device on bootup, and
after poking around I noticed mdadm --assemble was core dumping.

root@fairseas mdadm-2.2 # ./mdadm --assemble --scan
Segmentation fault (core dumped)
root@fairseas mdadm-2.2 # file core
core: ELF 32-bit LSB core file Intel 80386, version 1 (SYSV), SVR4-style
root@fairseas mdadm-2.2 # gdb mdadm core
GNU gdb 6.4
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i586-suse-linux"...Using host libthread_db library "/lib/libthread_db.so.1".

Core was generated by `./mdadm --assemble --scan'.
Program terminated with signal 11, Segmentation fault.

warning: Can't read pathname for load map: Input/output error.
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
#0  0x08051d56 in Assemble (st=0x0, mddev=0x806a1c8 "/dev/md0", mdfd=3, ident=0x806a1f0,
    conffile=0x0, devlist=0x806a018, readonly=0, runstop=0, update=0x0, verbose=0, force=0)
    at Assemble.c:222
222                     if (ident->uuid_set && (!update && strcmp(update, "uuid")!= 0) &&
(gdb) where
#0  0x08051d56 in Assemble (st=0x0, mddev=0x806a1c8 "/dev/md0", mdfd=3, ident=0x806a1f0,
    conffile=0x0, devlist=0x806a018, readonly=0, runstop=0, update=0x0, verbose=0, force=0)
    at Assemble.c:222
#1  0x0804c74c in main (argc=3, argv=0xbfe49154) at mdadm.c:966
(gdb) list
217                     } else {
218                             tst->ss->getinfo_super(&info, &ident2, super);
219                     }
220                     if (dfd >= 0) close(dfd);
221
222                     if (ident->uuid_set && (!update && strcmp(update, "uuid")!= 0) &&
223                         (!super || same_uuid(info.uuid, ident->uuid, tst->ss->swapuuid)==0)) {224                             if ((inargv && verbose >= 0) || verbose > 0)
225                                     fprintf(stderr, Name ": %s has wrong uuid.\n",
226                                             devname);
(gdb) whatis ident
type = mddev_ident_t
(gdb) p ident.uuid_set
$5 = 1
(gdb) p update
$6 = 0x0

Looks like the test should be (update && strcmp(update, "uuid")!= 0) instead.
Attached patch fixes it for me.
Comment 1 Greg Edwards 2006-01-29 16:31:26 UTC
Created attachment 65557 [details]
fix update test
Comment 2 Greg Edwards 2006-01-30 15:19:10 UTC
As an aside, what provides the functionality of boot.md in the raidtool
package now?  There doesn't seem to be anything to start up the md's before
boot.localfs runs.

I ended up just adding a 'mdadm --assemble /dev/md0' to the beginning of the 
boot.localfs script.
Comment 3 Neil Brown 2006-02-02 02:53:49 UTC
Correct fix is
   (!update || strcmp(update, "uuid") != 0)

i.e. change the '&&' to '||'

Comment 4 Marian Jancar 2006-02-02 11:16:25 UTC
*** Bug 147376 has been marked as a duplicate of this bug. ***
Comment 5 Marian Jancar 2006-02-05 11:47:17 UTC
*** Bug 148234 has been marked as a duplicate of this bug. ***
Comment 6 Marian Jancar 2006-02-05 11:56:54 UTC
the segault is fixed, bug #148234 is for the initscript
Comment 7 Marian Jancar 2006-02-06 12:34:55 UTC
*** Bug 148240 has been marked as a duplicate of this bug. ***
Comment 8 Marian Jancar 2006-02-07 11:17:27 UTC
*** Bug 148617 has been marked as a duplicate of this bug. ***
Comment 9 Neil Brown 2006-02-16 06:16:23 UTC
*** Bug 150210 has been marked as a duplicate of this bug. ***