Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Walter C. Pelissero <walter <at> pelissero.de>
Subject: current->source == ¤t_source_link
Newsgroups: gmane.lisp.clg.devel
Date: Tuesday 19th February 2008 16:05:50 UTC (over 8 years ago)
This simplified function updates an horizontal scale once a second
based on a value received from another program via a socket.  It also
remotely modifies the same value if the user slides the cursor.  The
updater runs in background as a "timeout" function invoked by GTK.

The problem with it is that after some user activity, I haven't been
able to identify with certainty (I just move the cursor about), I
receive an error of failed assertion in gmain.c.  Sometimes, before
that, the update function (the one going "tick") stops being invoked
and then, more user interaction will cause the error.

I haven't been able to reproduce the error without calling the
SOME-REMOTE-VALUE function, which does a bit of socket I/O.  Maybe
it's got something to do with that.

Has anyone else seen this error before?
What am I doing wrong?

I haven't been able to reproduce the error on SBCL yet but, noticing
that the behaviour of the scale is much more jerky, I'd suspect the
main loop might be quite different under SBCL.

By the way.  CMUCL doesn't seem to need all those explicit casts to
double float I had to put in this sample code.  I'm wondering if it
couldn't be made like that also under SBCL.

----------------------------------------------------------------------

(defun test-background ()
  (clg-init)
  (let* ((scale (make-instance 'h-scale :digits 0
			   :adjustment (adjustment-new 0.0d0 0.0d0 100.0d0 1.0d0 10.0d0 0.0d0)))
	 (window (make-instance 'window
				:default-width 320
				:child scale)))
    (let ((id (glib:timeout-add 1000 #'(lambda ()
					 (format t "tick~%")
					 (setf (range-value scale)
					       (+ 0.0d0 (some-remote-value)))
					 t))))
      (signal-connect scale 'destroy #'(lambda () (glib:timeout-remove
id))))
    (signal-connect scale 'change-value
		    #'(lambda (scroll-type value)
			(format t "change-value ~A ~A~%" scroll-type value)
			(setf (some-remote-value) value)))
    (widget-show-all window)))

----------------------------------------------------------------------

GLib: file gmain.c: line 2064 (g_main_dispatch): assertion failed:
(current->source == ¤t_source_link)
   [Condition of type GLIB:ERROR-LOG-LEVEL]

Restarts:
 0: [ABORT] Return to Top-Level.

Backtrace:
  0: (GLIB::LOG-HANDLER 301948240 301948236)
  1: ("Foreign function call land")
  2: ("Foreign function call land")
  3: ("Foreign function call land")
  4: ("Foreign function call land")
  5: ("Foreign function call land")
  6: ("Foreign function call land")
  7: ("Foreign function call land")
  8: ("Foreign function call land")
  9: ("Foreign function call land")
 10: ("Foreign function call land")
 11: (GTK:MAIN-ITERATION-DO NIL)
 12: ("DEFUN MAIN-ITERATE-ALL" #<#1=unused-arg> #<#1#>)[:OPTIONAL]
 13: (LISP::SUB-SERVE-EVENT 0 10000)
 14: (SYSTEM:WAIT-UNTIL-FD-USABLE 0 :INPUT NIL)
 15: (LISP::DO-INPUT #)
 16: (LISP::INPUT-CHARACTER # NIL (LISP::*EOF*))
 17: (LISP::SYNONYM-IN #
                       NIL
                       (LISP::*EOF*))
 18: (LISP::TWO-WAY-IN
      #, Output
= #>
      NIL
      (LISP::*EOF*))
 19: (READ-CHAR
      #, Output
= #>
      NIL
      (LISP::*EOF*)
      NIL)
 20: (LISP::READ-PRESERVING-WHITESPACE-INTERNAL
      #, Output
= #>
      NIL
      (:EOF)
      T)
 21: (LISP::READ-PRESERVING-WHITESPACE-INTERNAL
      #, Output
= #>
      NIL
      (:EOF)
      NIL)
 22: (LISP::READ-PRESERVING-WHITESPACE-INTERNAL 4
                                                #, Output = #>
                                                NIL
                                                (:EOF)
                                                ...)[:EXTERNAL]
 23: (LISP::READ-INTERNAL
      #, Output
= #>
      NIL
      (:EOF)
      NIL)
 24: (READ
      #, Output
= #>
      NIL
      (:EOF)
      NIL)
 25: (LISP::%TOP-LEVEL)
 26: ((LABELS LISP::RESTART-LISP SAVE-LISP))


-- 
walter pelissero
http://www.pelissero.de

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
 
CD: 4ms