Information: Midnight Commander crashes.




Hello Dan, Hello gnome-users,

    I have been investigating the crash reported by various people on
the list about the misterious crashes of gmc when there are files
found on the ~/desktop with strange names.

    This is a stack trace of the reported bug report:

> or stack size exceeded maxssiz.
> Segmentation fault (core dumped)
> 
> gdb says:
> #0  0xd12ec in re_match_2_internal (bufp=0x7b03ab60, string1=0x0, size1=0, 
>     string2=0x4005e1f8 "/home/cerebus/desktop/Home directory", size2=36, 
>     pos=0, regs=0x0, stop=36) at regex.c:3682
> 3682          REG_MATCH_NULL_STRING_P (reg_info[mcnt]) =MATCH_NULL_UNSET_VALUE;
> (gdb) bt
> #0  0xd12ec in re_match_2_internal (bufp=0x7b03ab60, string1=0x0, size1=0, 
>     string2=0x4005e1f8 "/home/cerebus/desktop/Home directory", size2=36, 
>     pos=0, regs=0x0, stop=36) at regex.c:3682
> #1  0xd0c84 in re_search_2 (bufp=0x7b03ab60, string1=0x0, size1=0, 
>     string2=0x4005e1f8 "/home/cerebus/desktop/Home directory", size2=36, 
>     startpos=0, range=36, regs=0x0, stop=36) at regex.c:3330
...
> #3  0xd59b8 in regexec (preg=0x40067bb8, 
>     string=0x4005e1f8 "/home/cerebus/desktop/Home directory", nmatch=0, 
>     pmatch=0x0, eflags=0) at regex.c:5317


Notice how the code is trying to store the value
MATCH_NULL_UNSET_VALUE to the reg_info [mcnt] array.  

This is wrong, it should not be storing any information at all for two
reasons:

	1. I compiled the expression with the REG_NOSUB option (which
           according to botg the Solaris and the Linux man pages
           causes regexec to only report true/false and not provide
           any substring matches).

	2. I provided nmatch=0 in the call to regexec, which at least
           Solaris documents as ignoring the pmatch argument (which it
           is not doing).

Unless I am proved wrong, I believe this is a bug in your OS
implementation for regexec/regcomp.  

It might also be some program overwriting the memory in the regex_t
structure though.

miguel.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]