Bugzilla – Bug 146514
mdadm --assemble core dumps on uuid
Last modified: 2006-02-16 06:16:23 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.
Created attachment 65557 [details] fix update test
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.
Correct fix is (!update || strcmp(update, "uuid") != 0) i.e. change the '&&' to '||'
*** Bug 147376 has been marked as a duplicate of this bug. ***
*** Bug 148234 has been marked as a duplicate of this bug. ***
the segault is fixed, bug #148234 is for the initscript
*** Bug 148240 has been marked as a duplicate of this bug. ***
*** Bug 148617 has been marked as a duplicate of this bug. ***
*** Bug 150210 has been marked as a duplicate of this bug. ***