[cl-gtk2-devel] (make-instance 'gtk:box) creates a memory error

Eric Wolf eric at boese-wolf.eu
Wed Mar 14 21:15:45 UTC 2012


Hi there,

I just played a bit with cl-gtk2-gtk and the following 
happened to me:

Code is:
(in-package :sudokusolver)
(defun run ()
  (gtk:within-main-loop
    (let ((window (make-instance 'gtk:gtk-window
                                 :type :toplevel
                                 :window-position :center
                                 :title "Sudokusolver"
                                 :default-width 300
                                 :default-heigth 450))
          (vbox (make-instance 'gtk:box
                               :orientation :vertical))
          (menu (make-instance 'gtk:menu-bar
                               :pack-direction :ltr
                               :child-pack-direction :ltr
                               :take-focus nil))
          (action-menu (make-instance 'gtk:menu-item
                                      :label "_Actions")))
      (gtk:container-add window vbox)
      (gtk:container-add vbox menu)
      (gtk:container-add menu action-menu)
      (gtk:widget-show window))))

Repl is:
CL-USER> (require 'sudokusolver)
WARNING: GType GdkWindow is not known to GObject
WARNING: GType GdkWindow is not known to GObject
WARNING:
   Declared GType name 'GdkWindow' for class 'GDK-WINDOW' is invalid (g_type_name returned 0)
WARNING: GType GtkFileChooserEmbed is not known to GObject
WARNING: GType GtkFileChooserEmbed is not known to GObject
WARNING:
   Declared GType name 'GtkFileChooserEmbed' for class 'FILE-CHOOSER-EMBED' is invalid (g_type_name returned 0)
WARNING: GType LispArrayListStore is not known to GObject
WARNING: GType LispArrayListStore is not known to GObject
WARNING:
   Declared GType name 'LispArrayListStore' for class 'ARRAY-LIST-STORE' is invalid (g_type_name returned 0)
WARNING: GType LispTreeStore is not known to GObject
WARNING: GType LispTreeStore is not known to GObject
WARNING:
   Declared GType name 'LispTreeStore' for class 'TREE-LISP-STORE' is invalid (g_type_name returned 0)
("ITERATE")
CL-USER> (gtk:ensure-gtk-main)

; No value
CL-USER> (sudokusolver::run)
; No value
CL-USER> 

Error is:
Unhandled memory fault at #x8.
   [Condition of type SB-SYS:MEMORY-FAULT-ERROR]

Restarts:
 0: [RETURN-FROM-CALLBACK] GTK::RETURN-FROM-CALLBACK
 1: [TERMINATE-THREAD] Terminate this thread (#<THREAD "cl-gtk2 main thread" RUNNING {DB688A9}>)

Backtrace:
  0: (SB-SYS:MEMORY-FAULT-ERROR)
  1: ("foreign function: call_into_lisp")
  2: ("foreign function: post_signal_tramp")
  3: ("foreign function: #x33EFCF20")
  4: (GOBJECT::CREATE-GOBJECT-FROM-CLASS-AND-INITARGS #<GOBJECT:GOBJECT-CLASS GTK:BOX> (:ORIENTATION :VERTICAL))
  5: ((SB-PCL::FAST-METHOD MAKE-INSTANCE (GOBJECT:GOBJECT-CLASS)) ..)
  6: ((LAMBDA () :IN SUDOKUSOLVER::RUN))
  7: ((LAMBDA (GTK::DATA) :IN "/home/ewolf/Projects/cl-gtk2/gtk/gtk.misc.lisp") #.(SB-SYS:INT-SAP #X00000002))
  8: ((LAMBDA (SB-ALIEN::ARGS-POINTER SB-ALIEN::RESULT-POINTER FUNCTION) :IN "/home/ewolf/.cache/common-lisp/sbcl-1.0.55.0.debian-linux-x86/home/ewolf/Projects/cl-gtk2/glib/gobject.object.high.fasl") ..)
  9: ("foreign function: call_into_lisp")
 10: ("foreign function: funcall3")
 11: ("foreign function: #x1100F95")
 12: ("foreign function: #x327B302C")
 13: ((LAMBDA () :IN BORDEAUX-THREADS::BINDING-DEFAULT-SPECIALS))
 14: ((FLET #:WITHOUT-INTERRUPTS-BODY-223578 :IN SB-THREAD:MAKE-THREAD))
 15: ((FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD:MAKE-THREAD))
 16: ((FLET #:WITHOUT-INTERRUPTS-BODY-88894 :IN SB-THREAD::CALL-WITH-MUTEX))
 17: (SB-THREAD::CALL-WITH-MUTEX ..)
 18: (SB-THREAD::INITIAL-THREAD-FUNCTION)
 19: ("foreign function: call_into_lisp")
 --more--

Can't I get a GtkBox? (make-instance 'gtk:v-box) works like a charm,
but I just wondered about gtk:box, because in C this works also.

Your sincerely,

Eric





More information about the cl-gtk2-devel mailing list