Hi guys, first of all, thanks for the patches. Sadly both patches doesn't work for me. Maybe I do something wrong. @Philip See below my steps and output. It's the same behaviour as before. @Heinz, your patch brings me to an error: *** glibc detected *** dmraid: free(): invalid next size (normal): 0x080714a0 *** ======= Backtrace: ========= /lib/libc.so.6[0xb7e5b34a] /lib/libc.so.6(cfree+0x7a)[0xb7e5cf44] dmraid(_dbg_free+0x1d)[0x8054b7d] dmraid(read_raid_dev+0x8d)[0x805116d] dmraid[0x805c9dd] dmraid[0x8052ed2] dmraid(discover_raid_devices+0x109)[0x80533a9] dmraid(perform+0x1de)[0x804b72e] dmraid(main+0xa0)[0x804b0e0] /lib/libc.so.6(__libc_start_main+0xe0)[0xb7e0cfd8] dmraid[0x804afe1] ======= Memory map: ======== 08048000-0806d000 r-xp 00000000 08:03 3831409 /usr/sbin/dmraid 0806d000-0806e000 r--p 00024000 08:03 3831409 /usr/sbin/dmraid 0806e000-0806f000 rw-p 00025000 08:03 3831409 /usr/sbin/dmraid 0806f000-08091000 rw-p 0806f000 00:00 0 [heap] b7c00000-b7c21000 rw-p b7c00000 00:00 0 b7c21000-b7d00000 ---p b7c21000 00:00 0 b7dea000-b7df4000 r-xp 00000000 08:03 4258364 /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/libgcc_s.so.1 b7df4000-b7df5000 r--p 00009000 08:03 4258364 /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/libgcc_s.so.1 b7df5000-b7df6000 rw-p 0000a000 08:03 4258364 /usr/lib/gcc/i686-pc-linux-gnu/4.2.2/libgcc_s.so.1 b7df6000-b7df7000 rw-p b7df6000 00:00 0 b7df7000-b7f1b000 r-xp 00000000 08:03 4269484 /lib/libc-2.6.1.so b7f1b000-b7f1d000 r--p 00124000 08:03 4269484 /lib/libc-2.6.1.so b7f1d000-b7f1e000 rw-p 00126000 08:03 4269484 /lib/libc-2.6.1.so b7f1e000-b7f21000 rw-p b7f1e000 00:00 0 b7f21000-b7f32000 r-xp 00000000 08:03 4617716 /lib/libdevmapper.so.1.02 b7f32000-b7f34000 rw-p 00011000 08:03 4617716 /lib/libdevmapper.so.1.02 b7f34000-b7f35000 rw-p b7f34000 00:00 0 b7f5c000-b7f5d000 r-xp b7f5c000 00:00 0 [vdso] b7f5d000-b7f77000 r-xp 00000000 08:03 4272606 /lib/ld-2.6.1.so b7f77000-b7f78000 r--p 00019000 08:03 4272606 /lib/ld-2.6.1.so b7f78000-b7f79000 rw-p 0001a000 08:03 4272606 /lib/ld-2.6.1.so bfbea000-bfc00000 rw-p bfbea000 00:00 0 [stack] Abgebrochen ------------------------------------------------------------------------- My Steps: 1. Download current dmraid and untar / unzip 2. Apply patch with @Philip All fine here. @Heinz: cat dmraid.patch | patch -p1 --verbose Hmm... Looks like a unified diff to me... The text leading up to this was: -------------------------- |--- 1.0.0.rc14/lib/format/ataraid/jm.c 2006-09-22 17:24:03.000000000 +0200 |+++ current/lib/format/ataraid/jm.c 2007-04-19 11:05:34.000000000 +0200 -------------------------- Patching file lib/format/ataraid/jm.c using Plan A... Hunk #1 succeeded at 1. Hunk #2 FAILED at 25. 1 out of 2 hunks FAILED -- saving rejects to file lib/format/ataraid/jm.c.rej done Ok seems to have some problems. So done the work myself. Look at: http://geye.info/dmraid/jm.c (manuelly patched lib) and http://geye.info/dmraid/dmraid.patch (patch) also tried the gentoo patch additional (http://svn.pardus.org.tr/contrib/applications/admin/dmraid/files/dmraid-destdir-fix.patch) with the gentoo ./configure ./configure --prefix=/usr --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-static_link --disable-libselinux --disable-libsepol --build=i686-pc-linux-gnu 3. ./configure titanium 1.0.0.rc14 # ./configure checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking target system type... i686-pc-linux-gnu checking for gawk... gawk checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... yes checking for ranlib... ranlib checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for dirent.h that defines DIR... yes checking for library containing opendir... none required checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking sys/ioctl.h usability... yes checking sys/ioctl.h presence... yes checking for sys/ioctl.h... yes checking for unistd.h... (cached) yes checking malloc.h usability... yes checking malloc.h presence... yes checking for malloc.h... yes checking for an ANSI C-conforming const... yes checking for inline... inline checking for off_t... yes checking for pid_t... yes checking for size_t... yes checking for struct stat.st_rdev... yes checking whether time.h and sys/time.h may both be included... yes checking whether to enable debugging... no checking whether to enable malloc debugging... no checking whether to disable native metadata logging... yes checking whether to disable testing with mapped devices... no checking whether gcc needs -traditional... no checking return type of signal handlers... void checking for vprintf... yes checking for _doprnt... no checking for mkdir... yes checking for rmdir... yes checking for uname... yes checking getopt.h usability... yes checking getopt.h presence... yes checking for getopt.h... yes configure: creating ./config.status config.status: creating include/Makefile config.status: creating lib/Makefile config.status: creating man/Makefile config.status: creating tools/Makefile config.status: creating tools/version.h config.status: creating Makefile config.status: creating make.tmpl 3. titanium 1.0.0.rc14 # make make -C include make[1]: Entering directory `/root/dmraid/dmraid/1.0.0.rc14/include' make[1]: Für das Ziel »all« ist nichts zu tun. make[1]: Leaving directory `/root/dmraid/dmraid/1.0.0.rc14/include' make -C lib make[1]: Entering directory `/root/dmraid/dmraid/1.0.0.rc14/lib' gcc -MM -MF activate/activate.d -I. -I../include -I../lib -O2 -DDMRAID_NATIVE_LOG -DHAVE_GETOPTLONG -fPIC -Wall -Wundef -Wcast-align -Wwrite-strings -Winline -DDMRAID_TEST -O2 -D_LARGEFILE64_SOURCE activate/activate.c; \ gcc -c -I. -I../include -I../lib -O2 -DDMRAID_NATIVE_LOG -DHAVE_GETOPTLONG -fPIC -Wall -Wundef -Wcast-align -Wwrite-strings -Winline -DDMRAID_TEST -O2 -D_LARGEFILE64_SOURCE activate/activate.c -o activate/activate.o gcc -MM -MF activate/devmapper.d -I. -I../include -I../lib -O2 -DDMRAID_NATIVE_LOG -DHAVE_GETOPTLONG -fPIC -Wall -Wundef -Wcast-align -Wwrite-strings -Winline -DDMRAID_TEST -O2 -D_LARGEFILE64_SOURCE activate/devmapper.c; \ gcc -c -I. -I../include -I../lib -O2 -DDMRAID_NATIVE_LOG -DHAVE_GETOPTLONG -fPIC -Wall -Wundef -Wcast-align -Wwrite-strings -Winline -DDMRAID_TEST -O2 -D_LARGEFILE64_SOURCE activate/devmapper.c -o activate/devmapper.o gcc -MM -MF device/ata.d -I. -I../include -I../lib -O2 -DDMRAID_NATIVE_LOG -DHAVE_GETOPTLONG -fPIC -Wall -Wundef -Wcast-align -Wwrite-strings -Winline -DDMRAID_TEST -O2 -D_LARGEFILE64_SOURCE device/ata.c; \ ... 4. make install make install make -C include make[1]: Entering directory `/root/dmraid/dmraid/1.0.0.rc14/include' make[1]: Für das Ziel »all« ist nichts zu tun. make[1]: Leaving directory `/root/dmraid/dmraid/1.0.0.rc14/include' make -C lib make[1]: Entering directory `/root/dmraid/dmraid/1.0.0.rc14/lib' ../lib/libdmraid.a ../lib/libdmraid.a make[1]: Leaving directory `/root/dmraid/dmraid/1.0.0.rc14/lib' make -C man ... 5. check the dmraid binary ls -lart /sbin/dmraid titanium 1.0.0.rc14 # ls -lart /sbin/dmraid -rwxr-xr-x 1 root root 177002 22. Okt 18:41 /sbin/dmraid titanium 1.0.0.rc14 # ls -lart /lib/libdmraid.a -r-xr-xr-x 1 root root 254766 22. Okt 18:41 /lib/libdmraid.a Seems to be new. 6. dmraid -ay --verbose OR /sbin/dmraid -ay --verbose OR /usr/sbin/dmraid -ay --verbose titanium 1.0.0.rc14 # dmraid -ay --verbose INFO: Activating stripe RAID set "jmicron_GRAID " 7. dmesg show the usual errors device-mapper: table: 252:1: linear: dm-linear: Device lookup failed device-mapper: ioctl: error adding target to table device-mapper: table: 252:1: linear: dm-linear: Device lookup failed device-mapper: ioctl: error adding target to table device-mapper: table: 252:1: linear: dm-linear: Device lookup failed device-mapper: ioctl: error adding target to table device-mapper: table: 252:1: linear: dm-linear: Device lookup failed device-mapper: ioctl: error adding target to table device-mapper: table: 252:1: linear: dm-linear: Device lookup failed device-mapper: ioctl: error adding target to table titanium 1.0.0.rc14 # ls -lart /dev/mapper/ insgesamt 0 brw-r----- 1 root disk 252, 0 22. Okt 18:42 jmicron_GRAID___________ brw------- 1 root root 252, 0 22. Okt 18:42 jmicron_GRAID drwxr-xr-x 15 root root 15220 22. Okt 18:43 .. drwxr-xr-x 2 root root 100 22. Okt 18:43 . lrwxrwxrwx 1 root root 16 22. Okt 2007 control -> ../device-mapper titanium 1.0.0.rc14 # cfdisk /dev/mapper/jmicron_GRAID___________ Name Flags Part. Typ Dateisystemtyp [Bezeichner] Grö�~_e (MB) -------------------------------------------------------------------------------------------------------------------------------------------------- jmicron_GRAID___________3 Primäre Linux 105,91 * jmicron_GRAID_________Boot Primäre NTFS [^C] 31457,28 * jmicron_GRAID___________2 Primäre NTFS [^]] 257020,66 * jmicron_GRAID___________5 Logische Linux 2023,42 * jmicron_GRAID___________6 Logische Linux 29430,16 * So I have still the same problems. Have you some ideas what I have done wrong or where the problem is. Ps. titanium dmraid # dmsetup --version Library version: 1.02.22 (2007-08-21) Driver version: 4.11.0 Compiling on gentoo: gcc: i686-pc-linux-gnu-4.2.2 Heinz Mauelshagen schrieb: > Andreas, et al. > > For completenes, this is the patch in .rc15. > > Andreas, et al. > > For completeness, this is the patch in .rc15. > Maybe you can give it a go and report if it works for you as well ? > > Heinz > > --- 1.0.0.rc14/lib/format/ataraid/jm.c 2006-09-22 17:24:03.000000000 +0200 > +++ current/lib/format/ataraid/jm.c 2007-04-19 11:05:34.000000000 +0200 > @@ -1,8 +1,8 @@ > /* > * JMicron metadata format handler. > * > - * Copyright (C) 2006 Heinz Mauelshagen, Red Hat GmbH. > - * All rights reserved. > + * Copyright (C) 2006,2007 Heinz Mauelshagen, Red Hat GmbH. > + * All rights reserved. > * > * See file LICENSE at the top of this source tree for license information. > */ > @@ -25,25 +25,27 @@ > static char *name(struct lib_context *lc, struct raid_dev *rd, > unsigned int subset) > { > + int i; > size_t len; > struct jm *jm = META(rd, jm); > - char buf[2], *ret, *name = (char *) jm->name; > + char buf[JM_NAME_LEN + 1], *ret, *name = (char *) jm->name; > > - /* Name always 0 terminated ? */ > - if ((len = strlen(name)) > JM_NAME_LEN) > - len = JM_NAME_LEN; > - > - len += sizeof(HANDLER) + 2; > - if (jm->mode == JM_T_RAID01) > - len++; > + /* Name always 0 terminated or whitespace at end ? */ > + strncpy(buf, name, JM_NAME_LEN); > + len = strlen(buf); > + i = len < JM_NAME_LEN ? len : JM_NAME_LEN; > + buf[i] = 0; > + while (i-- && isspace(buf[i])) > + buf[i] = 0; > > + len = strlen(buf) + sizeof(HANDLER) + (jm->mode == JM_T_RAID01 ? 3 : 2); > if ((ret = dbg_malloc(len))) { > if (jm->mode == JM_T_RAID01 && subset) > sprintf(buf, "-%u", member(jm) / 2); > else > *buf = 0; > > - sprintf(ret, "%s_%s%s", HANDLER, name, buf); > + sprintf(ret, "%s_%s%s", handler, name, buf); > } > > return ret; > > > On Mon, Oct 15, 2007 at 11:11:09AM +1000, Phil Higgins wrote: > >> If you want to give it a go, see below. >> It's fairly simple - just copying the string to a temporary buffer big enough to hold the maximum length name plus null termination, then working backwards stripping the spaces out by replacing them with nulls. >> >> I don't know if it's necessary for all Jmicron controllers or just the Gigabyte motherboard ones - but it shouldn't cause anything bad to happen under any circumstances. >> >> Philip Higgins. >> >> --------- >> --- 1.0.0.rc14/lib/format/ataraid/jm.c 2007-10-15 09:59:28.000000000 +1000 >> +++ 1.0.0.rc14-fixed/lib/format/ataraid/jm.c 2007-10-15 10:21:50.000000000 +1000 >> @@ -29,8 +29,22 @@ >> struct jm *jm = META(rd, jm); >> char buf[2], *ret, *name = (char *) jm->name; >> >> - /* Name always 0 terminated ? */ >> - if ((len = strlen(name)) > JM_NAME_LEN) >> + char namebuf[JM_NAME_LEN+1]; >> + strncpy(namebuf,name,JM_NAME_LEN); >> + namebuf[JM_NAME_LEN] = '\0'; >> + >> + int i; >> + >> + for (i=JM_NAME_LEN; i>0; i--) >> + { >> + if (namebuf[i] == ' ') >> + namebuf[i] = '\0'; >> + else >> + break; >> + } >> + >> + /* Name always 0 terminated ? - It is now. */ >> + if ((len = strlen(namebuf)) > JM_NAME_LEN) >> len = JM_NAME_LEN; >> >> len += sizeof(HANDLER) + 2; >> @@ -43,7 +57,7 @@ >> else >> *buf = 0; >> >> - sprintf(ret, "%s_%s%s", HANDLER, name, buf); >> + sprintf(ret, "%s_%s%s", HANDLER, namebuf,buf); >> } >> >> return ret; >> --------- >> If patch is mangled by Outlook, grab from http://shadowsystems.com.au/jmicron.patch >> >> -----Original Message----- >> From: ataraid-list-bounces@xxxxxxxxxx [mailto:ataraid-list-bounces@xxxxxxxxxx] On Behalf Of Andreas Geringer >> Sent: Saturday, 13 October 2007 2:16 AM >> To: ATARAID (eg, Promise Fasttrak, Highpoint 370) related discussions >> Subject: Re: JMicron Raid Problems on a Gigabyte GA-P35-DS3 >> >> If it is not too much to do for you, I would like to try the patch. >> >> I have another sata-device without raid with the new gentoo-system. So >> it is not really urgent for me. I think I have also the time to wait >> for the new version. >> >> Andreas Geringer >> >> >> No virus found in this outgoing message. >> Checked by AVG Free Edition. >> Version: 7.5.488 / Virus Database: 269.14.10/1070 - Release Date: 14/10/2007 9:22 AM >> >> >> _______________________________________________ >> Ataraid-list mailing list >> Ataraid-list@xxxxxxxxxx >> https://www.redhat.com/mailman/listinfo/ataraid-list >> > > _______________________________________________ Ataraid-list mailing list Ataraid-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/ataraid-list