Skip to content

Conversation

@xiangzhai
Copy link
Contributor

Hi,

There are duplicated findGDestroyNotifyFct, so just put it into src/tools/gtkclass.c.

Testcase: gtk+-3.24.5/tests/testpixbuf-save which used GDestroyNotify Passed.
make test Passed.

Please review my patch.

Thanks,
Leslie Zhai

@xiangzhai
Copy link
Contributor Author

Thanks

@ptitSeb
Copy link
Owner

ptitSeb commented Aug 6, 2025

Have you tried real aaps beside simple test case? I fear these change put a lot of pressure on this wrapper and end up with a "Warning, not enough slot"...

@ksco
Copy link
Collaborator

ksco commented Aug 6, 2025

We can quadruple the slot size

@ptitSeb
Copy link
Owner

ptitSeb commented Aug 6, 2025

We can quadruple the slot size

Look at the quantity of code that will be quadruple!!!!

@ksco
Copy link
Collaborator

ksco commented Aug 6, 2025

Well I mean just for this function (or functions used in many places.)

@xiangzhai
Copy link
Contributor Author

Have you tried real aaps beside simple test case?

Could you introduce some apps?

"Warning, not enough slot"...

Testcase: glib-2.58.3/tests/testglib reproduced no more slot for glib2 GTestFunc callback if applied the g_test patch, so I just used #include "super100.h" to pre-allocated more slots for it. How about use #include "super100.h" for findGDestroyNotifyFct?

Thanks,
Leslie Zhai

@xiangzhai
Copy link
Contributor Author

Small app eog 3.28.3 reproduced SIGSEGV: debug.log

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x0000000034bc7c40 in my_unwrap_signal_offset (klass=klass@entry=0x36a92d70) at /home/zhaixiang/repo/box64/src/tools/gtkclass.c:5355
#2  0x0000000034e6d910 in my_unwrap_signal_offset (klass=0x36a92d70) at /home/zhaixiang/repo/box64/src/tools/gtkclass.c:5343
#3  my_class_init_2 (a=0x36a92d70, b=<optimized out>) at /home/zhaixiang/repo/box64/src/tools/gtkclass.c:5435
#4  0x000000fff704b330 in g_type_class_ref () from /lib/loongarch64-linux-gnu/libgobject-2.0.so.0
#5  0x000000fff704b504 in g_type_class_ref () from /lib/loongarch64-linux-gnu/libgobject-2.0.so.0
#6  0x000000fff7030024 in g_object_new_with_properties () from /lib/loongarch64-linux-gnu/libgobject-2.0.so.0
#7  0x000000fff70309ac in g_object_new () from /lib/loongarch64-linux-gnu/libgobject-2.0.so.0
#8  0x0000000034890938 in pFELpV (emu=0x36915ed0, fcn=<optimized out>) at /home/zhaixiang/repo/box64/src/wrapped/generated/wrapper.c:4929
#9  0x000000003484a958 in x64Int3 (emu=0x36915ed0, addr=<optimized out>) at /home/zhaixiang/repo/box64/src/emu/x64int3.c:350
#10 0x000000fff1eda5b4 in ?? ()

After simply wrapped g_module some functions:

diff --git a/src/wrapped/wrappedgmodule2_private.h b/src/wrapped/wrappedgmodule2_private.h
index bc608126..f1a5491f 100644
--- a/src/wrapped/wrappedgmodule2_private.h
+++ b/src/wrapped/wrappedgmodule2_private.h
@@ -4,11 +4,11 @@
 
 //GO(_fini, 
 //GO(g_module_build_path, pFpp)
-//GO(g_module_close, iFp)
+GO(g_module_close, iFp)
 //GO(g_module_error, pFv)
 //GO(g_module_make_resident, vFp)
 //GO(g_module_name, pFp)
 //GO(g_module_open, pFpu)
-//GO(g_module_supported, iFv)
+GO(g_module_supported, iFv)
 //GO(g_module_symbol, iFppp)
 //GO(_init, 

Big app, such as dbeaver-25.1.3, is not easy to DEBUG :(

So I debug the regression testcases at first, just like jtreg, gtk+-3.24.5/tests, glib-2.58.3/tests, etc.

Thanks,
Leslie Zhai

@xiangzhai xiangzhai closed this Aug 7, 2025
@xiangzhai xiangzhai deleted the findGDestroyNotifyFct branch August 9, 2025 02:09
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.

3 participants