Bram Moolenaar wrote:

> > Hi, Just reporting a few test failures.
> > I don't know if they're important or not.
> > The message about "ttype" is really about "ttytype".
> > When I "set ttytype=xxx" manually, vim does accept it.
> > And term does default to ansi when I don't have
> > $TERM set and check it manually.
> > 
> > cheers,
> > raf
> > 
> > vim-8.0.1806, macos-10.11.6, XQuartz-2.7.11 (xorg-server 1.18.4), 
> > openmotif-2.3.8 from macports:
> > 
> > $ gcc --version
> > Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr 
> > --with-gxx-include-dir=/usr/include/c++/4.2.1
> > Apple LLVM version 8.0.0 (clang-800.0.42.1)
> > Target: x86_64-apple-darwin15.6.0
> > Thread model: posix
> > InstalledDir: 
> > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
> > 
> > $ ./configure \
> >     --disable-darwin \
> >     --with-x \
> >     --enable-gui=motif \
> >     --enable-multibyte \
> >     --with-mac-arch=current \
> >     --with-features=huge \
> >     --disable-acl
> > 
> > $ make
> > [...]
> > $ make test
> > [...]
> > 
> > Found errors in Test_default_term():
> > function RunTheTest[38]..Test_default_term line 9: Pattern 'defaulting to 
> > ''ansi''' does not match 'E437: terminal capability "cm" required\r\nPress 
> > ENTER or type command to continue\r\r\n'
> > 
> > 
> > >From test_options.vim:
> > Found errors in Test_set_ttytype():
> > function RunTheTest[38]..Test_set_ttytype line 22: set ttype=xxx did not 
> > fail
> > 
> > >From test_startup.vim:
> > Found errors in Test_default_term():
> > function RunTheTest[38]..Test_default_term line 9: Pattern 'defaulting to 
> > ''ansi''' does not match 'E437: terminal capability "cm" required\r\nPress 
> > ENTER or type command to continue\r\r\n'
> 
> That is strange.  Could you run a debugger and see what happens when you
> do ":set ttytype=xxx"?  Why does it not produce an error?

Hi Bram,

Sorry for the delay. It is really strange.
I've attached a script output of a debug session
because what I'm seeing makes no sense.

It looks like set_termname() calls term_is_builtin("xxx")
which does: return (STRNCMP(name, "builtin_", (size_t)8) == 0).
It does this a few times. The second time, the return value
must be 1 because set_termname() then does term += 8 which
leaves the term variable in a garbage state == "\x06".
There end up being more calls to term_is_builtin() that I
couldn't follow by reading the code. I guess the optimizer
is reordering things. But I really can't see why it would be
calling term_is_builtin() more than once. Maybe I'm doing
something wrong in the debugger.

So it looks like maybe some memory corruption that causes
vim to think that "xxx" looks like "builtin_something" so
it then tries to look up the "something" in find_builtin_term()
but it can't find it because it's really "\x06". I don't know
what happens after that.

When replaying the script trace, there is some output that I didn't
see (such as five lines of garbage after the "continue" command
and the listing of environment variable names after exiting the
debugger. So ignore that.

I hope it helps.

cheers,
raf

-- 
-- 
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.

Attachment: vim81-set-ttytype=xxx-debug.script
Description: Binary data

Raspunde prin e-mail lui