Hi,

we've got a few reports that latest ksh (2010-03-09) and older version 
(2010-02-02) crashes in path_checkdup once a while. Crashes are quite rare and 
not easy to reproduce. Reporter has suspicion it's caused by "cd" builtin 
together with directory permissions, but it's just his guess. Backtrace 
(created by automatic bug reporting tool) shows it fails in sh/path.c : 
path_checkdup line 405:

405: first = (pp->flags&PATH_CDPATH)?pp->shp->cdpathlist:path_get("");

Looking into backtrace, pp is not null and because this is the top of the 
stack path_get should not be problem too. But then only pp->shp->cdpathlist 
remains with only possibility shp==null, which seems quite hard to believe for 
me. Anyway, maybe you can find some information in backtrace. (There is no 
working reproducer.)

Regards,
Michal Hlavinka

Backtrace:
Core was generated by `-ksh'.
Program terminated with signal 11, Segmentation fault.
#0  0x0000000000440b34 in path_checkdup (pp=0x1f64410)
    at /usr/src/debug/ksh-20100202/src/cmd/ksh93/sh/path.c:405
405     /usr/src/debug/ksh-20100202/src/cmd/ksh93/sh/path.c: No such file or 
directory.
        in /usr/src/debug/ksh-20100202/src/cmd/ksh93/sh/path.c

Thread 1 (Thread 11930):
#0  0x0000000000440b34 in path_checkdup (pp=0x1f64410)
    at /usr/src/debug/ksh-20100202/src/cmd/ksh93/sh/path.c:405
        name = 0x1f64468 "/home/jhf"
        oldpp = <value optimized out>
        first = <value optimized out>
        flag = 0
        statb = {st_dev = 64769, st_ino = 2883585, st_nlink = 5, 
          st_mode = 16832, st_uid = 502, st_gid = 502, __pad0 = 0, 
          st_rdev = 0, st_size = 4096, st_blksize = 4096, st_blocks = 8, 
          st_atim = {tv_sec = 1267199393, tv_nsec = 37260070}, st_mtim = {
            tv_sec = 1267465474, tv_nsec = 329517807}, st_ctim = {
            tv_sec = 1267465474, tv_nsec = 329517807}, __unused = {0, 0, 0}}
#1  0x0000000000441078 in path_nextcomp (pp=0x1f64410, name=0x1f38581 "sbi", 
    last=0x0) at /usr/src/debug/ksh-20100202/src/cmd/ksh93/sh/path.c:442
        ppnext = 0x0
#2  0x000000000045a49c in b_cd (argc=<value optimized out>, 
    argv=<value optimized out>, extra=<value optimized out>)
    at /usr/src/debug/ksh-20100202/src/cmd/ksh93/bltins/cd_pwd.c:124
        dir = 0x1f38581 "sbi"
        cdpath = 0x1f64410
        dp = 0x1f64468 "/home/jhf"
        saverrno = 0
        rval = <value optimized out>
        flag = 0
        oldpwd = 0x1f64490 "/usr/share/BackupPC/bin"
        opwdnod = <value optimized out>
        pwdnod = <value optimized out>
#3  0x000000000044efb9 in sh_exec (t=<value optimized out>, 
    flags=<value optimized out>)
    at /usr/src/debug/ksh-20100202/src/cmd/ksh93/sh/xec.c:1008
        scope = 0
        was_vi = <value optimized out>
        buff = {buff = {{__jmpbuf = {0, 617476319647996028, 1, 
                140736417801872, 0, 0, -617495549295880068, 
                617476904735709308}, __mask_was_saved = 0, __saved_mask = {
                __val = {16, 32694800, 4729111, 32749776, 47244640255, 
                  32817360, 4292116, 32736545, 32694800, 7564640, 5174368, 0, 
                  2, 0, 4351810, 32753136}}}}, prev = 0x7fffc030a350, 
          topfd = 0, mode = 6, olist = 0x0, err = {context = 0x0, errors = 0, 
            flags = 1, line = 1, warnings = 0, file = 0x0, 
            id = 0x1f43ee0 "-ksh"}}
        was_gmacs = <value optimized out>
        statb = {st_dev = 0, st_ino = 0, st_nlink = 0, st_mode = 0, 
          st_uid = 0, st_gid = 0, __pad0 = 0, st_rdev = 0, st_size = 0, 
          st_blksize = 0, st_blocks = 0, st_atim = {tv_sec = 0, tv_nsec = 0}, 
          st_mtim = {tv_sec = 0, tv_nsec = 0}, st_ctim = {tv_sec = 0, 
            tv_nsec = 0}, __unused = {0, 0, 0}}
        share = 0
        jmpval = <value optimized out>
        was_emacs = <value optimized out>
        bp = <value optimized out>
        argv = {0x1 <Address 0x1 out of bounds>}
        tflags = <value optimized out>
        argp = <value optimized out>
        np = <value optimized out>
        io = <value optimized out>
        command = <value optimized out>
        flgs = <value optimized out>
        trap = <value optimized out>
        nq = 0x0
        last_table = <value optimized out>
        com = <value optimized out>
        argn = 2
        skipexitset = 0
        mainloop = <value optimized out>
        cp = 0x0
        type = <value optimized out>
        execflg2 = <value optimized out>
        ntflag = <value optimized out>
        com0 = <value optimized out>
        was_interactive = 0
        echeck = 1
#4  0x0000000000407c1c in exfile ()
No symbol table info available.
#5  0x0000000000407096 in sh_main ()
No symbol table info available.
#6  0x000000361821eb1d in __libc_start_main (main=<value optimized out>, 
    argc=<value optimized out>, ubp_av=<value optimized out>, 
    init=<value optimized out>, fini=<value optimized out>, 
    rtld_fini=<value optimized out>, stack_end=<value optimized out>)
    at libc-start.c:226
        result = <value optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {0, 617476319647996028, 
                4219728, 140736417801872, 0, 0, -617495549623035780, 
                647822575134939260}, mask_was_saved = 0}}, priv = {pad = {
              0x0, 0x0, 0x3617e0e22f, 0x0}, data = {prev = 0x0, 
              cleanup = 0x0, canceltype = 400613935}}}
        not_first_call = <value optimized out>
#7  0x0000000000406379 in _start ()
_______________________________________________
ast-developers mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-developers

Reply via email to