Ticket #4480 (reopened defect)

Opened 18 months ago

Last modified 5 weeks ago

MC hungs for 1-2 second when open folder plus side-effects

Reported by: Bishop Owned by:
Priority: minor Milestone:
Component: mc-core Version: 4.8.29
Keywords: Cc:
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description (last modified by zaytsev) (diff)

When i try enter one of folowing folders

  /Home/Incoming/Anime/Wait for Store/[2021Q3] Otome Game no Hametsu Flag shika Nai Akuyaku Reijou ni Tensei shiteshimatta X [++]
  /Home/Incoming/Anime/Wait for Store/[2021Q4] Shin no Nakama ja Nai to Yuusha no Party wo Oidasareta node, Henkyou de Slow Life suru Koto ni Shimashita [++]

MC hungs for 1-2 seconds. After it if i try quit MC via F10 i got "The shell is still active" warning. If i switch to shell (Ctrl+O) i see clean shell. But if i press Enter i see those command

cd "printf '%b' '\0057Home\0057Incoming\0057Anime\0057Wait\0040for\0040Store\0057\01332021Q3\0135\0040Otome\0040Game\0040no\0040Hametsu\0040Flag\0040shika\0040Nai\0040Akuyaku\0040Reijou\0040ni\0040Tensei\0040shiteshimatta\0040X\0040\0133\0053\0053\0135'"

I use Oracle Solaris if this is matter. Bug also exist in 4.8.28.

Attachments

profile (4.4 KB) - added by Bishop 18 months ago.
/etc/profile that lead to bug
mc-4.8.31-subshell.patch (297 bytes) - added by Bishop 5 weeks ago.
ugly way to fix problem

Change History

comment:1 Changed 18 months ago by zaytsev

Is this some kind of remote filesystem, or it's just a "normal" folder on your filesystem? What shell are you using? It seems that because of some delays the directories get desynchronised between mc and subshell.

comment:2 Changed 18 months ago by Bishop

Normal folder with 12 files. If i change its name its work fine. So, i think, only reason can be in this full path (because if i move it in another place its again works fine).

I use bash.

comment:3 Changed 18 months ago by zaytsev

  • Description modified (diff)

comment:4 Changed 18 months ago by zaytsev

This is weird. I did (on Ubuntu Linux)

mkdir -p "Home/Incoming/Anime/Wait for Store/[2021Q3] Otome Game no Hametsu Flag shika Nai Akuyaku Reijou ni Tensei shiteshimatta X [++]"

and can walk without any problems. Can you make a reproducer?

Changed 18 months ago by Bishop

/etc/profile that lead to bug

comment:5 Changed 18 months ago by Bishop

1) In your cmd you forgot leading "/" in path.
2) I check problem on Alpine Linux 3.17 and it is not exist.
3) If i change shell type to sh problem is gone.
4) And if i complitly disable my "profile" and "bashrc" config files - problem are gone.

OK. Looks like a problem in profile file (now, for tests, bashrc is justs moved out). So i find point:
if "/etc/profile" is empty - all works;
if "/etc/profile" have minimal text - all works, but...
i can`t undestand bug exist conditions, because file that i attach dont work (and yes, comment strings in it is source of problem too, because if i remove them - all start works).

The only one idea i have - problem connected with time that processing of "/etc/profile" takes. And timeout is realy very very small (some ms, or even us).

comment:6 Changed 18 months ago by Bishop

MC 4.8.29 hungs for more time (~2s) that 4.8.28 (~0.5s).
mc -V provides:

GNU Midnight Commander 4.8.29
Built with GLib 2.66.7
Built with S-Lang 2.3.3 with terminfo database
Built with libssh2 1.9.0
With builtin Editor
With subshell support as default
With mouse support on xterm
With internationalization support
With multiple codepages support
Virtual File Systems:
 cpiofs, tarfs, sfs, extfs, sftpfs
Data types:
 char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;

comment:7 Changed 2 months ago by zaytsev

  • Status changed from new to closed
  • Resolution set to invalid
  • Milestone Future Releases deleted

Problem with user profile / HISTCONTROL settings / prompt.

comment:8 follow-up: ↓ 9 Changed 5 weeks ago by Bishop

  • Status changed from closed to reopened
  • Resolution invalid deleted

Problem with user profile / HISTCONTROL settings / prompt.

Looks like not. I make deeper search and find that when MC hung, on shell leave string like:
cd "printf '%b' '\0057Home\0057Incoming\0057Anime\0057Wait\0040for\0040Store\0057\01332021Q3\0135\0040Otome\0040Game\0040no\0040Hametsu\0040Flag\0040shika\0040Nai\0040Akuyaku\0040Reijou\0040ni\0040Tensei\0040shiteshimatta\0040X\0040\0133\0053\0053\0135'"
And as i see its cut by 256 chars. With other folders problem same - result of subshell_name_quote somehow cutted to 256 chars and so command for shell is not full. Shell wait till command will be full so it hung.

comment:9 in reply to: ↑ 8 ; follow-up: ↓ 10 Changed 5 weeks ago by andrew_b

Replying to Bishop:

\0057Home\0057Incoming\0057Anime\0057Wait\0040for\0040Store\0057\01332021Q3\0135\0040Otome\0040Game\0040no\0040Hametsu\0040Flag\0040shika\0040Nai\0040Akuyaku\0040Reijou\0040ni\0040Tensei\0040shiteshimatta\0040X\0040\0133\0053\0053\0135

Could you please show this untruncated path as raw?

comment:10 in reply to: ↑ 9 Changed 5 weeks ago by Bishop

Replying to andrew_b:

Could you please show this untruncated path as raw?

/Home/Incoming/Anime/Wait for Store/[2021Q3] Otome Game no Hametsu Flag shika Nai Akuyaku Reijou ni Tensei shiteshimatta X [++]

Both test path are in ticket description.

P.S. Looks like i found dirty solution. Tomorrow i complitly check it and post here.

Last edited 5 weeks ago by Bishop (previous) (diff)

comment:11 Changed 5 weeks ago by Bishop

Source file: src/subshell/common.c
Function: write_all
If after string "ret = write (fd, (const unsigned char *) buf + written, count);" i add "usleep(5000);" hangs goes much rarer.
If i change this string to "ret = write (fd, (const unsigned char *) buf + written, count>128?128:count); usleep(5000);" all hangs is gone.

comment:12 Changed 5 weeks ago by zaytsev

So can it be that it's the same as #4253 ? The paths are so big that there is interference in command parsing? Unfortunately, there is no patch.

comment:13 Changed 5 weeks ago by Bishop

So can it be that it's the same as #4253 ?

Can`t say. For me key of problem is buffer size betwean MC and Bash. If write not so big chunks and get a bit time to Bash read data - all ok.

Unfortunately, there is no patch.

Whole patch i comment 11. If you need it in patch file - ok, i make it.

Changed 5 weeks ago by Bishop

ugly way to fix problem

Note: See TracTickets for help on using tickets.