You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can not reproduce this reliably, so this looks like a spurious error, probably introduced by weird behavior from clangfmt (and clangd?). This looks incredibly cursed, but may help figuring out some edge cases of ropey so I posted here.
open file myexample.c
run :format to execute clangfmt
index out of bounds error from ropey with the following shell output:
[user@pc freetypeexample]$ hx myexample.c
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Byte index out of bounds: byte index 1418, Rope/RopeSlice byte length 1416', $HOME/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/ropey-1.3.1/src/rope.rs:637:41
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
// font: /usr/share/fonts/TTF/DejaVuSans.ttf// text: "testtext"// compile with cc `pkg-config --cflags --libs freetype2` -lm myexample.c#include<assert.h>#include<ft2build.h>#include<stdio.h>#includeFT_FREETYPE_Hintmain() {
FT_Librarylibrary;
FT_Faceface;
constchar*filepath="/usr/share/fonts/truetype/arial.tff";
// neovim how to align codeinterror=0; // 0 is successerror=FT_Init_FreeType(&library);
if (error!=FT_Err_Ok) {
printf("could not load library\n");
printf(-1);
}
assert(library!=NULL);
error=FT_New_Face(library, filepath, 0, &face);
// to know how many faces a given font contains:// 1. set face_index = -1// 2. prinft("count of embedded faces in font file: %d\n", face->num_faces);// if file was loaded into memory,// error = FT_New_Memory_Face(library, buffer, size, 0, &face);if (error==FT_Err_Unknown_File_Format) {
printf("unknown file format\n");
exit(-2);
} elseif (error!=FT_Err_Ok) {
printf("could not load face\n");
exit(-3);
}
assert(face!=NULL);
// face->num_glyphs// complete list of available fields: FT_FaceRec// 2. char_width,char_height in 1/64th of points, horizontal and vertical// device resolutionerror=FT_Set_Char_Size(face, 0, 16*64, 300, 300);
if (error!=FT_Err_Ok) {
printf("invalid character size\n");
exit(-4);
}
// what more???
}
neovim gives up completely editing with ASAN resulting in stuff like
=================================================================
==620094==ERROR: AddressSanitizer: SEGV on unknown address 0xfffffffffffffff8 (pc 0x55947f8cddba bp 0x7fe668c28e80 sp 0x7ffebeb36f40 T0)
==620094==The signal is caused by a READ memory access.
#0 0x55947f8cddba (<unknown module>)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (<unknown module>)
==620094==ABORTING
The text was updated successfully, but these errors were encountered:
Very old issue but I believe this might have been related to: #4047. Either way I guess we could close this given it's for a year and a half old version? cc @the-mikedavis
Reproduction steps
I can not reproduce this reliably, so this looks like a spurious error, probably introduced by weird behavior from clangfmt (and clangd?). This looks incredibly cursed, but may help figuring out some edge cases of ropey so I posted here.
myexample.c
:format
to execute clangfmtEnvironment
~/.cache/helix/helix.log
myexample.c
compile_command.json
neovim gives up completely editing with ASAN resulting in stuff like
The text was updated successfully, but these errors were encountered: