lc-soft/LCUI

Segmentation fault on ./helloworld #195

hatlesshacker posted onGitHub

I just installed LCUI from source and tried to run test/helloworld as mentioned in the README, but on running it I got this Segfault error:

LCUI (LC's UI) version 1.3.0
Build at Jan 23 2020 - 21:46:49
Copyright (C) 2012-2019 Liu Chao <root@lc-soft.io>.
This is open source software, licensed under MIT. 
See source distribution for detailed copyright notices.
To learn more, visit http://www.lcui.org.

[font] load file: in-core.inconsolata
[font] add family: inconsolata, style name: Regular, id: 1
[font] current font engine is: FreeType
[font] fontconfig enabled
[font] load file: /usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-R.ttf
[font] add family: Ubuntu, style name: Regular, id: 2
[font] load file: /usr/share/fonts/opentype/noto/NotoSansCJK.ttc
[font] add family: Noto Sans CJK JP, style name: Thin, id: 3
[font] add family: Noto Sans CJK KR, style name: Thin, id: 4
[font] add family: Noto Sans CJK SC, style name: Thin, id: 5
[font] add family: Noto Sans CJK TC, style name: Thin, id: 6
[font] add family: Noto Sans CJK JP, style name: Light, id: 7
[font] add family: Noto Sans CJK KR, style name: Light, id: 8
[font] add family: Noto Sans CJK SC, style name: Light, id: 9
[font] add family: Noto Sans CJK TC, style name: Light, id: 10
[font] add family: Noto Sans CJK JP, style name: DemiLight, id: 7
[font] add family: Noto Sans CJK KR, style name: DemiLight, id: 8
[font] add family: Noto Sans CJK SC, style name: DemiLight, id: 9
[font] add family: Noto Sans CJK TC, style name: DemiLight, id: 10
[font] add family: Noto Sans CJK JP, style name: Regular, id: 11
[font] add family: Noto Sans CJK KR, style name: Regular, id: 12
[font] add family: Noto Sans CJK SC, style name: Regular, id: 13
[font] add family: Noto Sans CJK TC, style name: Regular, id: 14
[font] add family: Noto Sans Mono CJK JP, style name: Regular, id: 15
[font] add family: Noto Sans Mono CJK KR, style name: Regular, id: 16
[font] add family: Noto Sans Mono CJK SC, style name: Regular, id: 17
[font] add family: Noto Sans Mono CJK TC, style name: Regular, id: 18
[font] add family: Noto Sans CJK JP, style name: Medium, id: 19
[font] add family: Noto Sans CJK KR, style name: Medium, id: 20
[font] add family: Noto Sans CJK SC, style name: Medium, id: 21
[font] add family: Noto Sans CJK TC, style name: Medium, id: 22
[font] add family: Noto Sans CJK JP, style name: Bold, id: 23
[font] add family: Noto Sans CJK KR, style name: Bold, id: 24
[font] add family: Noto Sans CJK SC, style name: Bold, id: 25
Segmentation fault (core dumped)

I'm on 32bit Linux system, all files had compiled successfully during installation. LibXML2 is installed.


Try compiling in debug mode and then running with GDB:

./configure --enable-debug=yes
make
cd test
../libtool --mode=execute gdb ./helloworld

In the GDB command line interface, do the following:

  1. Enter run command
  2. Wait for Segmentation fault
  3. Enter back command
  4. Copy the output and submit it to this issue as comment
posted by lc-soft about 5 years ago

Here's the output I received from GDB:

(gdb) run
Starting program: /home/warmachine/WORK/LCUI/test/.libs/lt-helloworld 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
LCUI (LC's UI) version 1.3.0
Build at Jan 30 2020 - 19:28:23
Copyright (C) 2012-2019 Liu Chao <root@lc-soft.io>.
This is open source software, licensed under MIT. 
See source distribution for detailed copyright notices.
To learn more, visit http://www.lcui.org.

[font] load file: in-core.inconsolata
[font] add family: inconsolata, style name: Regular, id: 1
[font] current font engine is: FreeType
[font] fontconfig enabled
[font] load file: /usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-R.ttf
[font] add family: Ubuntu, style name: Regular, id: 2
[font] load file: /usr/share/fonts/opentype/noto/NotoSansCJK.ttc
[font] add family: Noto Sans CJK JP, style name: Thin, id: 3
[font] add family: Noto Sans CJK KR, style name: Thin, id: 4
[font] add family: Noto Sans CJK SC, style name: Thin, id: 5
[font] add family: Noto Sans CJK TC, style name: Thin, id: 6
[font] add family: Noto Sans CJK JP, style name: Light, id: 7
[font] add family: Noto Sans CJK KR, style name: Light, id: 8
[font] add family: Noto Sans CJK SC, style name: Light, id: 9
[font] add family: Noto Sans CJK TC, style name: Light, id: 10
[font] add family: Noto Sans CJK JP, style name: DemiLight, id: 7
[font] add family: Noto Sans CJK KR, style name: DemiLight, id: 8
[font] add family: Noto Sans CJK SC, style name: DemiLight, id: 9
[font] add family: Noto Sans CJK TC, style name: DemiLight, id: 10
[font] add family: Noto Sans CJK JP, style name: Regular, id: 11
[font] add family: Noto Sans CJK KR, style name: Regular, id: 12
[font] add family: Noto Sans CJK SC, style name: Regular, id: 13
[font] add family: Noto Sans CJK TC, style name: Regular, id: 14
[font] add family: Noto Sans Mono CJK JP, style name: Regular, id: 15
[font] add family: Noto Sans Mono CJK KR, style name: Regular, id: 16
[font] add family: Noto Sans Mono CJK SC, style name: Regular, id: 17
[font] add family: Noto Sans Mono CJK TC, style name: Regular, id: 18
[font] add family: Noto Sans CJK JP, style name: Medium, id: 19
[font] add family: Noto Sans CJK KR, style name: Medium, id: 20
[font] add family: Noto Sans CJK SC, style name: Medium, id: 21
[font] add family: Noto Sans CJK TC, style name: Medium, id: 22
[font] add family: Noto Sans CJK JP, style name: Bold, id: 23
[font] add family: Noto Sans CJK KR, style name: Bold, id: 24
[font] add family: Noto Sans CJK SC, style name: Bold, id: 25

Program received signal SIGSEGV, Segmentation fault.
0xb7fa9b00 in LCUIFont_LoadFileEx (engine=0xb7fd6b70 <fontlib+144>, 
    file=0x806d660 "/usr/share/fonts/opentype/noto/NotoSansCJK.ttc")
    at fontlibrary.c:637
637            fonts[i]->engine = engine;
(gdb)
posted by hatlesshacker about 5 years ago

I don't have time to deal with this yet, but perhaps you can try debugging it using GDB, such as checking that the values of the num_fonts and i variables are correct.

posted by lc-soft about 5 years ago

Fund this Issue

$0.00
Funded

Pull requests