Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mc-butler opened this issue Jul 5, 2023 · 15 comments
Open

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

mc-butler opened this issue Jul 5, 2023 · 15 comments
Labels
area: core Issues not related to a specific subsystem prio: low Minor problem or easily worked around ver: 4.8.29 Reproducible in version 4.8.29

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/4480
Reporter Bishop (bishop-mc@….org)

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.

Note

Original attachments:

@mc-butler
Copy link
Author

Changed by zaytsev (@zyv) on Jul 5, 2023 at 8:32 UTC (comment 1)

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.

@mc-butler
Copy link
Author

Changed by Bishop (bishop-mc@….org) on Jul 5, 2023 at 16:38 UTC (comment 2)

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.

@mc-butler
Copy link
Author

Changed by zaytsev (@zyv) on Jul 5, 2023 at 19:11 UTC (comment 3)

  • Description edited

@mc-butler
Copy link
Author

Changed by zaytsev (@zyv) on Jul 5, 2023 at 19:14 UTC (comment 4)

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?

@mc-butler
Copy link
Author

Changed by Bishop (bishop-mc@….org) on Jul 6, 2023 at 4:41 UTC

/etc/profile that lead to bug

@mc-butler
Copy link
Author

Changed by Bishop (bishop-mc@….org) on Jul 6, 2023 at 4:42 UTC (comment 5)

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).

@mc-butler
Copy link
Author

Changed by Bishop (bishop-mc@….org) on Jul 6, 2023 at 4:48 UTC (comment 6)

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;

@mc-butler
Copy link
Author

Changed by zaytsev (@zyv) on Oct 8, 2024 at 9:44 UTC (comment 7)

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

Problem with user profile / HISTCONTROL settings / prompt.

@mc-butler
Copy link
Author

Changed by Bishop (bishop-mc@….org) on Nov 18, 2024 at 13:34 UTC (comment 8)

  • 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.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Nov 18, 2024 at 14:40 UTC (comment 8.9)

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?

@mc-butler
Copy link
Author

Changed by Bishop (bishop-mc@….org) on Nov 18, 2024 at 18:51 UTC (comment 9.10)

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.

@mc-butler
Copy link
Author

Changed by Bishop (bishop-mc@….org) on Nov 19, 2024 at 11:32 UTC (comment 11)

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.

@mc-butler
Copy link
Author

Changed by zaytsev (@zyv) on Nov 19, 2024 at 14:24 UTC (comment 12)

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.

@mc-butler
Copy link
Author

Changed by Bishop (bishop-mc@….org) on Nov 20, 2024 at 11:39 UTC (comment 13)

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.

@mc-butler
Copy link
Author

Changed by Bishop (bishop-mc@….org) on Nov 20, 2024 at 11:40 UTC

ugly way to fix problem

@mc-butler mc-butler reopened this Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: core Issues not related to a specific subsystem prio: low Minor problem or easily worked around ver: 4.8.29 Reproducible in version 4.8.29
Development

No branches or pull requests

1 participant