delorie.com/archives/browse.cgi   search  
Mail Archives: geda-help/2021/03/02/13:51:57

X-Authentication-Warning: delorie.com: mail set sender to geda-help-bounces using -f
X-Recipient: geda-help AT delorie DOT com
Message-ID: <20210302185121.27316.qmail@stuge.se>
Date: Tue, 2 Mar 2021 18:51:21 +0000
From: "Peter Stuge (peter AT stuge DOT se) [via geda-help AT delorie DOT com]" <geda-help AT delorie DOT com>
To: "karl AT aspodata DOT se \[via geda-help AT delorie DOT com\]" <geda-help AT delorie DOT com>
Subject: Re: [geda-help] Re: Gschem segfaults
References: <xnh7nchcyj DOT fsf AT envy DOT delorie DOT com>
<4b1d3d85-7f93-9eac-c4eb-9f84f2a47e61 AT bitflipper DOT ca>
<CAMw9acBn7xNo5jvrvS6Dof6JtYgOOLVKJwFFTu93S+CoPszjHw AT mail DOT gmail DOT com>
<20210225212042 DOT 16269 DOT qmail AT stuge DOT se>
<20210226140333 DOT 7D5E78248737 AT turkos DOT aspodata DOT se>
<20210226203024 DOT 8107 DOT qmail AT stuge DOT se>
<20210226220140 DOT D69CD824873C AT turkos DOT aspodata DOT se>
<20210302145834 DOT 24761 DOT qmail AT stuge DOT se>
<20210302154815 DOT 39C3682475BD AT turkos DOT aspodata DOT se>
MIME-Version: 1.0
In-Reply-To: <20210302154815.39C3682475BD@turkos.aspodata.se>
Reply-To: geda-help AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-help AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

--B4IIlcmfBL/1gGOG
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi Karl,

karl AT aspodata DOT se [via geda-help AT delorie DOT com] wrote:
> > Does the reverse situation ever happen? Ie. that the system-installed
> > version segfaults, but a version in /usr/local works?
> 
> Not what I can remember, not sure.

That's good news.


> > And would you be willing to download the 1.10.2 tarball and see if
> > that behaves the same as git master when built and installed into
> > /usr/local ?
> 
> Using
>  http://ftp.geda-project.org/geda-gaf/stable/v1.10/1.10.2/geda-gaf-1.10.2.tar.gz
..
> $ /usr/local/bin/gschem 
> 
> (gschem:14119): Gdk-CRITICAL **: 16:37:04.872: IA__gdk_drawable_get_size: assertion 'GDK_IS_DRAWABLE (drawable)' failed

This is an interesting message. The called function, gdk_drawable_get_size()
is deprecated in GDK 2.24 according to comments in the two places where
gschem calls it. I guess it's planned to replace that code in gschem,
but for now if that code is only about the size of some part of the
window then it shouldn't matter much, or at least not cause a crash.

Also, this message doesn't always appear, so let's ignore it for now.


What's your gtk version? You can check with emerge or:

echo /var/db/pkg/*/gtk+*

I suspect that these problems started after an upgrade of gtk+-2.


> (gschem:14119): Gdk-CRITICAL **: 16:37:04.872: IA__gdk_cairo_create: assertion 'GDK_IS_DRAWABLE (drawable)' failed
> Segmentation fault (core dumped)
> $ /usr/local/bin/gschem regulator.sch
> 
> (gschem:14432): Gdk-CRITICAL **: 16:38:05.293: IA__gdk_cairo_create: assertion 'GDK_IS_DRAWABLE (drawable)' failed
> Segmentation fault (core dumped)

So as an experiment I've created the attached patch. I don't believe
that it's a final solution, but it might provide some useful information.

Please apply it onto the 1.10.2 source and let's see what happens when
starting gschem then:

cd geda-gaf-1.10.2
patch -p0 < /tmp/geda-gaf-1.10.2-text-drawable.patch
make install
/usr/local/bin/gschem


> ** (gschem:16751): CRITICAL **: 16:45:46.738: gschem_page_geometry_set_values: assertion 'screen_width > 0' failed

This makes sense, because the gschem code expects screen_width to have
been set by the call to gdk_drawable_get_size() above - since that call
failed the width is still 0. This leads me to think about division by
zero, and there are a few places with such candidates, however then I
would have expected a SIGFPE or SIGBUS signal, not SIGSEGV.


> Btw, the main window (I guess) is mapped, and then immediately (it
> feels like 1/3 of a second) unmapped.

Good to know that the window appears briefly - this is certainly
something going wrong with startup.


//Peter

--B4IIlcmfBL/1gGOG
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="geda-gaf-1.10.2-text-drawable.patch"

--- gschem/src/o_text.c.orig	2020-12-17 15:33:15.000000000 +0100
+++ gschem/src/o_text.c	2021-03-02 19:32:03.105846702 +0100
@@ -41,6 +41,7 @@
                                 int *max_x, int *max_y)
 {
   TOPLEVEL *toplevel;
+  GdkWidget *window;
   EdaRenderer *renderer;
   cairo_t *cr;
   cairo_matrix_t render_mtx;
@@ -55,7 +56,12 @@
   toplevel = gschem_toplevel_get_toplevel (w_current);
   g_return_val_if_fail ((toplevel != NULL), FALSE);
 
-  cr = gdk_cairo_create (gtk_widget_get_window (GTK_WIDGET(page_view)));
+  window = gtk_widget_get_window (GTK_WIDGET(page_view));
+  g_return_val_if_fail ((window != NULL), FALSE);
+  g_return_val_if_fail (GDK_IS_DRAWABLE(window), FALSE);
+
+  cr = gdk_cairo_create (window);
+  g_return_val_if_fail ((cr != NULL), FALSE);
 
   /* Set up renderer based on configuration in w_current. Note that we
    * *don't* enable hinting, because if its enabled the calculated

--B4IIlcmfBL/1gGOG--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019