Bug 155468 - mc fails to launch
mc fails to launch
Product: Fedora
Classification: Fedora
Component: mc (Show other bugs)
x86_64 Linux
medium Severity high
: ---
: ---
Assigned To: Jindrich Novy
Depends On:
  Show dependency treegraph
Reported: 2005-04-20 13:09 EDT by Andrey Petrov
Modified: 2013-07-02 19:07 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-04-22 00:17:18 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Andrey Petrov 2005-04-20 13:09:36 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.7) Gecko/20050416 Fedora/1.0.3-1.3.1 Firefox/1.0.3

Description of problem:
mc dies with the following message:
*** glibc detected *** malloc(): memory corruption: 0x00000000005d8d60 ***

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. update to mc-4.6.1-0.13.FC3.x86_64.rpm
2. launch mc

Additional info:

downgrading to the previous version of the mc rpm resolves the problem
# rpm -e mc
# rpm -Uvh mc-4.6.1-0.12.FC3.x86_64.rpm
# mc //it works now
Comment 1 Leonard den Ottolander 2005-04-20 13:23:46 EDT
Do you happen to have a backtrace?
Comment 2 Vaclav "sHINOBI" Misek 2005-04-20 18:21:00 EDT
I have the same problem, I have x86_64 as well.

gdb output follows (should I install mc-debug or is this info sufficient?)

backtrace full
#0  0x0000003438d2e37d in raise () from /lib64/tls/libc.so.6
No symbol table info available.
#1  0x0000003438d2faae in abort () from /lib64/tls/libc.so.6
No symbol table info available.
#2  0x0000003438d62a01 in __libc_message () from /lib64/tls/libc.so.6
No symbol table info available.
#3  0x0000003438d68fa1 in _int_malloc () from /lib64/tls/libc.so.6
No symbol table info available.
#4  0x0000003438d6a992 in malloc () from /lib64/tls/libc.so.6
No symbol table info available.
#5  0x000000343aa2caaf in g_malloc () from /usr/lib64/libglib-2.0.so.0
No symbol table info available.
#6  0x000000343aa3ad9f in g_strdup () from /usr/lib64/libglib-2.0.so.0
No symbol table info available.
#7  0x0000000000431dc1 in create_menu ()
No symbol table info available.
#8  0x000000000042fa00 in init_menu ()
No symbol table info available.
#9  0x00000000004300ac in toggle_show_hidden ()
No symbol table info available.
#10 0x00000000004316a0 in main ()
No symbol table info available.
Comment 3 Jindrich Novy 2005-04-21 02:50:18 EDT
Ok, this looks like x86_64 specific problem. I'm looking for a cause/solution
for this now.
Comment 4 Jindrich Novy 2005-04-21 02:54:20 EDT
Attaching backtrace including debuginfo:

#0  0x000000321e22e37d in raise () from /lib64/tls/libc.so.6
#1  0x000000321e22faae in abort () from /lib64/tls/libc.so.6
#2  0x000000321e262a01 in __libc_message () from /lib64/tls/libc.so.6
#3  0x000000321e268fa1 in _int_malloc () from /lib64/tls/libc.so.6
#4  0x000000321e26a992 in malloc () from /lib64/tls/libc.so.6
#5  0x000000322072c9ef in g_malloc () from /usr/lib64/libglib-2.0.so.0
#6  0x000000322073acdf in g_strdup () from /usr/lib64/libglib-2.0.so.0
#7  0x0000000000431dc1 in create_menu (name=0x477314 " &Left ",
entries=0x5d0db8, count=13, help_node=0x47731c "[Left and Right Menus]") at
#8  0x000000000042fa00 in init_menu () at main.c:932
#9  0x00000000004300ac in setup_mc () at main.c:1391
#10 0x00000000004316a0 in main (argc=0, argv=0x0) at main.c:1767
Comment 5 Jindrich Novy 2005-04-21 03:07:18 EDT
The failure is caused by Andrew's simplification to this gmalloc:

--- mc-4.6.1-pre3/src/menu.c.miscfix    2005-04-15 09:41:40.999581208 +0200
+++ mc-4.6.1-pre3/src/menu.c    2005-04-15 09:41:41.011579384 +0200
@@ -112,8 +112,7 @@ create_menu (const char *name, menu_entr
       int len;

       menu->wentries = (wchar_t **)
-                       g_malloc (sizeof (wchar_t *) * menu->count
-                                 + wlen * sizeof (wchar_t));
+                      g_malloc ((menu->count + wlen) * sizeof (wchar_t));
       wp = (wchar_t *) (menu->wentries + menu->count);
       str = menu->name;
       len = mbsrtowcs (wp, &str, wlen, &s);
Comment 6 Jindrich Novy 2005-04-21 03:11:12 EDT
First, menu->count of wchar_t *pointers* are allocated not wchar_t itself what
is the cause of this problem.

I'll release new update for this.
Comment 7 Leonard den Ottolander 2005-04-21 17:22:11 EDT
Was this a fix for the UTF-8 patch or did this went into upstream CVS?
Comment 8 Vaclav "sHINOBI" Misek 2005-04-21 17:49:57 EDT
The problem is repaired with mc-4.6.1-0.14.FC3.x86_64 for me so I suppose this
bug should be closed with ERRATA resolution.
Comment 9 Jindrich Novy 2005-04-22 00:17:18 EDT
Right, closing ERRATA. Thanks for your quick bugreport.
Comment 10 Jindrich Novy 2005-04-22 00:19:34 EDT
Leonard, these fixes were incorporated to the UTF8 patch, upstream is
fortunately not affected.
Comment 11 Leonard den Ottolander 2005-04-22 18:01:23 EDT
Hi Jindrich,

Already figured that out, but thanks for the answer anyway.

Note You need to log in before you can comment on or make changes to this bug.