Red Hat Bugzilla – Bug 112644
MC crashes on import of large syntax files
Last modified: 2007-11-30 17:10:34 EST
Description of problem:
MC crashes on import of large syntax files.
Version-Release number of selected component (if applicable):
mc-4.6.0-6 (also on RH9, mc-4.6.0-4)
Add about 10 lines to php.syntax. Now edit a php file and see
Being able to use a big syntax file.
A fix for this problem has been around since June 2003. I'll include
the patch anyway, since the one downloaded from
Created attachment 96699 [details]
Fixes segfault that happens on import of large syntax file
Duh. Thought the attached patch actually fixed the problem. The only
thing that happened however was that the php.syntax file was reverted
to it's old state when I upgraded the package ;-).
So the problem is still there.
What does work is increasing the size of MAX_WORDS_PER_CONTEXT to
something like 4096. This is enough for the php.syntax file I
submitted in bug #112645. Something like this should do:
--- mc-4.6.0/edit/syntax.c.000 2002-12-15 19:55:53.000000000 +0100
+++ mc-4.6.0/edit/syntax.c 2003-12-26 01:06:51.000000000 +0100
@@ -42,7 +42,7 @@
#define UNKNOWN_FORMAT "unknown"
-#define MAX_WORDS_PER_CONTEXT 1024
+#define MAX_WORDS_PER_CONTEXT 4096
#define MAX_CONTEXTS 128
#define RULE_ON_LEFT_BORDER 1
I added the above patch and a patch for the syntax file to a home
built rpm, and thus verified that it works.
Could the increase of MAX_WORDS_PER_CONTEXT to 4096 be applied to the
update that will probably be released one of these days?
(And maybe the syntax file as well?)
patch is buggy and the latter is just a hack.
I chose to fix the former patch. mc-4.6.0-8.3 is builting ATM and
will go to FC1 updates testing tonight.
That the patch is buggy I already mentioned in comment 2. But you are
going to try to fix that one?
Sure raising MAX_WORDS_PER_CONTEXT to 4096 is a hack, but since the
code was not setup to allocate memory dynamically it's just more
usable to increase it to that value.
But if you want to make this patch work that of course is much neater
solution. The large php syntax file might come in handy testing ;) .
By the way, could you please push 8.1 to the main update tree and get
out a security announcement? This has not happened yet for Fedora Core
so I presume many people are still running a vulnerable 6.
Last version of the patch (mc-4.6.0-8.4) seems to be working
I submitted this patch at
https://savannah.gnu.org/patch/?func=detailitem&item_id=1628 . Maybe
you could contact the upstream maintainer about this?
alloc_words_per_context += 1024;
in hunk #5 read
alloc_words_per_context += MAX_WORDS_PER_CONTEXT;
Fixed in mc-4.6.0-8.4. Closing ERRATA.