Bram Moolenaar <[email protected]> wrote:
> Elimar Riesebieter wrote:
>
>> * Dominique Pellé <[email protected]> [2016-02-28 12:08 +0100]:
>>
>> > Elimar Riesebieter <[email protected]> wrote:
>>
>> [...]
>> > Can you give us a backtrace with gdb?
>>
>> No. Can't find a core file anywhere.
>>
>> > You can get it from the core file using:
>> >
>> > $ cd vim/src/testdir
>> > $ make clean
>> > $ rm core
>> > $ make test_channel.res
>>
>> Well running this as user works as it should. So the only difference
>> are the environment variables. My build wrapper has set LANG=C and
>> LC_ALL=C. Setting LANG=en_US.UTF-8 and LC_ALL=en_US.UTF-8 seems to
>> solve the issue.
>>
>> It looks like an UTF-8 environment is required for running the
>> tests?
>
> No, but this problem does point in the direction of the conversion
> recently added to JSON encoding/decoding.
>
> A simple way to try this out is to find vimconv_T in json.c. Below it
> you will find:
>
> if (!enc_utf8)
>
> Change that to:
>
> if (FALSE)
>
> There are two of these. Let us know if that solved the problem.
I can reproduce the crash now on xubuntu-14.04 x86_64
after doing:
$ cd src/testdir
$ export LC_ALL=C
$ export LANG=C
$ export LANGUAGE=C
$ make test_channel.res
...
Vim: Caught deadly signal SEGV
Vim: Finished.
Segmentation fault (core dumped)
Valgrind reports:
==12517== Memcheck, a memory error detector
==12517== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==12517== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==12517== Command: ../vim -f -u unix.vim -U NONE --noplugin
--not-a-term -u NONE -U NONE -S runtest.vim test_channel.vim
==12517== Parent PID: 12516
==12517==
==12517== Invalid read of size 1
==12517== at 0x5AF581: json_decode_string (json.c:671)
==12517== by 0x5AF581: json_decode_item (json.c:714)
==12517== by 0x5AF906: json_decode_array (json.c:388)
==12517== by 0x5AF906: json_decode_item (json.c:708)
==12517== by 0x5B01DA: json_decode (json.c:884)
==12517== by 0x5AD0A8: channel_parse_json (channel.c:1091)
==12517== by 0x5AEA9E: channel_read_json_block (channel.c:1987)
==12517== by 0x442A17: ch_expr_common (eval.c:10590)
==12517== by 0x445AC1: call_func (eval.c:8913)
==12517== by 0x449112: get_func_tv (eval.c:8712)
==12517== by 0x447A4F: eval7 (eval.c:5239)
==12517== by 0x447C73: eval6 (eval.c:4890)
==12517== by 0x447EF3: eval5 (eval.c:4706)
==12517== by 0x448B84: eval4 (eval.c:4401)
==12517== by 0x448B84: eval3 (eval.c:4316)
==12517== by 0x448D14: eval2 (eval.c:4248)
==12517== by 0x448D14: eval1 (eval.c:4176)
==12517== by 0x448FCE: get_func_tv (eval.c:8697)
==12517== by 0x44E34B: ex_call (eval.c:3527)
==12517== by 0x46FAC7: do_one_cmd (ex_docmd.c:2921)
==12517== by 0x46FAC7: do_cmdline (ex_docmd.c:1107)
==12517== by 0x444EFD: call_user_func (eval.c:25268)
==12517== by 0x4459FE: call_func (eval.c:8883)
==12517== by 0x451094: func_call (eval.c:9872)
==12517== by 0x445AC1: call_func (eval.c:8913)
==12517== by 0x449112: get_func_tv (eval.c:8712)
==12517== by 0x44E34B: ex_call (eval.c:3527)
==12517== by 0x46FAC7: do_one_cmd (ex_docmd.c:2921)
==12517== by 0x46FAC7: do_cmdline (ex_docmd.c:1107)
==12517== by 0x444EFD: call_user_func (eval.c:25268)
==12517== by 0x4459FE: call_func (eval.c:8883)
==12517== by 0x449112: get_func_tv (eval.c:8712)
==12517== by 0x44E34B: ex_call (eval.c:3527)
==12517== by 0x46FAC7: do_one_cmd (ex_docmd.c:2921)
==12517== by 0x46FAC7: do_cmdline (ex_docmd.c:1107)
==12517== by 0x444EFD: call_user_func (eval.c:25268)
==12517== by 0x4459FE: call_func (eval.c:8883)
==12517== by 0x449112: get_func_tv (eval.c:8712)
==12517== by 0x44E34B: ex_call (eval.c:3527)
==12517== by 0x46FAC7: do_one_cmd (ex_docmd.c:2921)
==12517== by 0x46FAC7: do_cmdline (ex_docmd.c:1107)
==12517== by 0x44DF16: ex_execute (eval.c:23486)
==12517== by 0x46FAC7: do_one_cmd (ex_docmd.c:2921)
==12517== by 0x46FAC7: do_cmdline (ex_docmd.c:1107)
==12517== by 0x463FF1: do_source (ex_cmds2.c:3591)
==12517== by 0x46484B: cmd_source (ex_cmds2.c:3204)
==12517== by 0x46FAC7: do_one_cmd (ex_docmd.c:2921)
==12517== by 0x46FAC7: do_cmdline (ex_docmd.c:1107)
==12517== by 0x40DEE1: exe_commands (main.c:2918)
==12517== by 0x40DEE1: main (main.c:955)
==12517== Address 0x981e644 is 4 bytes inside a block of size 40 free'd
==12517== at 0x4C2BDEC: free (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12517== by 0x5AF577: json_decode_string (json.c:667)
==12517== by 0x5AF577: json_decode_item (json.c:714)
==12517== by 0x5AF906: json_decode_array (json.c:388)
==12517== by 0x5AF906: json_decode_item (json.c:708)
==12517== by 0x5B01DA: json_decode (json.c:884)
==12517== by 0x5AD0A8: channel_parse_json (channel.c:1091)
==12517== by 0x5AEA9E: channel_read_json_block (channel.c:1987)
==12517== by 0x442A17: ch_expr_common (eval.c:10590)
==12517== by 0x445AC1: call_func (eval.c:8913)
==12517== by 0x449112: get_func_tv (eval.c:8712)
==12517== by 0x447A4F: eval7 (eval.c:5239)
==12517== by 0x447C73: eval6 (eval.c:4890)
==12517== by 0x447EF3: eval5 (eval.c:4706)
==12517== by 0x448B84: eval4 (eval.c:4401)
==12517== by 0x448B84: eval3 (eval.c:4316)
==12517== by 0x448D14: eval2 (eval.c:4248)
==12517== by 0x448D14: eval1 (eval.c:4176)
==12517== by 0x448FCE: get_func_tv (eval.c:8697)
==12517== by 0x44E34B: ex_call (eval.c:3527)
==12517== by 0x46FAC7: do_one_cmd (ex_docmd.c:2921)
==12517== by 0x46FAC7: do_cmdline (ex_docmd.c:1107)
==12517== by 0x444EFD: call_user_func (eval.c:25268)
==12517== by 0x4459FE: call_func (eval.c:8883)
==12517== by 0x451094: func_call (eval.c:9872)
==12517== by 0x445AC1: call_func (eval.c:8913)
==12517== by 0x449112: get_func_tv (eval.c:8712)
==12517== by 0x44E34B: ex_call (eval.c:3527)
==12517== by 0x46FAC7: do_one_cmd (ex_docmd.c:2921)
==12517== by 0x46FAC7: do_cmdline (ex_docmd.c:1107)
==12517== by 0x444EFD: call_user_func (eval.c:25268)
==12517== by 0x4459FE: call_func (eval.c:8883)
==12517== by 0x449112: get_func_tv (eval.c:8712)
==12517== by 0x44E34B: ex_call (eval.c:3527)
==12517== by 0x46FAC7: do_one_cmd (ex_docmd.c:2921)
==12517== by 0x46FAC7: do_cmdline (ex_docmd.c:1107)
==12517== by 0x444EFD: call_user_func (eval.c:25268)
==12517== by 0x4459FE: call_func (eval.c:8883)
==12517== by 0x449112: get_func_tv (eval.c:8712)
==12517== by 0x44E34B: ex_call (eval.c:3527)
==12517== by 0x46FAC7: do_one_cmd (ex_docmd.c:2921)
==12517== by 0x46FAC7: do_cmdline (ex_docmd.c:1107)
==12517== by 0x44DF16: ex_execute (eval.c:23486)
==12517== by 0x46FAC7: do_one_cmd (ex_docmd.c:2921)
==12517== by 0x46FAC7: do_cmdline (ex_docmd.c:1107)
==12517== by 0x463FF1: do_source (ex_cmds2.c:3591)
==12517== by 0x46484B: cmd_source (ex_cmds2.c:3204)
==12517== by 0x46FAC7: do_one_cmd (ex_docmd.c:2921)
==12517== by 0x46FAC7: do_cmdline (ex_docmd.c:1107)
==12517== by 0x40DEE1: exe_commands (main.c:2918)
==12517== by 0x40DEE1: main (main.c:955)
==12517==
json.c:
666 #if defined(FEAT_MBYTE) && defined(USE_ICONV)
!!667 vim_free(converted);
668 #endif
669
670 reader->js_used = (int)(p - reader->js_buf);
!!671 if (*p == '"')
672 {
p at line json.c:671 points inside the buffer 'converted' freed
just a few lines above at json.c:667.
I don't have the time to look further now, but hopefully
this is enough information to reproduce and fix it.
Regards
Dominique
--
--
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.