Package: mc
Version: 3:4.8.30-1

Dear Maintainer,

If a terminal window's resized at a "bad time", mc's panels seem to keep
their old sizes indefinitely--even I press CTRL-L or navigate to another
directory.  Oddly, the command bar at the bottom of the screen ("1Help",
etc.) does seem to be drawn with the proper width, but not on the proper
line.  The rest of the interface doesn't react at all.

I sometimes notice this if I navigate into a large directory, and resize
the window while the "spinner" is animating at the top-right corner.  It
can be difficult to reproduce once Linux has the data cached.

I've had some luck using an LD_PRELOAD library that hooks readdir() with
a usleep() call inserted.  I'll attach that.  To use it:
        gcc -shared -o readdir-usleep.so readdir-usleep.c
        export LD_PRELOAD="$(pwd)/readdir-usleep.so"
        cd /var/lib  # or something with about 50 files
        mc
When mc clears the screen and starts animating the "/" at the top-right,
enlarge the terminal window.  I'm using urxvt (rxvt-unicode).

I'm experimenting with an automated version of this test, but don't know
how reliable it will be.

- Michael


-- System Information:
Debian Release: trixie/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable'), (500, 'testing'), (1, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 6.6.9-amd64 (SMP w/32 CPU threads; PREEMPT)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_CA:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages mc depends on:
ii  libc6         2.37-13
ii  libext2fs2    1.47.0-2+b1
ii  libglib2.0-0  2.78.3-1
ii  libgpm2       1.20.7-10+b2
ii  libslang2     2.3.3-3
ii  libssh2-1     1.11.0-4
ii  mc-data       3:4.8.30-1

Versions of packages mc recommends:
ii  mailcap         3.70+nmu1
ii  perl            5.38.2-2
ii  sensible-utils  0.0.20
ii  unzip           6.0-28

Versions of packages mc suggests:
pn  arj                              <none>
ii  atril [pdf-viewer]               1.26.1-3
ii  bzip2                            1.0.8-5+b2
pn  dbview                           <none>
pn  djvulibre-bin                    <none>
ii  epub-utils                       0.2.2-6
ii  evince [pdf-viewer]              45.0-1+b1
ii  file                             1:5.45-2+b1
ii  genisoimage                      9:1.1.11-3.4
ii  gv [pdf-viewer]                  1:3.7.4-2+b1
ii  imagemagick                      8:6.9.12.98+dfsg1-5+b1
ii  imagemagick-6.q16 [imagemagick]  8:6.9.12.98+dfsg1-5+b1
ii  libaspell-dev                    0.60.8.1-1+b1
ii  links                            2.29-1+b1
ii  lynx                             2.9.0dev.12-1
ii  mupdf [pdf-viewer]               1.23.7+ds1-1
pn  odt2txt                          <none>
ii  poppler-utils                    22.12.0-2+b1
pn  python                           <none>
pn  python-boto                      <none>
pn  python-tz                        <none>
ii  texlive-binaries                 2023.20230311.66589-8
ii  unar                             1.10.7+ds1+really1.10.1-2+b3
pn  wimtools                         <none>
ii  zip                              3.0-13

-- no debconf information

#define _GNU_SOURCE    // make dlfcn.h define RTLD_NEXT
#include <dirent.h>
#include <dlfcn.h>
#include <errno.h>
#include <unistd.h>

struct dirent *
readdir(DIR *dirp)
{
        struct dirent *ret = NULL;
        struct dirent *(*real_fn)(DIR*);

        usleep(100000);

        real_fn = dlsym(RTLD_NEXT, __func__);
        if (!real_fn) {
                errno = ELIBACC;
                goto out;
        }
        ret = real_fn(dirp);
out:
        return ret;
}

Attachment: signature.asc
Description: PGP signature

Reply via email to