- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 5
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 hangs accessing files within a .tar.gz within a cpio within an rpm for first 60 seconds #4147
Comments
Patch to fix the bug |
|
Remembering discussion #3859, I think it's time to drop mc_timer and use g_get_real_time(). There is no difference what time to use: relative to mc start moment or relative to UNIX epoch. |
Branch: 4147_vfs_timeout
Please test. |
Branch 4147_vfs_timeout works for me. So that is another way to solve the problem. I still think that you should consider avoiding the subtraction of vfs_timeout seconds from an unsigned type, though. That's always a bit dangerous. I would consider that the real bug, which was exposed by using mc_timer and could potentially reoccur if a future change goes back to a relative time since startup of mc. That said, your fix does avoid the issue. |
Replying to nvwarr:
guint64 is replaced with gint64 for all related variables and structure members.
mc_timer is removed in the 2nd commit in this branch. |
Oops, I missed the change to gint64. That's perfect then. |
|
Merged to master: [446a031].
|
|
Important
This issue was migrated from Trac:
nvwarr
(nvwarr@….com)In lib/vfs/gc.c in the function vfs_expire, curr_time and exp_time are declared guint64. curr_time is initialised with a timestamp and exp_time with this timestamp minus 60 seconds. Later there is if (stamping->time <= exp_time). Prior to commit [a94dd7d] curr_time was initialised with a value larger than 60 seconds, so everything was fine. This commit changed the initialisation to a timer starting when mc is started. So for the first 60 seconds, the result of the subtraction is negative, but it is a guint64, so we just get a VERY large unsigned value and the if (stamping->time <= exp_time) is always true. So mc thinks the vfs hasn't been used recently and goes into an infinite loop.
If one opens a .rpm file with mc and goes into the CONTENTS.cpio and then tries to go into the .tar.gz there (this is the usual structure of a .rpm) after waiting 60 seconds, everything is fine. However, before 60 seconds, mc hangs. There may be other ways to trigger this, but this is how I discovered it.
The fix is to remove the subtraction of 60 seconds when initialising exp_time and add them to the left-hand side of the comparison.
Note
Original attachments:
nvwarr
(nvwarr@….com) onNov 19, 2020 at 10:07 UTC
The text was updated successfully, but these errors were encountered: