1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
Are there some ways to check the wrapped functions?
I am now struggling with some weird bugs :disappointed:
My gui apps got stuck, and I saw **the last wrapped functions these apps called are all `calloc` and from `/usr/lib/libglib-2.0.so.0`**. The debug logs all looks like:
```txt
(( omitted ))
Calling Init for /usr/lib/libgobject-2.0.so.0 @0x3f4900c000
Done Init for /usr/lib/libgobject-2.0.so.0
Calling Init[0] for /usr/lib/libgobject-2.0.so.0 @0x3f4900f110
Calling Init[1] for /usr/lib/libgobject-2.0.so.0 @0x3f4900f040
222680|0x3f0d0b9383: Calling malloc(0x38, 0x7D0C7FFFE218, 0x1, ...) => return 0x3768A100
222680|0x3f0d0b9396: Calling pthread_rwlock_init(0x3768A100, 0x0, 0x1, ...) => return 0x0
(( omitted ))
222680|0x3f0d06334b: Calling realloc(0x3769D350, 0x200, 0x0, ...) => return 0x3769EC60
Run X86 (0x37051730), RIP=0x3f0d042dc4, Stack=0x7d0c7fffde98 is32bits=0
222680|0x3f0d06334b: Calling realloc(0x3769D460, 0x100, 0x0, ...) => return 0x3769D350
222680|0x3f0d043513: Calling memset(0x3769EBD0, 0x0, 0x80, ...) => return 0x3769EBD0
Run X86 (0x37051730), RIP=0x3f0d043523, Stack=0x7d0c7fffdeb8 is32bits=0
222680|0x3f0d063293: Calling calloc(0x1, 0x8, 0x0, ...) => return 0x3769BD10
(( !stuck! ))
```
Even the gdb could not stop the programs when they got stuck.
---
I am now suspecting the function wrapping and I also see `calloc` wrapping seems good. So what I am actually suspecting is that maybe some functions wrappings are bad and affect the future behavior of the programs.
I see all the wrapping seemed to be created manually, so if the wrapping is buggy, the function calling from one library to another library can be buggy - I can imagine how difficult to debug such wrapping issue...
Could you help me to debug this issue? Thanks in advance!
---
- KDE APPs I am trying to run: okular, kate, ark.
- Libraries:
- `/usr/lib/libglib-2.0.so.0`: https://archlinux.org/packages/core/x86_64/glib2/
- `/usr/lib/libc.so.6`: https://archlinux.org/packages/core/x86_64/glibc/
|