[Orca-users] Orcallator - Segmentation Fault

Brian Poole pooleb at gmail.com
Thu Sep 7 12:23:07 PDT 2006


Hmm, I'm not sure I understand. Are you are saying readdir is
returning a non-NULL value that somehow turns into a NULL a few lines
later?

I wrote a quick C test to verify the readdir() for /dev/dsk looks
normal and it does to me.. here is the test code and output on an
affected server (apologies in advance for any formatting the mail
client may do.)

#include <dirent.h>
#include <stdio.h>

#include <sys/dirent.h>

/*
 * typedef struct dirent {
 *        ino_t           d_ino;
 *        off_t           d_off;
 *        unsigned short  d_reclen;
 *        char            d_name[1];
 * } dirent_t;
 */

int main(){

        DIR *dirp;
        dirent_t *ld;

        dirp = opendir("/dev/dsk");

        if (dirp == NULL){
                printf("error: opendir failed\n");
                return 1;
        }

        for (ld = readdir(dirp); ld != NULL; ld = readdir(dirp)) {

                printf("read ld with d_name = '%s', d_ino = '%u',
d_off = '%u', and reclen = '%u'\n", \
                        ld->d_name, ld->d_ino, ld->d_off, ld->d_reclen);
        }
        closedir(dirp);
        printf("\nAll done with readdir, exiting.\n");

        return 0;
}

Outputs:
# ./walk-dir
read ld with d_name = '.', d_ino = '7610', d_off = '12', and reclen = '16'
read ld with d_name = '..', d_ino = '8', d_off = '24', and reclen = '16'
read ld with d_name = 'c0t0d0s0', d_ino = '7611', d_off = '44', and
reclen = '24'
read ld with d_name = 'c0t0d0s1', d_ino = '7612', d_off = '64', and
reclen = '24'
read ld with d_name = 'c0t0d0s2', d_ino = '7613', d_off = '84', and
reclen = '24'
read ld with d_name = 'c0t0d0s3', d_ino = '7614', d_off = '104', and
reclen = '24'
read ld with d_name = 'c0t0d0s4', d_ino = '7615', d_off = '124', and
reclen = '24'
read ld with d_name = 'c0t0d0s5', d_ino = '7616', d_off = '144', and
reclen = '24'
read ld with d_name = 'c0t0d0s6', d_ino = '7617', d_off = '164', and
reclen = '24'
read ld with d_name = 'c0t0d0s7', d_ino = '7618', d_off = '184', and
reclen = '24'
read ld with d_name = 'c0t1d0s0', d_ino = '7619', d_off = '204', and
reclen = '24'
read ld with d_name = 'c0t1d0s1', d_ino = '7620', d_off = '224', and
reclen = '24'
read ld with d_name = 'c0t1d0s2', d_ino = '7621', d_off = '244', and
reclen = '24'
read ld with d_name = 'c0t1d0s3', d_ino = '7622', d_off = '264', and
reclen = '24'
read ld with d_name = 'c0t1d0s4', d_ino = '7623', d_off = '284', and
reclen = '24'
read ld with d_name = 'c0t1d0s5', d_ino = '7624', d_off = '304', and
reclen = '24'
read ld with d_name = 'c0t1d0s6', d_ino = '7625', d_off = '324', and
reclen = '24'
read ld with d_name = 'c0t1d0s7', d_ino = '7626', d_off = '344', and
reclen = '24'
read ld with d_name = 'c1t4d0s0', d_ino = '7627', d_off = '364', and
reclen = '24'
read ld with d_name = 'c1t4d0s1', d_ino = '7628', d_off = '384', and
reclen = '24'
read ld with d_name = 'c1t4d0s2', d_ino = '7629', d_off = '404', and
reclen = '24'
read ld with d_name = 'c1t4d0s3', d_ino = '7630', d_off = '424', and
reclen = '24'
read ld with d_name = 'c1t4d0s4', d_ino = '7631', d_off = '444', and
reclen = '24'
read ld with d_name = 'c1t4d0s5', d_ino = '7632', d_off = '464', and
reclen = '24'
read ld with d_name = 'c1t4d0s6', d_ino = '7633', d_off = '484', and
reclen = '24'
read ld with d_name = 'c1t4d0s7', d_ino = '7634', d_off = '512', and
reclen = '24'
read ld with d_name = 'c2t0d128s0', d_ino = '7971', d_off = '532', and
reclen = '24'
read ld with d_name = 'c2t0d128s1', d_ino = '7973', d_off = '552', and
reclen = '24'
read ld with d_name = 'c2t0d128s2', d_ino = '8000', d_off = '572', and
reclen = '24'
read ld with d_name = 'c2t0d128s3', d_ino = '8001', d_off = '592', and
reclen = '24'
read ld with d_name = 'c2t0d128s4', d_ino = '8002', d_off = '612', and
reclen = '24'
read ld with d_name = 'c2t0d128s5', d_ino = '8003', d_off = '632', and
reclen = '24'
read ld with d_name = 'c2t0d128s6', d_ino = '8004', d_off = '652', and
reclen = '24'
read ld with d_name = 'c2t0d128s7', d_ino = '8005', d_off = '672', and
reclen = '24'
read ld with d_name = 'c2t0d131s0', d_ino = '8014', d_off = '692', and
reclen = '24'
read ld with d_name = 'c2t0d131s1', d_ino = '8015', d_off = '712', and
reclen = '24'
read ld with d_name = 'c2t0d131s2', d_ino = '8016', d_off = '732', and
reclen = '24'
read ld with d_name = 'c2t0d131s3', d_ino = '8017', d_off = '752', and
reclen = '24'
read ld with d_name = 'c2t0d131s4', d_ino = '8018', d_off = '772', and
reclen = '24'
read ld with d_name = 'c2t0d131s5', d_ino = '8019', d_off = '792', and
reclen = '24'
read ld with d_name = 'c2t0d131s6', d_ino = '8020', d_off = '812', and
reclen = '24'
read ld with d_name = 'c2t0d131s7', d_ino = '8021', d_off = '832', and
reclen = '24'
read ld with d_name = 'c2t0d132s0', d_ino = '8030', d_off = '852', and
reclen = '24'
read ld with d_name = 'c2t0d132s1', d_ino = '8031', d_off = '872', and
reclen = '24'
read ld with d_name = 'c2t0d132s2', d_ino = '8032', d_off = '892', and
reclen = '24'
read ld with d_name = 'c2t0d132s3', d_ino = '8033', d_off = '912', and
reclen = '24'
read ld with d_name = 'c2t0d132s4', d_ino = '8034', d_off = '932', and
reclen = '24'
read ld with d_name = 'c2t0d132s5', d_ino = '8035', d_off = '952', and
reclen = '24'
read ld with d_name = 'c2t0d132s6', d_ino = '8036', d_off = '972', and
reclen = '24'
read ld with d_name = 'c2t0d132s7', d_ino = '8037', d_off = '992', and
reclen = '24'
read ld with d_name = 'c2t0d133s0', d_ino = '8046', d_off = '1024',
and reclen = '24'
read ld with d_name = 'c2t0d133s1', d_ino = '8047', d_off = '1044',
and reclen = '24'
read ld with d_name = 'c2t0d133s2', d_ino = '8048', d_off = '1064',
and reclen = '24'
read ld with d_name = 'c2t0d133s3', d_ino = '8049', d_off = '1084',
and reclen = '24'
read ld with d_name = 'c2t0d133s4', d_ino = '8050', d_off = '1104',
and reclen = '24'
read ld with d_name = 'c2t0d133s5', d_ino = '8051', d_off = '1124',
and reclen = '24'
read ld with d_name = 'c2t0d133s6', d_ino = '8052', d_off = '1144',
and reclen = '24'
read ld with d_name = 'c2t0d133s7', d_ino = '8053', d_off = '1164',
and reclen = '24'
read ld with d_name = 'c3t1d128s0', d_ino = '9987', d_off = '1184',
and reclen = '24'
read ld with d_name = 'c3t1d128s1', d_ino = '9988', d_off = '1204',
and reclen = '24'
read ld with d_name = 'c3t1d128s2', d_ino = '9989', d_off = '1224',
and reclen = '24'
read ld with d_name = 'c3t1d128s3', d_ino = '9990', d_off = '1244',
and reclen = '24'
read ld with d_name = 'c3t1d128s4', d_ino = '9991', d_off = '1264',
and reclen = '24'
read ld with d_name = 'c3t1d128s5', d_ino = '9992', d_off = '1284',
and reclen = '24'
read ld with d_name = 'c3t1d128s6', d_ino = '9993', d_off = '1304',
and reclen = '24'
read ld with d_name = 'c3t1d128s7', d_ino = '9994', d_off = '1324',
and reclen = '24'
read ld with d_name = 'c3t1d131s0', d_ino = '10003', d_off = '1344',
and reclen = '24'
read ld with d_name = 'c3t1d131s1', d_ino = '10004', d_off = '1364',
and reclen = '24'
read ld with d_name = 'c3t1d131s2', d_ino = '10005', d_off = '1384',
and reclen = '24'
read ld with d_name = 'c3t1d131s3', d_ino = '10006', d_off = '1404',
and reclen = '24'
read ld with d_name = 'c3t1d131s4', d_ino = '10007', d_off = '1424',
and reclen = '24'
read ld with d_name = 'c3t1d131s5', d_ino = '10008', d_off = '1444',
and reclen = '24'
read ld with d_name = 'c3t1d131s6', d_ino = '10009', d_off = '1464',
and reclen = '24'
read ld with d_name = 'c3t1d131s7', d_ino = '10010', d_off = '1484',
and reclen = '24'
read ld with d_name = 'c3t1d132s0', d_ino = '10019', d_off = '1504',
and reclen = '24'
read ld with d_name = 'c3t1d132s1', d_ino = '10020', d_off = '1536',
and reclen = '24'
read ld with d_name = 'c3t1d132s2', d_ino = '10021', d_off = '1556',
and reclen = '24'
read ld with d_name = 'c3t1d132s3', d_ino = '10022', d_off = '1576',
and reclen = '24'
read ld with d_name = 'c3t1d132s4', d_ino = '10023', d_off = '1596',
and reclen = '24'
read ld with d_name = 'c3t1d132s5', d_ino = '10024', d_off = '1616',
and reclen = '24'
read ld with d_name = 'c3t1d132s6', d_ino = '10025', d_off = '1636',
and reclen = '24'
read ld with d_name = 'c3t1d132s7', d_ino = '10026', d_off = '1656',
and reclen = '24'
read ld with d_name = 'c3t1d133s0', d_ino = '10035', d_off = '1676',
and reclen = '24'
read ld with d_name = 'c3t1d133s1', d_ino = '10036', d_off = '1696',
and reclen = '24'
read ld with d_name = 'c3t1d133s2', d_ino = '10037', d_off = '1716',
and reclen = '24'
read ld with d_name = 'c3t1d133s3', d_ino = '10038', d_off = '1736',
and reclen = '24'
read ld with d_name = 'c3t1d133s4', d_ino = '10039', d_off = '1756',
and reclen = '24'
read ld with d_name = 'c3t1d133s5', d_ino = '10040', d_off = '1776',
and reclen = '24'
read ld with d_name = 'c3t1d133s6', d_ino = '10041', d_off = '1796',
and reclen = '24'
read ld with d_name = 'c3t1d133s7', d_ino = '10042', d_off = '1816',
and reclen = '24'
read ld with d_name = 'c2t0d16s0', d_ino = '10055', d_off = '1836',
and reclen = '24'
read ld with d_name = 'c2t0d16s1', d_ino = '10057', d_off = '1856',
and reclen = '24'
read ld with d_name = 'c2t0d16s2', d_ino = '10060', d_off = '1876',
and reclen = '24'
read ld with d_name = 'c2t0d16s3', d_ino = '10061', d_off = '1896',
and reclen = '24'
read ld with d_name = 'c2t0d16s4', d_ino = '10062', d_off = '1916',
and reclen = '24'
read ld with d_name = 'c2t0d16s5', d_ino = '10063', d_off = '1936',
and reclen = '24'
read ld with d_name = 'c2t0d16s6', d_ino = '10064', d_off = '1956',
and reclen = '24'
read ld with d_name = 'c2t0d16s7', d_ino = '10065', d_off = '1976',
and reclen = '24'
read ld with d_name = 'c3t1d16s0', d_ino = '10074', d_off = '1996',
and reclen = '24'
read ld with d_name = 'c3t1d16s1', d_ino = '10075', d_off = '2016',
and reclen = '24'
read ld with d_name = 'c3t1d16s2', d_ino = '10076', d_off = '2048',
and reclen = '24'
read ld with d_name = 'c3t1d16s3', d_ino = '10077', d_off = '2068',
and reclen = '24'
read ld with d_name = 'c3t1d16s4', d_ino = '10078', d_off = '2088',
and reclen = '24'
read ld with d_name = 'c3t1d16s5', d_ino = '10079', d_off = '2108',
and reclen = '24'
read ld with d_name = 'c3t1d16s6', d_ino = '10080', d_off = '2128',
and reclen = '24'
read ld with d_name = 'c3t1d16s7', d_ino = '10081', d_off = '2148',
and reclen = '24'
read ld with d_name = 'c3t2d40s0', d_ino = '10058', d_off = '2168',
and reclen = '24'
read ld with d_name = 'c3t2d40s1', d_ino = '10090', d_off = '2188',
and reclen = '24'
read ld with d_name = 'c3t2d40s2', d_ino = '10092', d_off = '2208',
and reclen = '24'
read ld with d_name = 'c3t2d40s3', d_ino = '10093', d_off = '2228',
and reclen = '24'
read ld with d_name = 'c3t2d40s4', d_ino = '10094', d_off = '2248',
and reclen = '24'
read ld with d_name = 'c3t2d40s5', d_ino = '10095', d_off = '2268',
and reclen = '24'
read ld with d_name = 'c3t2d40s6', d_ino = '10096', d_off = '2288',
and reclen = '24'
read ld with d_name = 'c3t2d40s7', d_ino = '10097', d_off = '2308',
and reclen = '24'
read ld with d_name = 'c2t3d40s0', d_ino = '10106', d_off = '2328',
and reclen = '24'
read ld with d_name = 'c2t3d40s1', d_ino = '10107', d_off = '2348',
and reclen = '24'
read ld with d_name = 'c2t3d40s2', d_ino = '10108', d_off = '2368',
and reclen = '24'
read ld with d_name = 'c2t3d40s3', d_ino = '10109', d_off = '2388',
and reclen = '24'
read ld with d_name = 'c2t3d40s4', d_ino = '10110', d_off = '2408',
and reclen = '24'
read ld with d_name = 'c2t3d40s5', d_ino = '10111', d_off = '2428',
and reclen = '24'
read ld with d_name = 'c2t3d40s6', d_ino = '10112', d_off = '2448',
and reclen = '24'
read ld with d_name = 'c2t3d40s7', d_ino = '10113', d_off = '2468',
and reclen = '24'
read ld with d_name = 'c3t8d1s0', d_ino = '10127', d_off = '2488', and
reclen = '24'
read ld with d_name = 'c3t8d1s1', d_ino = '10128', d_off = '2508', and
reclen = '24'
read ld with d_name = 'c3t8d1s2', d_ino = '10130', d_off = '2528', and
reclen = '24'
read ld with d_name = 'c3t8d1s3', d_ino = '10131', d_off = '2560', and
reclen = '24'
read ld with d_name = 'c3t8d1s4', d_ino = '10132', d_off = '2580', and
reclen = '24'
read ld with d_name = 'c3t8d1s5', d_ino = '10133', d_off = '2600', and
reclen = '24'
read ld with d_name = 'c3t8d1s6', d_ino = '10134', d_off = '2620', and
reclen = '24'
read ld with d_name = 'c3t8d1s7', d_ino = '10135', d_off = '2640', and
reclen = '24'
read ld with d_name = 'c3t8d2s0', d_ino = '10144', d_off = '2660', and
reclen = '24'
read ld with d_name = 'c3t8d2s1', d_ino = '10145', d_off = '2680', and
reclen = '24'
read ld with d_name = 'c3t8d2s2', d_ino = '10146', d_off = '2700', and
reclen = '24'
read ld with d_name = 'c3t8d2s3', d_ino = '10147', d_off = '2720', and
reclen = '24'
read ld with d_name = 'c3t8d2s4', d_ino = '10148', d_off = '2740', and
reclen = '24'
read ld with d_name = 'c3t8d2s5', d_ino = '10149', d_off = '2760', and
reclen = '24'
read ld with d_name = 'c3t8d2s6', d_ino = '10150', d_off = '2780', and
reclen = '24'
read ld with d_name = 'c3t8d2s7', d_ino = '10151', d_off = '2800', and
reclen = '24'
read ld with d_name = 'c3t8d3s0', d_ino = '10160', d_off = '2820', and
reclen = '24'
read ld with d_name = 'c3t8d3s1', d_ino = '10161', d_off = '2840', and
reclen = '24'
read ld with d_name = 'c3t8d3s2', d_ino = '10162', d_off = '2860', and
reclen = '24'
read ld with d_name = 'c3t8d3s3', d_ino = '10163', d_off = '2880', and
reclen = '24'
read ld with d_name = 'c3t8d3s4', d_ino = '10164', d_off = '2900', and
reclen = '24'
read ld with d_name = 'c3t8d3s5', d_ino = '10165', d_off = '2920', and
reclen = '24'
read ld with d_name = 'c3t8d3s6', d_ino = '10166', d_off = '2940', and
reclen = '24'
read ld with d_name = 'c3t8d3s7', d_ino = '10167', d_off = '2960', and
reclen = '24'
read ld with d_name = 'c3t8d4s0', d_ino = '10176', d_off = '2980', and
reclen = '24'
read ld with d_name = 'c3t8d4s1', d_ino = '10177', d_off = '3000', and
reclen = '24'
read ld with d_name = 'c3t8d4s2', d_ino = '10178', d_off = '3020', and
reclen = '24'
read ld with d_name = 'c3t8d4s3', d_ino = '10179', d_off = '3040', and
reclen = '24'
read ld with d_name = 'c3t8d4s4', d_ino = '10180', d_off = '3072', and
reclen = '24'
read ld with d_name = 'c3t8d4s5', d_ino = '10181', d_off = '3092', and
reclen = '24'
read ld with d_name = 'c3t8d4s6', d_ino = '10182', d_off = '3112', and
reclen = '24'
read ld with d_name = 'c3t8d4s7', d_ino = '10183', d_off = '3132', and
reclen = '24'
read ld with d_name = 'c2t11d1s0', d_ino = '10192', d_off = '3152',
and reclen = '24'
read ld with d_name = 'c2t11d1s1', d_ino = '10193', d_off = '3172',
and reclen = '24'
read ld with d_name = 'c2t11d1s2', d_ino = '10194', d_off = '3192',
and reclen = '24'
read ld with d_name = 'c2t11d1s3', d_ino = '10195', d_off = '3212',
and reclen = '24'
read ld with d_name = 'c2t11d1s4', d_ino = '10196', d_off = '3232',
and reclen = '24'
read ld with d_name = 'c2t11d1s5', d_ino = '10197', d_off = '3252',
and reclen = '24'
read ld with d_name = 'c2t11d1s6', d_ino = '10198', d_off = '3272',
and reclen = '24'
read ld with d_name = 'c2t11d1s7', d_ino = '10199', d_off = '3292',
and reclen = '24'
read ld with d_name = 'c2t11d2s0', d_ino = '10208', d_off = '3312',
and reclen = '24'
read ld with d_name = 'c2t11d2s1', d_ino = '10209', d_off = '3332',
and reclen = '24'
read ld with d_name = 'c2t11d2s2', d_ino = '10210', d_off = '3352',
and reclen = '24'
read ld with d_name = 'c2t11d2s3', d_ino = '10211', d_off = '3372',
and reclen = '24'
read ld with d_name = 'c2t11d2s4', d_ino = '10212', d_off = '3392',
and reclen = '24'
read ld with d_name = 'c2t11d2s5', d_ino = '10213', d_off = '3412',
and reclen = '24'
read ld with d_name = 'c2t11d2s6', d_ino = '10214', d_off = '3432',
and reclen = '24'
read ld with d_name = 'c2t11d2s7', d_ino = '10215', d_off = '3452',
and reclen = '24'
read ld with d_name = 'c2t11d3s0', d_ino = '10224', d_off = '3472',
and reclen = '24'
read ld with d_name = 'c2t11d3s1', d_ino = '10225', d_off = '3492',
and reclen = '24'
read ld with d_name = 'c2t11d3s2', d_ino = '10226', d_off = '3512',
and reclen = '24'
read ld with d_name = 'c2t11d3s3', d_ino = '10227', d_off = '3532',
and reclen = '24'
read ld with d_name = 'c2t11d3s4', d_ino = '10228', d_off = '3552',
and reclen = '24'
read ld with d_name = 'c2t11d3s5', d_ino = '10229', d_off = '3584',
and reclen = '24'
read ld with d_name = 'c2t11d3s6', d_ino = '10230', d_off = '3604',
and reclen = '24'
read ld with d_name = 'c2t11d3s7', d_ino = '10231', d_off = '3624',
and reclen = '24'
read ld with d_name = 'c2t11d4s0', d_ino = '10240', d_off = '3644',
and reclen = '24'
read ld with d_name = 'c2t11d4s1', d_ino = '10241', d_off = '3664',
and reclen = '24'
read ld with d_name = 'c2t11d4s2', d_ino = '10242', d_off = '3684',
and reclen = '24'
read ld with d_name = 'c2t11d4s3', d_ino = '10243', d_off = '3704',
and reclen = '24'
read ld with d_name = 'c2t11d4s4', d_ino = '10244', d_off = '3724',
and reclen = '24'
read ld with d_name = 'c2t11d4s5', d_ino = '10245', d_off = '3744',
and reclen = '24'
read ld with d_name = 'c2t11d4s6', d_ino = '10246', d_off = '3764',
and reclen = '24'
read ld with d_name = 'c2t11d4s7', d_ino = '10247', d_off = '3784',
and reclen = '24'
read ld with d_name = 'c2t11d5s0', d_ino = '10129', d_off = '3804',
and reclen = '24'
read ld with d_name = 'c2t11d5s1', d_ino = '10257', d_off = '3824',
and reclen = '24'
read ld with d_name = 'c2t11d5s2', d_ino = '10258', d_off = '3844',
and reclen = '24'
read ld with d_name = 'c2t11d5s3', d_ino = '10259', d_off = '3864',
and reclen = '24'
read ld with d_name = 'c2t11d5s4', d_ino = '10260', d_off = '3884',
and reclen = '24'
read ld with d_name = 'c2t11d5s5', d_ino = '10261', d_off = '3904',
and reclen = '24'
read ld with d_name = 'c2t11d5s6', d_ino = '10262', d_off = '3924',
and reclen = '24'
read ld with d_name = 'c2t11d5s7', d_ino = '10263', d_off = '3944',
and reclen = '24'
read ld with d_name = 'c3t8d5s0', d_ino = '10272', d_off = '3964', and
reclen = '24'
read ld with d_name = 'c3t8d5s1', d_ino = '10273', d_off = '3984', and
reclen = '24'
read ld with d_name = 'c3t8d5s2', d_ino = '10274', d_off = '4004', and
reclen = '24'
read ld with d_name = 'c3t8d5s3', d_ino = '10275', d_off = '4024', and
reclen = '24'
read ld with d_name = 'c3t8d5s4', d_ino = '10276', d_off = '4044', and
reclen = '24'
read ld with d_name = 'c3t8d5s5', d_ino = '10277', d_off = '4064', and
reclen = '24'
read ld with d_name = 'c3t8d5s6', d_ino = '10278', d_off = '4096', and
reclen = '24'
read ld with d_name = 'c3t8d5s7', d_ino = '10279', d_off = '4116', and
reclen = '24'
read ld with d_name = 'c2t11d112s0', d_ino = '10126', d_off = '4136',
and reclen = '24'
read ld with d_name = 'c2t11d112s1', d_ino = '10289', d_off = '4156',
and reclen = '24'
read ld with d_name = 'c2t11d112s2', d_ino = '10290', d_off = '4176',
and reclen = '24'
read ld with d_name = 'c2t11d112s3', d_ino = '10291', d_off = '4196',
and reclen = '24'
read ld with d_name = 'c2t11d112s4', d_ino = '10292', d_off = '4216',
and reclen = '24'
read ld with d_name = 'c2t11d112s5', d_ino = '10293', d_off = '4236',
and reclen = '24'
read ld with d_name = 'c2t11d112s6', d_ino = '10294', d_off = '4256',
and reclen = '24'
read ld with d_name = 'c2t11d112s7', d_ino = '10295', d_off = '4276',
and reclen = '24'
read ld with d_name = 'c3t8d112s0', d_ino = '10304', d_off = '4296',
and reclen = '24'
read ld with d_name = 'c3t8d112s1', d_ino = '10305', d_off = '4316',
and reclen = '24'
read ld with d_name = 'c3t8d112s2', d_ino = '10306', d_off = '4336',
and reclen = '24'
read ld with d_name = 'c3t8d112s3', d_ino = '10307', d_off = '4356',
and reclen = '24'
read ld with d_name = 'c3t8d112s4', d_ino = '10308', d_off = '4376',
and reclen = '24'
read ld with d_name = 'c3t8d112s5', d_ino = '10309', d_off = '4396',
and reclen = '24'
read ld with d_name = 'c3t8d112s6', d_ino = '10310', d_off = '4416',
and reclen = '24'
read ld with d_name = 'c3t8d112s7', d_ino = '10311', d_off = '4436',
and reclen = '24'
read ld with d_name = 'c2t11d23s0', d_ino = '10125', d_off = '4456',
and reclen = '24'
read ld with d_name = 'c2t11d23s1', d_ino = '10256', d_off = '4476',
and reclen = '24'
read ld with d_name = 'c2t11d23s2', d_ino = '10324', d_off = '4496',
and reclen = '24'
read ld with d_name = 'c2t11d23s3', d_ino = '10325', d_off = '4516',
and reclen = '24'
read ld with d_name = 'c2t11d23s4', d_ino = '10326', d_off = '4536',
and reclen = '24'
read ld with d_name = 'c2t11d23s5', d_ino = '10327', d_off = '4556',
and reclen = '24'
read ld with d_name = 'c2t11d23s6', d_ino = '10328', d_off = '4576',
and reclen = '24'
read ld with d_name = 'c2t11d23s7', d_ino = '10329', d_off = '4608',
and reclen = '24'
read ld with d_name = 'c2t11d24s0', d_ino = '10338', d_off = '4628',
and reclen = '24'
read ld with d_name = 'c2t11d24s1', d_ino = '10339', d_off = '4648',
and reclen = '24'
read ld with d_name = 'c2t11d24s2', d_ino = '10340', d_off = '4668',
and reclen = '24'
read ld with d_name = 'c2t11d24s3', d_ino = '10341', d_off = '4688',
and reclen = '24'
read ld with d_name = 'c2t11d24s4', d_ino = '10342', d_off = '4708',
and reclen = '24'
read ld with d_name = 'c2t11d24s5', d_ino = '10343', d_off = '4728',
and reclen = '24'
read ld with d_name = 'c2t11d24s6', d_ino = '10344', d_off = '4748',
and reclen = '24'
read ld with d_name = 'c2t11d24s7', d_ino = '10345', d_off = '4768',
and reclen = '24'
read ld with d_name = 'c3t8d23s0', d_ino = '10354', d_off = '4788',
and reclen = '24'
read ld with d_name = 'c3t8d23s1', d_ino = '10355', d_off = '4808',
and reclen = '24'
read ld with d_name = 'c3t8d23s2', d_ino = '10356', d_off = '4828',
and reclen = '24'
read ld with d_name = 'c3t8d23s3', d_ino = '10357', d_off = '4848',
and reclen = '24'
read ld with d_name = 'c3t8d23s4', d_ino = '10358', d_off = '4868',
and reclen = '24'
read ld with d_name = 'c3t8d23s5', d_ino = '10359', d_off = '4888',
and reclen = '24'
read ld with d_name = 'c3t8d23s6', d_ino = '10360', d_off = '4908',
and reclen = '24'
read ld with d_name = 'c3t8d23s7', d_ino = '10361', d_off = '4928',
and reclen = '24'
read ld with d_name = 'c3t8d24s0', d_ino = '10370', d_off = '4948',
and reclen = '24'
read ld with d_name = 'c3t8d24s1', d_ino = '10371', d_off = '4968',
and reclen = '24'
read ld with d_name = 'c3t8d24s2', d_ino = '10372', d_off = '4988',
and reclen = '24'
read ld with d_name = 'c3t8d24s3', d_ino = '10373', d_off = '5008',
and reclen = '24'
read ld with d_name = 'c3t8d24s4', d_ino = '10374', d_off = '5028',
and reclen = '24'
read ld with d_name = 'c3t8d24s5', d_ino = '10375', d_off = '5048',
and reclen = '24'
read ld with d_name = 'c3t8d24s6', d_ino = '10376', d_off = '5068',
and reclen = '24'
read ld with d_name = 'c3t8d24s7', d_ino = '10377', d_off = '5120',
and reclen = '24'

All done with readdir, exiting.
#



On 9/7/06, Cockcroft, Adrian <acockcroft at ebay.com> wrote:
> OK, so it's failing while walking the directory tree, I can see that the
> renew is already in place a line or so earlier.
>
> Its dereferencing a directory structure that isn't there, so a test
> needs to be added to skip this if readdir returns something bad. Its
> already testing for null, so there is something bad happening between
> the null test and the actual usage of the dirp.
>
> http://docs.sun.com/app/docs/doc/819-2243/6n4i099g0?q=readdir&a=view
>
> I'm not sure how to fix this, maybe a second test for null immediately
> before it's de-referenced?
>
> Adrian
>
> -----Original Message-----
> From: Brian Poole [mailto:pooleb at gmail.com]
> Sent: Thursday, September 07, 2006 10:39 AM
> To: Cockcroft, Adrian
> Cc: Dmitry Berezin; Biju Joseph; orca-users at orcaware.com
> Subject: Re: [Orca-users] Orcallator - Segmentation Fault
>
> Here is all of the information I've been able to gather on the crash
> (SE Toolkit 3.4 on Solaris 10). I compiled it fresh using Forte with
> debugging enabled. I took a quick look at trying to find where the
> problem actually lies but was unable to come up with anything useful.
>
> Here is running the disks.se with debug:
>
> # /opt/RICHPse/bin/se.sparcv9 -d /opt/RICHPse/examples/disks.se
> if (count<31> == GLOBAL_diskinfo_size<101>)
> dp = *((dirent_t *) ld<4281687704>)
> if (dp.d_name<c3t8d24s3> == <.> || dp.d_name<c3t8d24s3> == <..>)
> if (!(dp.d_name<c3t8d24s3> =~ <s0$>))
> ld = readdir(dirp<4281664128>)
> if (count<31> == GLOBAL_diskinfo_size<101>)
> dp = *((dirent_t *) ld<4281687736>)
> if (dp.d_name<c3t8d24s4> == <.> || dp.d_name<c3t8d24s4> == <..>)
> if (!(dp.d_name<c3t8d24s4> =~ <s0$>))
> ld = readdir(dirp<4281664128>)
> if (count<31> == GLOBAL_diskinfo_size<101>)
> dp = *((dirent_t *) ld<4281687768>)
> if (dp.d_name<c3t8d24s5> == <.> || dp.d_name<c3t8d24s5> == <..>)
> if (!(dp.d_name<c3t8d24s5> =~ <s0$>))
> ld = readdir(dirp<4281664128>)
> if (count<31> == GLOBAL_diskinfo_size<101>)
> dp = *((dirent_t *) ld<4281687800>)
> Segmentation Fault (core dumped)
>
> So tracking that back shows the segfault occurs on line 215 of
> include/diskinfo.se:
>
>     for (ld = readdir(dirp); ld != 0; ld = readdir(dirp)) {
>       // grow the array if needed
>       if (count == GLOBAL_diskinfo_size) {
>         GLOBAL_diskinfo_size += 4;
>         GLOBAL_disk_info = renew GLOBAL_disk_info[GLOBAL_diskinfo_size];
>       }
>       dp = *((dirent_t *) ld);     <---------
>
> Also the truss output:
>
> # truss -fo /tmp/truss.log /opt/RICHPse/bin/se.sparcv9
> /opt/RICHPse/examples/disks.se
> # tail -15 /tmp/truss.log
> 5967:   ioctl(4, KSTAT_IOC_READ, "sd3547,err")          = 701015
> 5967:   ioctl(4, KSTAT_IOC_CHAIN_ID, 0x00000000)        = 701015
> 5967:   ioctl(4, KSTAT_IOC_READ, "sd2146,err")          = 701015
> 5967:   ioctl(4, KSTAT_IOC_CHAIN_ID, 0x00000000)        = 701015
> 5967:   ioctl(4, KSTAT_IOC_READ, "sd2177,err")          = 701015
> 5967:   ioctl(4, KSTAT_IOC_CHAIN_ID, 0x00000000)        = 701015
> 5967:   ioctl(4, KSTAT_IOC_READ, "sd3935,err")          = 701015
> 5967:   ioctl(4, KSTAT_IOC_CHAIN_ID, 0x00000000)        = 701015
> 5967:   ioctl(4, KSTAT_IOC_READ, "sd1971,err")          = 701015
> 5967:   ioctl(4, KSTAT_IOC_CHAIN_ID, 0x00000000)        = 701015
> 5967:   ioctl(4, KSTAT_IOC_READ, "sd1972,err")          = 701015
> 5967:       Incurred fault #6, FLTBOUNDS  %pc = 0xFF2E08EC
> 5967:         siginfo: SIGSEGV SEGV_MAPERR addr=0xFF356000
> 5967:       Received signal #11, SIGSEGV [default]
> 5967:         siginfo: SIGSEGV SEGV_MAPERR addr=0xFF356000
>
> And perhaps more indicative, the trace:
>
> # /opt/SUNWspro/bin/dbx /opt/RICHPse/bin/se.sparcv9 core
> For information about new features see `help changes'
> To remove this message, put `dbxenv suppress_startup_message 7.5' in
> your .dbxrc
> Reading se.sparcv9
> core file header read successfully
> Reading ld.so.1
> Reading libkvm.so.1
> Reading libkstat.so.1
> Reading libdl.so.1
> Reading libelf.so.1
> Reading libgen.so.1
> Reading libm.so.2
> Reading libsocket.so.1
> Reading libnsl.so.1
> Reading libc.so.1
> Reading libc_psr.so.1
> Reading libmp.so.2
> Reading libmd5.so.1
> Reading libscf.so.1
> Reading libdoor.so.1
> Reading libuutil.so.1
> Reading librt.so.1
> Reading libaio.so.1
> program terminated by signal SEGV (no mapping at the fault address)
> 0xff2e08ec: _memcpy+0x042c:     ldd      [%o1], %c2
> Current function is member_fill
> dbx: warning: can't find file "/tmp/se-src/run.c"
> dbx: warning: see `help finding-files'
> (dbx) where
>   [1] _memcpy(0x129938, 0xff356000, 0x8, 0xfffffffa, 0x4, 0x1), at
> 0xff2e08ec
> =>[2] member_fill(vp = 0x1297f0, area = 0xff355ef8 "", bias = 0), line
> 994 in "run.c"
>   [3] struct_fill(vp = 0x1296b0, area = 0xff355ef8 "", bias = 0), line
> 1043 in "run.c"
>   [4] run_indirection(sp = 0xffbfc4b8), line 1308 in "run.c"
>   [5] run_call(sp = 0xffbfc4b8), line 1608 in "run.c"
>   [6] resolve_expression(vp = 0xffbfcae0, ep = 0x129620, runit = 1),
> line 2892 in "run.c"
>   [7] run_assign(sp = 0x127530), line 1675 in "run.c"
>   [8] run_statement_list(lp = 0x127510), line 513 in "run.c"
>   [9] run_for(sp = 0x12c078), line 2538 in "run.c"
>   [10] run_statement_list(lp = 0x127330), line 513 in "run.c"
>   [11] run_for(sp = 0x12c0b8), line 2538 in "run.c"
>   [12] run_statement_list(lp = 0x121208), line 513 in "run.c"
>   [13] run_block(bp = 0x133288), line 402 in "run.c"
>   [14] run_call(sp = 0xffbfcec8), line 1625 in "run.c"
>   [15] resolve_expression(vp = 0xffbfd450, ep = 0x13cd80, runit = 1),
> line 2892 in "run.c"
>   [16] resolve_l_expression(ep = 0x13ae18), line 2659 in "run.c"
>   [17] run_if(sp = 0x13cf88), line 523 in "run.c"
>   [18] run_statement_list(lp = 0x13cf88), line 513 in "run.c"
>   [19] run_block(bp = 0x1426f8), line 402 in "run.c"
>   [20] se_run(argc = 1, argv = 0x74b88), line 366 in "run.c"
>   [21] main(argc = 2, argv = 0xffbffcc4), line 542 in "main.c"
> *vp = {
>     var_flags      = VF_MEMBER
>     var_special    = 0
>     var_type       = VAR_CHAR
>     var_struct     = (nil)
>     var_name       = 0xc44f0 "d_name"
>     var_qname      = (nil)
>     var_attach_lib = (nil)
>     var_address    = (nil)
>     var_initial    = (nil)
>     var_un         = {
>         var_string  = 0x129840 "c3t8d24s6"
>         var_digit   = 1218624
>         var_udigit  = 1218624U
>         var_ldigit  = 5233950226120704LL
>         var_uldigit = 5233950226120704ULL
>         var_rdigit  = 2.5859149987693e-308
>         var_user    = 0x129840
>         var_array   = 0x129840
>     }
>     var_dimension  = 256
>     var_subscript  = (nil)
>     var_instances  = (nil)
>     var_offset     = 10
>     var_parent     = 0xffbfd588
>     var_next       = (nil)
> }
>
> I would be more than happy to provide any additional information on
> the problem you might need. Feel free to contact me directly on this
> issue.
>
> Thank you,
>
> Brian
>
> On 9/7/06, Cockcroft, Adrian <acockcroft at ebay.com> wrote:
> > It should still be possible to avoid the crash by checking for a null
> at
> > the right point.
> >
> > Is it crashing in kstat read of the iostats, or the devinfo name
> mapping
> > at startup?
> >
> > Adrian
> >
> > -----Original Message-----
> > From: Dmitry Berezin [mailto:dberezin at surfside.rutgers.edu]
> > Sent: Thursday, September 07, 2006 8:43 AM
> > To: Cockcroft, Adrian; 'Biju Joseph'; orca-users at orcaware.com
> > Subject: RE: [Orca-users] Orcallator - Segmentation Fault
> >
> > Adrian,
> >
> > I believe that the actual problem is not with the array sizes, but has
> > to do
> > with the "stale" disk devices. SE "segfaults" when it tries to access
> a
> > device that is not currently present on the system. That is why the
> > problem
> > is usually seen on the clustered systems with shared storage or
> systems
> > with
> > BCV devices that frequently change their state to offline. A number of
> > people had previously reported that rebuilding device tree fixed the
> > problem.
> >
> > I have not had time to look at the code, so I do not know if this
> could
> > be
> > solved by changing scripts or SE itself has to be patched.
> >
> >   -Dmitry.
> >
> >
> > > -----Original Message-----
> > > From: orca-users-bounces+dberezin=acs.rutgers.edu at orcaware.com
> > > [mailto:orca-users-bounces+dberezin=acs.rutgers.edu at orcaware.com] On
> > > Behalf Of Cockcroft, Adrian
> > > Sent: Thursday, September 07, 2006 11:13 AM
> > > To: Biju Joseph; orca-users at orcaware.com
> > > Subject: Re: [Orca-users] Orcallator - Segmentation Fault
> > >
> > > Years ago I fixed the code that looks at disks to resize the array
> > > dynamically, I guess that this code got overwritten at some point,
> but
> > its
> > > a simple fix, just doesn't look much like C code...
> > >
> > > You can use the "renew" keyword to make a new array that is bigger
> and
> > > contains the same items, so figure out where its indexing into the
> > disk
> > > array, check the index and renew the array to be size+10 or
> something.
> > > There's example code in the generic SE disk class, which for some
> > reason
> > > orcallator doesn't seem to use?
> > >
> > > I'm not currently working on a Solaris box, so it will take me a
> while
> > to
> > > get a setup I could test this fix on, probably a few weeks when I
> get
> > back
> > > from a business trip.
> > >
> > > Adrian
> > >
> > > -----Original Message-----
> > > From: orca-users-bounces+acockcroft=ebay.com at orcaware.com on behalf
> of
> > > Biju Joseph
> > > Sent: Thu 9/7/2006 7:28 AM
> > > To: orca-users at orcaware.com
> > > Subject: [Orca-users] Orcallator - Segmentation Fault
> > >
> > > Hello All,
> > >
> > > I am trying to start orcallator on two nodes of VCS cluster ( 4.1 )
> > with
> > > VxVM 4.1 . Database is on EMC disks. Orcallator is giving
> segmentation
> > > fault.
> > >
> > > RICHPse version is 3.4 (03:59 PM 01/05/05).  I tried using
> > orcallator.se
> > > 1.36 and 1.37. Both giving same problem.
> > >
> > > The same combination is working on non clustered systems. All
> systems
> > are
> > > Solaris 10
> > >
> > > Can any of you help.
> > >
> > > Appreciate your help.
> > >
> > > Regards
> > > Biju K Joseph
> > > +91-9866116298
> > >
> > > _______________________________________________
> > > Orca-users mailing list
> > > Orca-users at orcaware.com
> > > http://www.orcaware.com/mailman/listinfo/orca-users
> >
> > _______________________________________________
> > Orca-users mailing list
> > Orca-users at orcaware.com
> > http://www.orcaware.com/mailman/listinfo/orca-users
> >
>



More information about the Orca-users mailing list