Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 155468 - mc fails to launch
Summary: mc fails to launch
Alias: None
Product: Fedora
Classification: Fedora
Component: mc
Version: 3
Hardware: x86_64
OS: Linux
Target Milestone: ---
Assignee: Jindrich Novy
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2005-04-20 17:09 UTC by Andrey Petrov
Modified: 2013-07-02 23:07 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2005-04-22 04:17:18 UTC

Attachments (Terms of Use)

Description Andrey Petrov 2005-04-20 17:09:36 UTC
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 17:23:46 UTC
Do you happen to have a backtrace?

Comment 2 Vaclav "sHINOBI" Misek 2005-04-20 22:21:00 UTC
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/
No symbol table info available.
#1  0x0000003438d2faae in abort () from /lib64/tls/
No symbol table info available.
#2  0x0000003438d62a01 in __libc_message () from /lib64/tls/
No symbol table info available.
#3  0x0000003438d68fa1 in _int_malloc () from /lib64/tls/
No symbol table info available.
#4  0x0000003438d6a992 in malloc () from /lib64/tls/
No symbol table info available.
#5  0x000000343aa2caaf in g_malloc () from /usr/lib64/
No symbol table info available.
#6  0x000000343aa3ad9f in g_strdup () from /usr/lib64/
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 06:50:18 UTC
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 06:54:20 UTC
Attaching backtrace including debuginfo:

#0  0x000000321e22e37d in raise () from /lib64/tls/
#1  0x000000321e22faae in abort () from /lib64/tls/
#2  0x000000321e262a01 in __libc_message () from /lib64/tls/
#3  0x000000321e268fa1 in _int_malloc () from /lib64/tls/
#4  0x000000321e26a992 in malloc () from /lib64/tls/
#5  0x000000322072c9ef in g_malloc () from /usr/lib64/
#6  0x000000322073acdf in g_strdup () from /usr/lib64/
#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 07:07:18 UTC
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 07:11:12 UTC
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 21:22:11 UTC
Was this a fix for the UTF-8 patch or did this went into upstream CVS?

Comment 8 Vaclav "sHINOBI" Misek 2005-04-21 21:49:57 UTC
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 04:17:18 UTC
Right, closing ERRATA. Thanks for your quick bugreport.

Comment 10 Jindrich Novy 2005-04-22 04:19:34 UTC
Leonard, these fixes were incorporated to the UTF8 patch, upstream is
fortunately not affected.

Comment 11 Leonard den Ottolander 2005-04-22 22:01:23 UTC
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.