Christian Brabandt wrote:

> I see a crash with Vim 8.0.0502 in test64.out when running the testsuite
> and DEBUG is defined:
> 
> backtrace:
> (gdb) bt
> #0  strlen () at ../sysdeps/x86_64/strlen.S:106
> #1  0x00007ffff4ce3da3 in _IO_vfprintf_internal (s=0x555555ae7090, 
> format=<optimized out>, ap=ap@entry=0x7fffffffba58) at vfprintf.c:1637
> #2  0x00007ffff4cea157 in __fprintf (stream=<optimized out>, 
> format=<optimized out>) at fprintf.c:32
> #3  0x00005555556de7ca in log_subexpr (sub=0x7fffffffc3e0) at 
> regexp_nfa.c:3932
> #4  0x00005555556de64a in log_subsexpr (subs=0x7fffffffc3e0) at 
> regexp_nfa.c:3907
> #5  0x00005555556e1e88 in nfa_regmatch (prog=0x555555ae8470, 
> start=0x555555ae85d8, submatch=0x7fffffffc5d0, m=0x7fffffffc3e0) at 
> regexp_nfa.c:5802
> #6  0x00005555556e0e25 in recursive_regmatch (state=0x555555ae8650, pim=0x0, 
> prog=0x555555ae8470, submatch=0x7fffffffc5d0, m=0x7fffffffc3e0, 
> listids=0x7fffffffc250) at regexp_nfa.c:5219

[...]

> (gdb) frame 3
> #3  0x00005555556de7ca in log_subexpr (sub=0x7fffffffc3e0) at 
> regexp_nfa.c:3932
> 3932                fprintf(log_fd, "*** group %d, start: \"%s\", end: 
> \"%s\"\n",
> (gdb) p j
> $1 = 1
> (gdb) p s
> $2 = 0x555555ad71c4 "then else"
> (gdb) p e
> $3 = 0x293735392d282029 <error: Cannot access memory at address 
> 0x293735392d282029>
> (gdb) p sub->list.line[j]
> $4 = {start = 0x555555ad71c4 "then else", end = 0x293735392d282029 <error: 
> Cannot access memory at address 0x293735392d282029>}
> 
> 
> I usually do #undef DEBUG in regexp.c and regexp_nfa.c so i did not see 
> this error before, so I don't know if this is a new error or not.

Looks like the in_use field value is wrong.  This avoids the crash, but
it's not the right solution (the test fails):


--- a/vim80/src/regexp_nfa.c    2017-03-12 20:09:59.536467893 +0100
+++ regexp_nfa.c        2017-03-22 21:34:26.397826148 +0100
@@ -5799,6 +5799,8 @@
                }
 #ifdef ENABLE_LOG
                fprintf(log_fd, "Match found:\n");
+               if (t->state->c == NFA_END_INVISIBLE_NEG)
+                   m->norm.in_use = 0;
                log_subsexpr(m);
 #endif
                nfa_match = TRUE;

-- 
hundred-and-one symptoms of being an internet addict:
186. You overstay in the office so you can have more time surfing the net.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui