Bug 253796 - misc/mc: GLib-ERROR **: 15:55:28.036: ../glib/gmem.c:113: failed to allocate 18446744073709551588 bytes
Summary: misc/mc: GLib-ERROR **: 15:55:28.036: ../glib/gmem.c:113: failed to allocate ...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Alexey Dokuchaev
URL: https://midnight-commander.org/ticket...
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-23 15:07 UTC by Marco Beishuizen
Modified: 2021-08-20 09:06 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marco Beishuizen 2021-02-23 15:07:11 UTC
Hi,

I get a glib error when trying to save a file by hitting F2 in mc. But it only happens when mc is running as root in an xterm, it doesn't happen when mc runs as user. As soon as I hit F2 I get:

...
(mc:73921): GLib-ERROR **: 15:55:28.036: ../glib/gmem.c:113: failed to allocate 18446744073709551588 bytes
                          Trace/BPT trap
...


Seems a lot of bytes what it's trying to allocate.
After the crash the xterm is also broken, scrolling with the mouse etc.

Regards,
Marco
Comment 1 Ben Woods freebsd_committer freebsd_triage 2021-05-22 02:24:04 UTC
Sorry, due to a lack of time I have reset the maintainer of this port back to ports@FreeBSD.org. Hopefully someone else is able to step in to help.
Resetting the assignee of this bug accordingly.
Comment 2 Marco Beishuizen 2021-05-22 09:24:43 UTC
Discovered that it has something to do with setting ncurses. Using the default slang works without problems.
Comment 3 Alexey Dokuchaev freebsd_committer freebsd_triage 2021-06-24 08:28:39 UTC
I've rebuilt misc/mc with Ncurses instead of S-Lang, but could not reproduce this bug, under any user, X11 (xterm) or bare console.  We need more information, ideally the exact steps that definitely lead to a crash.
Comment 4 Alexey Dokuchaev freebsd_committer freebsd_triage 2021-06-27 08:06:44 UTC
(In reply to Alexey Dokuchaev from comment #3)
> We need more information [...]
Nevermind, I've reproduced the crash and got a core dump.  The problem is with drawing shadows when the dialog window does not fit the screen (shrink your xterm window small enough and it will start crashing on every fart).  Should not be hard to fix; meanwhile, you can run mc(1) in colorless mode (with -b switch) to avoid hitting buggy code path.
Comment 5 commit-hook freebsd_committer freebsd_triage 2021-08-20 09:04:12 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=27d49c4c907fff7d64f82d400fd0897464f796dd

commit 27d49c4c907fff7d64f82d400fd0897464f796dd
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2021-08-20 09:01:48 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2021-08-20 09:01:54 +0000

    misc/mc: update Midnight Commander to version 4.8.27, but not only

    - Don't try to patch up unsupported compiler warning options and fix
      the configure script detection logic instead (it correctly passes
      -Werror in Clang's case, but assumes that $CC is literally called
      `clang' which is, of course, wrong on both FreeBSD and in general)
    - Keep the UNRAR_VERSION adjustment for now: even though it had been
      fixed upstream, with version 7 it would brake again
    - Expand the creator line in the Makefile to include Torsten's full
      name, with his permission.  We have other people named Torsten in
      the project these days, and this change makes it less confusing

    PR:     253796, 257888

 misc/mc/Makefile  | 11 ++++-------
 misc/mc/distinfo  |  6 +++---
 misc/mc/pkg-plist |  1 +
 3 files changed, 8 insertions(+), 10 deletions(-)
Comment 6 Alexey Dokuchaev freebsd_committer freebsd_triage 2021-08-20 09:06:14 UTC
This should be fixed in version 4.8.27 committed to the ports just now (my tests confirm).