[DRBD-user] SIGSEGV in drbdmeta 8.0.1

Jens Beyer jbe at webde.de
Wed Mar 7 17:29:20 CET 2007

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


Hi,

while playing around with migration (and recovery) of metadata from v07 to v08
I encountered an SIGSEGV while restoring dumped meta data.

After a quick look at the source it looks like some bad generated parser-code.

My Setup:
I have an drbd (previous 0.7.23) running on-top of LVM (2.0.22), kernel 2.6.20;
(SLES9 based, flex 2.5.4, gcc 3.3.3).

I stopped drbd, upgraded to 8.0.1 and dumped meta data with:

### drbdmeta /dev/drbd0 v07 /dev/VG/LV1 internal dump-md > LV1-v07-meta 

after trying to convert this to v08 I did

### drbdmeta /dev/drbd0 v07 /dev/VG/LV1 internal wipe-md

followed by:

### ./drbdmeta /dev/drbd0 v07 /dev/VG/LV1 internal restore-md /root/LV1-v07-meta 
v07 Magic number not found
SIGSEGV!
This feels like a bug.
debug hint: last memset: md_disk_07_to_cpu:426: @0x50b048 104
Sorry.

### gdb ./drbdmeta
GNU gdb 6.3
Copyright 2004 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 "x86_64-suse-linux"...Using host libthread_db library "/lib64/tls/libthread_db.so.1".

(gdb) run /dev/drbd0 v07 /dev/VG/LV1 internal restore-md /root/LV1-v07-meta
Starting program: /usr/src/drbd-8.0.1/user/drbdmeta /dev/drbd0 v07 /dev/VG/LV1 internal restore-md /root/LV1-v07-meta
v07 Magic number not found

Program received signal SIGSEGV, Segmentation fault.
meta_restore_md (cfg=0x50b010, argv=<value optimized out>, argc=<value optimized out>) at drbdmeta.c:1819
1819                            bm[i].le = cpu_to_le64(yylval.u64);
(gdb) print yylval.u64
There is no member named u64.
(gdb) print yylval    
$1 = {txt = 0x0, uint64_t = 0}
(gdb) list
1814            bm = (le_u64 *)cfg->on_disk.bm;
1815            i = 0;
1816            while(1) {
1817                    switch(yylex()) {
1818                    case TK_U64:
1819                            bm[i].le = cpu_to_le64(yylval.u64);
1820                            i++;
1821                            EXP(';');
1822                            break;
1823                    case TK_NUM:
(gdb) The program is running.  Exit anyway? (y or n) y

Jens

PS: Thanks for this great product! :-)

-- 
Dr. Jens Beyer
IT-Systemarchitekt

1&1 Internet AG IT-Portal
Brauerstrasse 48 - D-76135 Karlsruhe
Tel. +49-721-91374-4245
jens.beyer at webde.de - http://web.de



More information about the drbd-user mailing list