Skip to content

Conversation

@xiangzhai
Copy link
Contributor

Hi,

Testcase: glib-2.58.3/tests/gobject/references

There are x64 entry callbacks, for example 0x4018c0 Symbol weak_ref1:

=>[BOX64]   /home/zhaixiang/repo/glib-2.58.3/tests/gobject/.libs/references:SymTab[56] = "weak_ref1", value=0x4018c0, size=103, info/other=2/0 index=13

It reprodced couldn't find weak ref 0x4018c0 weak_ref1:

21564|0x400cee: Calling g_object_weak_unref(0x36939240, 0x4018C0, 0x2A, ...) =>
(process:21564): GLib-GObject-WARNING **: 16:01:18.466: g_object_weak_unref: couldn't find weak ref 0x4018c0(0x2a)
                                                                                                    ^--- x64 entry
Program received signal SIGTRAP, Trace/breakpoint trap.
raise (sig=<optimized out>) at ../sysdeps/unix/sysv/linux/raise.c:50
(gdb) bt
#0  raise (sig=<optimized out>) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x000000fff6f1f970 in g_logv () from /lib/loongarch64-linux-gnu/libglib-2.0.so.0
#2  0x000000fff6f1faf4 in g_log () from /lib/loongarch64-linux-gnu/libglib-2.0.so.0
#3  0x000000003484a858 in x64Int3 (emu=0x36914310, addr=<optimized out>) at /home/zhaixiang/repo/box64/src/emu/x64int3.c:350
#4  0x000000fff6bb1acc in ?? ()

So just wrapped g_object_add_toggle_ref, g_object_remove_toggle_ref and g_object_weak_unref to translate the x64 entry callbacks.

Testcase: glib-2.58.3/tests/gobject/references Passed.
make test Passed.

Please review my patch.

Thanks,
Leslie Zhai

@ptitSeb ptitSeb merged commit 1eba5b1 into ptitSeb:main Aug 5, 2025
25 checks passed
@xiangzhai
Copy link
Contributor Author

Thanks

@xiangzhai xiangzhai deleted the wrappedgobject2_B branch August 5, 2025 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants