On Thu, Dec 21, 2023 at 8:53 PM David Pirotte <da...@altosw.be> wrote:
> Hi Aleix, > > ... > > Anyways, guile-cairo is fine going back to stable 3.0.9. > > Ok, so just to make sure, now both the gtk4/simple-paintable.scm and > gtk4/animated-paintable.scm examples work fine on 'your' platform as > well? > > Nope, they don't. Sorry, I should have been much more explicit and provide more info. > > - drawing-widget.scm, peg-solitaire.scm. > > > ... > > > The issue seems to be here: > > > (define-vfunc (snapshot-vfunc (self <drawing-widget>) snapshot) > > #t) > > a- > > And does that works? It should, but/and obviously not drawing > anything, but no bug/no crash? > > It doesn't, it segfaults. b- > > Can you try, in a repl: > > ,use (g-golf) > (gi-import-by-name "Gtk" "Widget") > $5 = #<<gobject-class> <gtk-widget> 7fe9c1681d20> > > (gi-import-by-name "Gtk" "init") > $6 = #<<function> 7fe9c1555360> > > (gtk-init) > > (graphene-rect-alloc) > $7 = #<pointer 0x560e4855d1c0> > > ;; below you'd substitute the $7 appropriately if for some > ;; reason you happen to have a diff repl var $<id> flow, > ;; you need the result of (graphene-rect-alloc) > > (graphene-rect-init $7 0 0 50 50) > $8 = #<pointer 0x560e4855d1c0> > > That worked: scheme@(guile-user)> ,use (g-golf) scheme@(guile-user)> (gi-import-by-name "Gtk" "Widget") $1 = #<<gobject-class> <gtk-widget> 107091b40> scheme@(guile-user)> (gi-import-by-name "Gtk" "init") $2 = #<<function> 107809360> scheme@(guile-user)> (gtk-init) scheme@(guile-user)> (graphene-rect-alloc) $3 = #<pointer 0x60000086e970> scheme@(guile-user)> (graphene-rect-init $3 0 0 50 50) $4 = #<pointer 0x60000086e970> c- > > Let's see, but if all the above work, can you poste the error you get > with no modification of the upstream version of the example, or does it > segfault? > > If no segfault, in a repl: > > (load "<your-golf-repo-path>/examples/gtk-4/drawing-widget.scm") > (main '()) > => error > > ,bt #:width 1000 #:full? #t > > If it segfault, we'd need to get a gdb backtrace - would that be > possible? > > I need to build with debug symbols, but in case it gives you some idea now... This is from: lldb -- guile -e main drawing-widget.scm * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x600003466480) frame #0: 0x0000600003466480 -> 0x600003466480: .long 0x02f6c000 ; unknown opcode 0x600003466484: udf #0x6000 0x600003466488: .long 0x4c8098b0 ; unknown opcode 0x60000346648c: udf #0x1 Target 0: (guile) stopped. * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x60000081a100) * frame #0: 0x000060000081a100 frame #1: 0x00000001050b3f58 libgtk-4.1.dylib`gtk_widget_do_snapshot + 568 frame #2: 0x00000001050b4780 libgtk-4.1.dylib`gtk_widget_snapshot_child + 132 frame #3: 0x00000001050b6d90 libgtk-4.1.dylib`gtk_widget_real_snapshot + 52 frame #4: 0x00000001050b3ef4 libgtk-4.1.dylib`gtk_widget_do_snapshot + 468 frame #5: 0x00000001050b3cfc libgtk-4.1.dylib`gtk_widget_snapshot + 44 frame #6: 0x00000001050b40c4 libgtk-4.1.dylib`gtk_widget_render + 168 frame #7: 0x00000001050c1ce0 libgtk-4.1.dylib`surface_render + 28 frame #8: 0x00000001051fa708 libgtk-4.1.dylib`_gdk_marshal_BOOLEAN__BOXEDv + 124 frame #9: 0x0000000101c122f0 libgobject-2.0.0.dylib`_g_closure_invoke_va + 212 frame #10: 0x0000000101c2705c libgobject-2.0.0.dylib`signal_emit_valist_unlocked + 860 frame #11: 0x0000000101c26cd4 libgobject-2.0.0.dylib`g_signal_emit_valist + 64 frame #12: 0x0000000101c27884 libgobject-2.0.0.dylib`g_signal_emit + 28 frame #13: 0x0000000105239238 libgtk-4.1.dylib`gdk_surface_paint_on_clock + 216 frame #14: 0x0000000101c122f0 libgobject-2.0.0.dylib`_g_closure_invoke_va + 212 frame #15: 0x0000000101c274fc libgobject-2.0.0.dylib`signal_emit_valist_unlocked + 2044 frame #16: 0x0000000101c26cd4 libgobject-2.0.0.dylib`g_signal_emit_valist + 64 frame #17: 0x0000000101c27884 libgobject-2.0.0.dylib`g_signal_emit + 28 frame #18: 0x0000000105227654 libgtk-4.1.dylib`gdk_frame_clock_paint_idle + 732 frame #19: 0x0000000101ce2244 libglib-2.0.0.dylib`g_timeout_dispatch + 92 frame #20: 0x0000000101ce5bb8 libglib-2.0.0.dylib`g_main_context_dispatch_unlocked + 236 frame #21: 0x0000000101ce5eac libglib-2.0.0.dylib`g_main_context_iterate_unlocked + 400 frame #22: 0x0000000101ce5f0c libglib-2.0.0.dylib`g_main_context_iteration + 60 frame #23: 0x000000010202b374 libgio-2.0.0.dylib`g_application_run + 548 frame #24: 0x000000019d18a050 libffi.dylib`ffi_call_SYSV + 80 frame #25: 0x000000019d192adc libffi.dylib`ffi_call_int + 1208 frame #26: 0x0000000101b4d8f0 libgirepository-1.0.1.dylib`g_callable_info_invoke + 860 frame #27: 0x0000000101b4ec14 libgirepository-1.0.1.dylib`g_function_info_invoke + 252 frame #28: 0x000000019d18a050 libffi.dylib`ffi_call_SYSV + 80 frame #29: 0x000000019d192adc libffi.dylib`ffi_call_int + 1208 frame #30: 0x00000001005b4220 libguile-3.0.1.dylib`scm_i_foreign_call + 432 frame #31: 0x0000000100636a94 libguile-3.0.1.dylib`foreign_call + 44 frame #32: 0x0000000100632324 libguile-3.0.1.dylib`vm_regular_engine + 1172 frame #33: 0x0000000100631ae4 libguile-3.0.1.dylib`scm_call_n + 352 frame #34: 0x00000001005a7508 libguile-3.0.1.dylib`scm_eval + 160 frame #35: 0x000000010060f478 libguile-3.0.1.dylib`scm_shell + 80 frame #36: 0x00000001005c0208 libguile-3.0.1.dylib`invoke_main_func + 64 frame #37: 0x00000001005a3220 libguile-3.0.1.dylib`c_body + 24 frame #38: 0x00000001006320c0 libguile-3.0.1.dylib`vm_regular_engine + 560 frame #39: 0x0000000100631ae4 libguile-3.0.1.dylib`scm_call_n + 352 frame #40: 0x000000010062f814 libguile-3.0.1.dylib`catch_body + 184 frame #41: 0x00000001005a8c28 libguile-3.0.1.dylib`scm_c_with_exception_handler + 400 frame #42: 0x00000001005a3180 libguile-3.0.1.dylib`scm_i_with_continuation_barrier + 156 frame #43: 0x00000001005a31f8 libguile-3.0.1.dylib`scm_c_with_continuation_barrier + 80 frame #44: 0x000000010062d6fc libguile-3.0.1.dylib`with_guile + 76 frame #45: 0x000000010049678c libgc.1.dylib`GC_call_with_stack_base + 36 frame #46: 0x00000001005c01b4 libguile-3.0.1.dylib`scm_boot_guile + 68 frame #47: 0x0000000100003ec8 guile`main + 192 frame #48: 0x000000018c2950e0 dyld`start + 2360 And this one from: lldb -- guile -e main simple-paintable.scm * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x6000032e7340) frame #0: 0x00006000032e7340 -> 0x6000032e7340: .long 0x029e0180 ; unknown opcode 0x6000032e7344: udf #0x6000 0x6000032e7348: .long 0x41809eb0 ; unknown opcode 0x6000032e734c: udf #0x1 Target 0: (guile) stopped. (lldb) bt * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x6000032e7340) * frame #0: 0x00006000032e7340 frame #1: 0x0000000103c62ed8 libgtk-4.1.dylib`gtk_image_set_from_paintable + 144 frame #2: 0x000000019d18a050 libffi.dylib`ffi_call_SYSV + 80 frame #3: 0x000000019d192adc libffi.dylib`ffi_call_int + 1208 frame #4: 0x00000001021c58f0 libgirepository-1.0.1.dylib`g_callable_info_invoke + 860 frame #5: 0x00000001021c6c14 libgirepository-1.0.1.dylib`g_function_info_invoke + 252 frame #6: 0x000000019d18a050 libffi.dylib`ffi_call_SYSV + 80 frame #7: 0x000000019d192adc libffi.dylib`ffi_call_int + 1208 frame #8: 0x00000001005b4220 libguile-3.0.1.dylib`scm_i_foreign_call + 432 frame #9: 0x0000000100636a94 libguile-3.0.1.dylib`foreign_call + 44 frame #10: 0x0000000100632324 libguile-3.0.1.dylib`vm_regular_engine + 1172 frame #11: 0x0000000100631ae4 libguile-3.0.1.dylib`scm_call_n + 352 frame #12: 0x00000001005b4958 libguile-3.0.1.dylib`invoke_closure + 168 frame #13: 0x000000019d192f28 libffi.dylib`ffi_closure_SYSV_inner + 816 frame #14: 0x000000019d18a1e8 libffi.dylib`ffi_closure_SYSV + 56 frame #15: 0x000000010228a0f4 libgobject-2.0.0.dylib`g_closure_invoke + 200 frame #16: 0x00000001022a02e4 libgobject-2.0.0.dylib`signal_emit_unlocked_R + 1256 frame #17: 0x000000010229f23c libgobject-2.0.0.dylib`signal_emit_valist_unlocked + 1340 frame #18: 0x000000010229ecd4 libgobject-2.0.0.dylib`g_signal_emit_valist + 64 frame #19: 0x000000010229f884 libgobject-2.0.0.dylib`g_signal_emit + 28 frame #20: 0x00000001026a5028 libgio-2.0.0.dylib`g_application_real_local_command_line + 1232 frame #21: 0x00000001026a32ec libgio-2.0.0.dylib`g_application_run + 412 frame #22: 0x000000019d18a050 libffi.dylib`ffi_call_SYSV + 80 frame #23: 0x000000019d192adc libffi.dylib`ffi_call_int + 1208 frame #24: 0x00000001021c58f0 libgirepository-1.0.1.dylib`g_callable_info_invoke + 860 frame #25: 0x00000001021c6c14 libgirepository-1.0.1.dylib`g_function_info_invoke + 252 frame #26: 0x000000019d18a050 libffi.dylib`ffi_call_SYSV + 80 frame #27: 0x000000019d192adc libffi.dylib`ffi_call_int + 1208 frame #28: 0x00000001005b4220 libguile-3.0.1.dylib`scm_i_foreign_call + 432 frame #29: 0x0000000100636a94 libguile-3.0.1.dylib`foreign_call + 44 frame #30: 0x0000000100632324 libguile-3.0.1.dylib`vm_regular_engine + 1172 frame #31: 0x0000000100631ae4 libguile-3.0.1.dylib`scm_call_n + 352 frame #32: 0x00000001005a7508 libguile-3.0.1.dylib`scm_eval + 160 frame #33: 0x000000010060f478 libguile-3.0.1.dylib`scm_shell + 80 frame #34: 0x00000001005c0208 libguile-3.0.1.dylib`invoke_main_func + 64 frame #35: 0x00000001005a3220 libguile-3.0.1.dylib`c_body + 24 frame #36: 0x00000001006320c0 libguile-3.0.1.dylib`vm_regular_engine + 560 frame #37: 0x0000000100631ae4 libguile-3.0.1.dylib`scm_call_n + 352 frame #38: 0x000000010062f814 libguile-3.0.1.dylib`catch_body + 184 frame #39: 0x00000001005a8c28 libguile-3.0.1.dylib`scm_c_with_exception_handler + 400 frame #40: 0x00000001005a3180 libguile-3.0.1.dylib`scm_i_with_continuation_barrier + 156 frame #41: 0x00000001005a31f8 libguile-3.0.1.dylib`scm_c_with_continuation_barrier + 80 frame #42: 0x000000010062d6fc libguile-3.0.1.dylib`with_guile + 76 frame #43: 0x000000010049678c libgc.1.dylib`GC_call_with_stack_base + 36 frame #44: 0x00000001005c01b4 libguile-3.0.1.dylib`scm_boot_guile + 68 frame #45: 0x0000000100003ec8 guile`main + 192 frame #46: 0x000000018c2950e0 dyld`start + 2360