Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ichizok
Copy link
Contributor

@ichizok ichizok commented Nov 28, 2017

Repro steps

prof.vim
https://gist.github.com/ichizok/74fc6a2a9d0aa4673d3ea7fabc22908f

vim --clean --cmd 'set enc=utf-8'

:profile start prof.log
:profile file prof.vim
:so prof.vim
:qall!

prof.log will include UTF-8 invalid byte sequences.

Impact

For external application using profile log, this problem can cause errors related to encoding.
e.g. covimerage (python application), UnicodeDecodeError occurs when reading profile log

Cause

https://github.com/vim/vim/blob/17471e8/src/ex_cmds2.c#L1835

Each lines of script source file are truncated to IOSIZE - 1 (==1024) byte ignoring the boundary of multibyte characters.

@ichizok ichizok force-pushed the fix/profile-trunc-mbyte branch from d947c51 to 63356cd Compare November 29, 2017 07:59
@codecov-io
Copy link

Codecov Report

Merging #2385 into master will decrease coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2385      +/-   ##
==========================================
- Coverage   74.56%    74.5%   -0.06%     
==========================================
  Files          91       91              
  Lines      132421   132430       +9     
  Branches    29084    29086       +2     
==========================================
- Hits        98734    98671      -63     
- Misses      33683    33734      +51     
- Partials        4       25      +21
Impacted Files Coverage Δ
src/ex_cmds2.c 80.23% <100%> (+0.07%) ⬆️
src/gui_beval.c 55.79% <0%> (-6.44%) ⬇️
src/libvterm/src/state.c 40.38% <0%> (-1.02%) ⬇️
src/window.c 81.25% <0%> (-0.56%) ⬇️
src/libvterm/src/screen.c 72.8% <0%> (-0.54%) ⬇️
src/message.c 68.47% <0%> (-0.25%) ⬇️
src/term.c 50.56% <0%> (-0.22%) ⬇️
src/gui_gtk_x11.c 47.65% <0%> (-0.15%) ⬇️
src/channel.c 82.48% <0%> (+0.04%) ⬆️
src/terminal.c 64.99% <0%> (+0.06%) ⬆️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8b9e20a...63356cd. Read the comment docs.

@brammool brammool closed this in ac112f0 Dec 5, 2017
@ichizok ichizok deleted the fix/profile-trunc-mbyte branch December 6, 2017 01:53
adizero pushed a commit to adizero/vim that referenced this pull request May 19, 2018
Problem:    Profile log may be truncated halfway a character.
Solution:   Find the start of the character. (Ozaki Kiichi, closes vim#2385)
janlazo added a commit to janlazo/neovim that referenced this pull request Sep 16, 2018
Problem:    Profile log may be truncated halfway a character.
Solution:   Find the start of the character. (Ozaki Kiichi, closes vim/vim#2385)
vim/vim@ac112f0
janlazo added a commit to janlazo/neovim that referenced this pull request Mar 9, 2019
Problem:    Profile log may be truncated halfway a character.
Solution:   Find the start of the character. (Ozaki Kiichi, closes vim/vim#2385)
vim/vim@ac112f0

nvim does not support "--clean" yet but "-es" should suffice for the test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants