With Intel ifort, the list_demo example shows garbage characters in its "Name" column
vmagnin opened this issue · 8 comments
Describe the bug
When gtk-fortran is built with ifort, the list_demo example shows garbage characters in its "Name" column. And in the terminal some warnings about UTF-8 appear:
(list_demo:16562): Pango-WARNING **: 10:11:52.168: Invalid UTF-8 string passed to pango_layout_set_text()
And each time the example is run, the garbage characters are different.
Expected behavior
Should show some persons names.
Your system:
- OS version: Ubuntu 21.04 64 bits
- Compiler version: ifort (IFORT) 2021.2.0 20210228
- GTK branch: tested only in gtk4.
Additional context
No problem with gfortran.
Note that the pango_layout_set_text()
function is not called directly by the example source code.
Is there some problem with the c_loc()
function in that kind of lines?
call g_value_set_static_string(c_loc(valt), "Heinz El-Mann"//c_null_char)
That example is crashing in MSYS2/Windows 10 (tested with gfortran):
$ ./list_demo.exe
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
Backtrace for this error:
#0 0xe4c6c21b
...
Same problem with GTK 4.4 and ifort 2021.4.0.
The regex
example is also printing some garbage:
LET'S LOOK FOR THE FUNCTIONS CITED IN THE TEXT:
SOME MATCHES WERE FOUND:
����
https://docs.gtk.org/gobject/method.Value.set_static_string.html
The string is a NUL terminated UTF-8 string.
Maybe related to that post https://fortran-lang.discourse.group/t/using-box-drawing-characters/645/3
Concerning regex.f90:
https://docs.gtk.org/glib/method.MatchInfo.fetch.html
Returns: utf8
The issue is still present with ifort 2021.5.0 20211109
but there is no problem with ifx 2022.0.0 20211123
The problem is still present with ifort (IFORT) 2021.7.0 20220726. But it is OK with ifx which will replace ifort.