Bug 518942 - ksh: warning: job list infinite loop -- this should not happen
Summary: ksh: warning: job list infinite loop -- this should not happen
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: ksh
Version: 11
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: Michal Hlavinka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-08-24 09:52 UTC by André Mostert
Modified: 2009-09-30 01:35 UTC (History)
1 user (show)

Fixed In Version: 20090630-1.fc11
Clone Of:
Environment:
Last Closed: 2009-09-30 01:35:43 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description André Mostert 2009-08-24 09:52:25 UTC
Description of problem:

Occasionally when executing a command in backticks, it will abort and core dump after producing "warning: job list infinite loop -- this should not happen"

Version-Release number of selected component (if applicable):
$ ksh --version 
 version         sh (AT&T Research) 93t+ 2008-12-10

How reproducible:
Easily

Steps to Reproduce:
$ cat joblist.sh 
while true; do
    haha=`echo hoho | sed s/o/a/g `
done

$ ksh joblist.sh
joblist.sh: line 3: warning: job list infinite loop -- this should not happen
Aborted (core dumped)

  
Actual results:


Expected results:


Additional info:

This started happening after updating ksh to obtain the fix for 
https://bugzilla.redhat.com/show_bug.cgi?id=510833

Comment 1 Michal Hlavinka 2009-08-26 15:01:32 UTC
Thanks for this bug report.

I'm not able to reproduce this. How long does it take for you to reproduce this using that reproducer? On what arch?

I'd like to verify new build works before I push it to repository

thanks

Comment 2 André Mostert 2009-08-26 17:35:44 UTC
Thanks for looking at the bug report! :-)

$ uname -a
Linux andre 2.6.29.5-191.fc11.x86_64 #1 SMP Tue Jun 16 23:23:21 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

Usually I'll get it within a few seconds, but sometimes it takes longer.

I've installed the debuginfo gdb asked for so I can now give you a stacktrace from the corefile, hope this helps.

Reading symbols from /lib64/libdl-2.10.1.so...Reading symbols from /usr/lib/debug/lib64/libdl-2.10.1.so.debug...done.
done.
Loaded symbols for /lib64/libdl-2.10.1.so
Reading symbols from /lib64/libm-2.10.1.so...Reading symbols from /usr/lib/debug/lib64/libm-2.10.1.so.debug...done.
done.
Loaded symbols for /lib64/libm-2.10.1.so
Reading symbols from /lib64/libc-2.10.1.so...Reading symbols from /usr/lib/debug/lib64/libc-2.10.1.so.debug...done.
done.
Loaded symbols for /lib64/libc-2.10.1.so
Reading symbols from /lib64/ld-2.10.1.so...Reading symbols from /usr/lib/debug/lib64/ld-2.10.1.so.debug...done.
done.
Loaded symbols for /lib64/ld-2.10.1.so
Core was generated by `ksh joblist.sh'.
Program terminated with signal 6, Aborted.
#0  0x00000038bd6332f5 in *__GI_raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64        return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
(gdb) bt
#0  0x00000038bd6332f5 in *__GI_raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00000038bd634b20 in *__GI_abort () at abort.c:88
#2  0x0000000000416447 in job_chksave (pid=30310) at /usr/src/debug/ksh-20081212/src/cmd/ksh93/sh/jobs.c:1760
#3  0x0000000000417689 in job_subrestore (ptr=<value optimized out>) at /usr/src/debug/ksh-20081212/src/cmd/ksh93/sh/jobs.c:1813
#4  0x000000000043b733 in sh_subshell (t=<value optimized out>, flags=<value optimized out>, comsub=<value optimized out>)
    at /usr/src/debug/ksh-20081212/src/cmd/ksh93/sh/subshell.c:616
#5  0x00000000004238ab in comsubst (mp=<value optimized out>, t=0x19c87e0, type=1) at /usr/src/debug/ksh-20081212/src/cmd/ksh93/sh/macro.c:1951
#6  0x00000000004232e8 in copyto (mp=0x19be0e0, endch=<value optimized out>, newquote=<value optimized out>) at /usr/src/debug/ksh-20081212/src/cmd/ksh93/sh/macro.c:581
#7  0x0000000000423615 in sh_mactrim (shp=<value optimized out>, str=0x19c8531 "haha=`echo $$ | sed s/o/a/g > lastpid`", mode=-1)
    at /usr/src/debug/ksh-20081212/src/cmd/ksh93/sh/macro.c:173
#8  0x000000000042aff3 in nv_setlist (arg=0x19c8520, flags=131584) at /usr/src/debug/ksh-20081212/src/cmd/ksh93/sh/name.c:324
#9  0x0000000000440f09 in sh_exec (t=<value optimized out>, flags=<value optimized out>) at /usr/src/debug/ksh-20081212/src/cmd/ksh93/sh/xec.c:815
#10 0x0000000000441497 in sh_exec (t=<value optimized out>, flags=<value optimized out>) at /usr/src/debug/ksh-20081212/src/cmd/ksh93/sh/xec.c:1703
#11 0x000000000040787a in exfile ()
#12 0x0000000000406d15 in sh_main ()
#13 0x00000038bd61ea2d 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=0x7fff161af4b8) at libc-start.c:220
#14 0x0000000000406039 in _start ()

Comment 3 Michal Hlavinka 2009-08-27 06:22:59 UTC
thanks for the info, I can reproduce it now. It's easier to reproduce if system is under load.

FYI, this bug existed in all previous ksh versions (at least since 20080220), but only this version got an internal check for looped job list instead of using corrupted list, so this is not a new bug, but it is a known one.

I'll check if latest version is fixed or ask upstream for help.

Comment 4 Fedora Update System 2009-08-27 10:56:19 UTC
ksh-20090630-1.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/ksh-20090630-1.fc11

Comment 5 Fedora Update System 2009-08-27 22:51:39 UTC
ksh-20090630-1.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update ksh'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-9050

Comment 6 Fedora Update System 2009-09-30 01:35:36 UTC
ksh-20090630-1.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.