Package: procps
Version: 1:3.3.9-5
Usertags: goto-cc

During a rebuild of all Debian packages in a clean sid chroot (using cowbuilder
and pbuilder) the build failed with the following error.

[...]
    === vmstat tests ===

Schedule of variations:
    unix

Running target unix
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for 
target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
Using ./config/unix.exp as tool-and-target-specific interface file.
Running ./vmstat.test/vmstat.exp ...
FAIL: vmstat partition (using sda1)


So what is going on here:

~/procps-3.3.9/testsuite# ../vmstat -p sda1
Segmentation fault

~/procps-3.3.9/testsuite# LD_LIBRARY_PATH=../proc/.libs/ gdb --args 
../.libs/vmstat -p sda1
[...]
(gdb) r
Starting program: 
/srv/jenkins-slave/workspace/sid-goto-cc-procps/procps-3.3.9/.libs/vmstat -p 
sda1

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff77bec8a in getdiskstat (disks=0x7fffffffe6b8, 
partitions=0x7fffffffe6c0) at sysinfo.c:942
942       (*disks)[cDisk-1].partitions++;
(gdb) bt
#0  0x00007ffff77bec8a in getdiskstat (disks=0x7fffffffe6b8, 
partitions=0x7fffffffe6c0)
    at sysinfo.c:942
#1  0x0000000000401823 in diskpartition_format (partition_name=0x7fffffffeaed 
"sda1") at vmstat.c:405
#2  main (argc=<optimized out>, argv=0x7fffffffe828) at vmstat.c:860
(gdb) print cDisk
$1 = <optimized out>
(gdb) print disks
$2 = (struct disk_stat **) 0x7fffffffe6b8
(gdb) print *disks
$3 = (struct disk_stat *) 0x0


Looking at the code of getdiskstat this must meant that either parsing
/proc/diskstats fails or partitions are otherwise seen before memory for a disk
has been allocated. And indeed this is the case here as the call to is_disk does
not produce an appropriate result in my case, because:

~/procps-3.3.9/testsuite# ls /sys
~/procps-3.3.9/testsuite#


So it would be nice if is_disk failed in some sensible way if /sys/block wasn't
available at all.

Best,
Michael

Attachment: pgpo41z9C6FkJ.pgp
Description: PGP signature

Reply via email to