Skip to content

Error with image widget #88

Open
Open
@shamazmazum

Description

@shamazmazum

Hi. I am running common-lisp-jupyter-20211207180130 from Ultralisp on SBCL 2.2.0 and have the following jupyter packages

vasily@vonbraun:~ % pkg info | grep noteb
py38-nbclient-0.5.9            Client library for executing notebooks
py38-notebook-6.4.6            Web-based notebook environment for interactive computing
vasily@vonbraun:~ % pkg info | grep jupyter
py38-jupyter-client-6.1.12_1   Jupyter protocol implementation and client libraries
py38-jupyter-core-4.9.1        Jupyter core package
py38-jupyter-server-1.13.2     The backend to Jupyter web applications
py38-jupyterlab-3.1.14         JupyterLab server extension
py38-jupyterlab-pygments-0.1.2 Pygments theme using JupyterLab CSS variables
py38-jupyterlab-server-2.10.2  JupyterLab Server
py38-jupyterlab-widgets-1.0.2  JupyterLab extension for Jupyter/IPython widgets

The problem is with jupyter-widgets:image widget. I run an example which draws the Julia set. Right after creation of a widget there is no image. I think this is incorrect, because you have (update instance) right at the end of initialize-instance method.
20220126_08h11m57s_grim

When I press some buttons on other widgets the image is drawn:
20220126_08h12m03s_grim
but I have this in the console from where jupyter is started:
20220126_08h12m13s_grim

When I remove this method from src/message.lisp the memory corruption problem is gone. I think it tries to free some foreign memory twice.

(defmethod initialize-instance :after ((instance message) &rest initargs &key &allow-other-keys)
  (declare (ignore initargs))
  (let ((buffers (message-buffers instance)))
    (when buffers
      (trivial-garbage:finalize
        instance
        (lambda () (mapcar (lambda (buffer)
                             (static-vectors:free-static-vector buffer))
                           buffers))))))

But this does not solve the first problem. Practically, I have two image widgets and one integer scroller. When the scroller's value is changed a function is called which redraws both images. The first image is redrawn each time the value of that scroller is changed and the second image is redrawn only occasionally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions