FWIW, here's some more interesting gdb bits:

Breakpoint 1, 0xb7e7dd68 in strcmp () from /lib/i686/cmov/libc.so.6
1: x/i $pc  0xb7e7dd68 <strcmp+8>:      mov    (%ecx),%al
(gdb) print (char*)$ecx
$5 = 0xb7f5dd2a "ocfs"
(gdb) print (char*)$edx
$6 = 0x805e338 "`ã\005\b¸â\005\bÀâ\005\b!"
(gdb) finish
Run till exit from #0  0xb7e7dd68 in strcmp () from /lib/i686/cmov/libc.so.6
0xb7f5c296 in blkid_verify () from /lib/libblkid.so.1
1: x/i $pc  0xb7f5c296 <blkid_verify+406>:      test   %eax,%eax
(gdb)
[...]
0xb7f5c280 in blkid_verify () from /lib/libblkid.so.1
1: x/i $pc  0xb7f5c280 <blkid_verify+384>:      mov    0xc(%ebp),%edi
(gdb) si
0xb7f5c283 in blkid_verify () from /lib/libblkid.so.1
1: x/i $pc  0xb7f5c283 <blkid_verify+387>:      mov    0x18(%edi),%eax
(gdb) si
0xb7f5c286 in blkid_verify () from /lib/libblkid.so.1
1: x/i $pc  0xb7f5c286 <blkid_verify+390>:      test   %eax,%eax
(gdb) print/x $eax
$8 = 0x805e338
(gdb) print ((char**)$edi)[6]
$10 = 0x805e338 "`ã\005\b¸â\005\bÀâ\005\b!"
(gdb) print ((char**)$edi)[6] = 0
$11 = 0x0
(gdb) c
Continuing.

Program exited with code 040.
(gdb)

----------------
So, 'dev->bid_type' is garbage when blkid_verify is called, and that's
causing an infinite loop.  It is supposed to be NULL if we don't know
what the requested block device type is (the original command was
'sudo mount -o loop,offset=31744 xo-initrd-test.img
xo-initrd-test-mnt' ie, there was no -t option given).  Setting
dev->bid_type to NULL allows the mount to complete 'normally' -- it
gives:

mount: you must specify the filesystem type

Reinvoking mount with an explicit -t option succeeds without problem
(no infinite loop this time):

$ sudo mount -o loop,offset=31744 -t ext3 xo-initrd-test.img xo-initrd-test-mnt
$

--scott

--
                        ( http://cscott.net/ )

Reply via email to