V_BreakLines + utf8 = debug assertion error

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
ZZYZX
 
 
Posts: 1384
Joined: Sun Oct 14, 2012 1:43 am
Location: Ukraine
Contact:

V_BreakLines + utf8 = debug assertion error

Post by ZZYZX »

Apparently calling "isspace" with values larger than 255 or smaller than -1 causes an assertion crash with GZDoom compiled in Debug on Windows, somewhere in internal libraries.
GetCharFromString returns values larger than 255 when there is utf8 found in the input string.

Original quote:
[4:11 PM] Iddqd: v_text.cpp в 390 проверяет isspace -> _ctype.cpp 109 fast_check -> вызывает валидатор
So the stack trace looks like this:

Code: Select all

>    gzdoom.exe!_chvalidator(int c, int mask) Line 36    C++    Symbols loaded.
     gzdoom.exe!fast_check(const int c, const int mask) Line 24    C++    Symbols loaded.
     gzdoom.exe!isspace(int c) Line 109    C++    Symbols loaded.
     gzdoom.exe!V_BreakLines(FFont * font, int maxwidth, const unsigned char * string, bool preservecolor, unsigned int * count) Line 390    C++    Symbols loaded.
     gzdoom.exe!V_BreakLines(FFont * font, int maxwidth, const FString & str, bool preservecolor, unsigned int * count) Line 87    C++    Symbols loaded.
     gzdoom.exe!FConsoleBuffer::FormatText(FFont * formatfont, int displaywidth) Line 287    C++    Symbols loaded.
     gzdoom.exe!C_DrawConsole(bool hw2d) Line 1249    C++    Symbols loaded.
The exact way how utf8 gets into V_BreakLines:

Code: Select all

{Chars=0x000001ed2c8a791c "\x1cB\x1cH Failed to open device \x1c+OpenAL Soft on Динамики (2- USB PnP Sound Device)\x1cH. Trying default." }
Aside from that this can also happen with non-latin directory names and similar stuff.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: V_BreakLines + utf8 = debug assertion error

Post by Graf Zahl »

Let's hope that iswspace solves the issue.
Post Reply

Return to “Closed Bugs [GZDoom]”