-
Notifications
You must be signed in to change notification settings - Fork 3
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 crash when copying files between panels (F5) under FreeBSD 9.3 #3617
Comments
mc 4.8.15 worked OK. mc 4.8.16 coredumps:
FreeBSD 8.4 i386, gcc.
Line 202 in /usr/ports/misc/mc/work/mc-4.8.16/lib/vfs/interface.c :
This line 202 is in the function:
Eugene Grosbein noticed that while compiling:
interface.c: In function 'mc_open':
He offered a patch:
|
Eugene Grosbein's patch |
Holy shit, we should fix that for the next release. Thanks for the investigation and the patch! |
Here's a better patch. See explanation in its commit message.
@lena: Could you please test the patch? It should work but I want to verify that GCC doesn't print a warning.
(As for why I used if else instead of the ternary operator in Gnulib's manual page: that's because of 'indent'.) |
|
(BTW, other places where we use va_arg all look kosher.) |
Replying to mooffie:
|
Hmmm, judging from the mailing list thread you linked to, I personally feel better about a configure-time solution... |
Replying to zaytsev-work:
sizeof() is compile-time operator. So optimizing compiler will leave only one branch in binary code. |
Replying to andrew_b:
This is certainly true, but in the mailing list thread reference above, however, people are complaining that it will still produce a warning for the inactive branch (see comment:5), which is why they have chosen a configure-time solution in the end. |
Replying to zaytsev-work:
So I'm attaching an updated patch that uses their (Gnulib's) solution.
(For the record: alternatively, we can add "AC_CHECK_SIZEOF(int)" and "AC_CHECK_SIZEOF(mode_t)" to our configure.ac and do "#if SIZEOF_MODE_T < SIZEOF_INT" in our C.) |
|
(BTW, I didn't know if our "coding standards" call for an explicit cast when assigning 'int' to 'mode_t', so I left it out.) |
Branch: 3617_freebsd_crash |
mooffie, thank you very much for your help! |
With the last patch (3617-mc_open-handle-varargs-mode_t-promotion-issue--v2.patch):
I just noticed that with the initial patch (interface.patch) mc does something funny in a "sh:" panel: takes much more time to connect, read directories and show the panel, and where filenames should be, it shows date-times and partial (truncated or something) filenames. I was afraid that it can damage data and downgraded to 4.8.15. |
|
Replying to Lena:
If this sounds like Chinese to you, don't worry: you can instead use the tarball I uploaded here:
http://www.typo.co.il/~mooffie/tmp/mc/mc-4.8.16-5-g55a208b.tar.gz
So please try it out (either the tarball or 'autoreconf') and let us know the result. |
I'm afraid that simply doing autoreconf -vfi isn't going to work and you really need to run the autogen.sh for the moment. I'm not sure what the problem is, but it didn't work last time I've tried and I didn't have time to investigate what needs to be done to finally ditch autogen.sh and move to autoreconf.
Of course, I'll be only happy to know if the problem has resolved itself in the meantime. |
Replying to zaytsev-work:
This is very strange. I use autogen.sh every time when I build mc and it works fine for me. |
Replying to mooffie:
I did "make clean" (nothing from the previous bulid remained) and used FreeBSD ports system to do everything from the very beginning. I just did it again, same error:
|
Ah, I understood, the script is contained in the distribution tarball. I used your tarball, now everything works. |
Replying to andrew_b:
This comment didn't pertain to autogen.sh, I talking about autoreconf not being enough and the necessity to use autogen.sh... |
Note that FreeBSD bug report 208027 has been raised to fix this problem in the FreeBSD mc packages prior to the 4.8.17 release. Since FreeBSD ports use the release tarballs, the patch proposed for inclusion is based on "3617-mc_open-handle-varargs-mode_t-promotion-issue--v2.patch" but includes all the changes from re-running autogen.sh. |
Replying to zaytsev-work:
Andrew / Yury: Do you see any problem with the patch? Considering that it's from Gnulib and used in some projects I don't think there's a reason to worry. |
I've only had time to re-push the branch so far, didn't get to testing it yet though, sorry. |
|
|
|
|
Important
This issue was migrated from Trac:
dmic
(dmic@….ru)dmic@….ru
,Lena@….kiev.ua
I did the update on multiple computers under FreeBSD 9.3 and 10.1
Midnight Commander crashes on FreeBSD 9.3 and normaly runing on a FreeBSD 10.1 when copiing files between panels (F5)
FreeBSD 9.3-RELEASE-p35 FreeBSD 9.3-RELEASE-p35 #0 [294908]:
GNU Midnight Commander 4.8.16
Built with GLib 2.46.2
Using the S-Lang library with terminfo database
With builtin Editor
With subshell support as default
With support for background operations
With mouse support on xterm
With internationalization support
With multiple codepages support
Virtual File Systems: cpiofs, tarfs, sfs, extfs, ftpfs, sftpfs, fish
Data types: char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;
# LC_MESSAGES=C mc -F
Root directory: /root
[System data]
[User data]
# mc --configure-options
Note
Original attachments:
Lena
(Lena@….kiev.ua) onMar 15, 2016 at 14:35 UTC
mooffie
(@mooffie) onMar 15, 2016 at 22:59 UTC
mooffie
(@mooffie) onMar 16, 2016 at 16:04 UTC
The text was updated successfully, but these errors were encountered: