contour: Coredumps when drawing Unicode block characters
Description
When attempting to draw box drawing characters, contour attempts to free() an invalid pointer and dumps core.
Environment
- Contour Version or Git commit hash: 2814f42f705756cd2dbaeb8579618801c714c7fd
- Operating System (name / distribution / version): Debian GNU/Linux 11
- Contour configuration: None
- TERM environment variable: xterm-256color
- Compiler version: g++ 10.2.1
Steps to Reproduce
- Install ugrep
- Try running
ugrep 0..10FFFFwhich will show every assigned unicode character. - Eventually, Contour will crash
The point appears to be in the range of box drawing glyphs (U+2500) as I’m able to get it to coredump immediately when I type:
ugrep box draw
Update:
This does not crash:
ugrep 2500..70
Nor does this:
ugrep 2580..FF
But this crashes:
ugrep 2570..F
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 34 (26 by maintainers)
/cc @data-man
My way is to
rm -rf your_build_dir/*and then runcmake ... && make ...again. The problem is, whenever dependencies are updated inside of the repo, CPM is getting confused. CPM is a CMake based package manager.I’m building with:
It’s compiling fine at the moment , but I’ll try turning off unit tests if it gives me more guff.
Oh, I see that you are correct. Cmake was ignoring the system version of catch2 I had installed. I guess the
git clean -fwas what cmake needed to be able to get past whatever was hanging up CPM.@data-man This is due to the CPM related dependency updates. Is this a CPM thingy or is there any way to mitigate this? I keep having the same issue and it sometimes drives me nuts
@hackerb9 can you add some leading space(s) in front of your ugrep lines. This is sometimes so unreadable. Also fonttable would be nice to accept a list of ranges of Codepoints that i want it to print. Do you want me to create a ticket for these?
I need more unit tests. I think that is the next ticket i gonna tackle.
Holy weck? You can disable built-in box drawing per config. But that should be fixed ASAP. Thanks.
That’s interesting! Font rendering could be the issue. In particular, perhaps my machine is using a corrupt font for just those characters. The weird thing is that it doesn’t affect any other terminals. I’m using FreeType 2.10.4:
I just tried XTerm (which is linked with the same version of FreeType) and it had no issue. It is not linked with harfbuzz, though. My harfbuzz is 2.7.4-1.
My UnicodeData.txt is version 13.0.0, but I’m pretty sure that is unrelated.
So, I ran it under a debugger and have narrowed the crash down to src/terminal_renderer/BoxDrawingRenderer.cpp:512. The name of the file implies Contour is treating box drawing characters special, which leads me to think the problem is not in FreeType, HarfBuzz, or UnicodeData.txt.
gdb