[2.2.17] poll(2) bug/race condition?

From: Matthias Andree (matthias.andree@stud.uni-dortmund.de)
Date: Fri Sep 22 2000 - 06:50:54 EDT

  • Next message: Robert Redelmeier: "SMP APIC spurrious int wierdness"

    Playing with Uwe Ohse's ftpcopy 0.3.2 (which I like a lot), I found
    strange behaviour in poll(). Does not happen under FreeBSD 4.0.

    Preface: ftpcopy is an FTP client (mirroring agent, actually) that uses
    poll(). Available on http://www.ohse.de/uwe/ftpcopy.html

    Now, if I suspend ftpcopy (^Z in bash) and resume it like 5 seconds
    later, I get ENOSYS back from poll. (sometimes, strace does not log the
    signal, poll then returns EINTR properly.)

    The problem in this is that strace-4.1 that I've been using is
    documented that the process ignores SIGSTOP, but I don't currently know
    of another way to trigger this behaviour.

    Kernel 2.2.17 with openwall security patch, reiserfs, ide, lm_sensors,
    i2c patches and dc390 driver 2.0e2.

    WARNING: If you try to reproduce this, CALL FTPCOPY FROM AN EMPTY
    -------- DIRECTORY! ftpcopy removes files that are not present on the
             server, that's why, thus, if you run ftpcopy with `pwd` =
             /usr/src/linux, it will hurt you bad.

    Reding through Linux' and SUS v2's poll() man pages, ENOSYS is not
    specified as error condition, just ENOMEM, EFAULT, EINTR for Linux. SUS
    v2 documents EAGAIN, EINVAL and EINTR.

    strace log is as follows:

    poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, 30020) = 1
    read(3, "250 CWD command successful.\r\n", 8192) = 29
    gettimeofday({969616706, 131134}, NULL) = 0
    poll([{fd=3, events=POLLOUT, revents=POLLOUT}], 1, 30020) = 1
    write(3, "LIST\r\n", 6) = 6
    gettimeofday({969616706, 132726}, NULL) = 0
    poll( <unfinished ...>
    --- SIGCONT (Fortgesetzt) ---
    <... poll resumed> [{fd=3, events=POLLIN}], 1, 30020) = -1 ENOSYS
    (Function not implemented)
    ftpcopywrite(2, ": ", 2: ) = 2
    write(2, "read (LIST answer)", 18read (LIST answer)) = 18
    write(2, ": ", 2: ) = 2
    write(2, "timed out", 9timed out) = 9
    write(2, "\n", 1
    ) = 1
    _exit(1) = ?

    -- 
    Matthias Andree
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    Please read the FAQ at http://www.tux.org/lkml/
    



    This archive was generated by hypermail 2b29 : Fri Sep 22 2000 - 06:55:35 EDT