pspp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PSPP crashes on Lion


From: Ben Pfaff
Subject: Re: PSPP crashes on Lion
Date: Sat, 07 Jan 2012 13:15:38 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

John Darrington <address@hidden> writes:

> On Fri, Jan 06, 2012 at 10:10:36PM -0800, Ben Pfaff wrote:
>      Oddly, I still can't reproduce it at all.  Even valgrind doesn't
>      complain.
>      
> That is indeed odd.  Here's my stacktrace if you're interested.:
>
> Program received signal SIGSEGV, Segmentation fault.
> 0xb7faf940 in output_driver_get_name (driver=0x0)
>     at /home/john/pspp-master/src/output/driver.c:186
> 186     return driver->name;
> (gdb) bt
> #0  0xb7faf940 in output_driver_get_name (driver=0x0)
>     at /home/john/pspp-master/src/output/driver.c:186
> #1  0xb7fb22de in driver_option_get (driver=0x0, options=0x81d2344, 
>     name=0xb7fd75ae "font-size", default_value=0xb7fd75a8 "10000")
>     at /home/john/pspp-master/src/output/options.c:69
> #2  0xb7fbb16b in opt (d=0x0, options=0x81d2344, key=0xb7fd75ae "font-size", 
>     default_value=0xb7fd75a8 "10000")
>     at /home/john/pspp-master/src/output/cairo.c:180
> #3  0xb7fbb3c2 in apply_options (xr=0x0, o=0x81d2344)
>     at /home/john/pspp-master/src/output/cairo.c:251
> #4  0xb7fbcdac in xr_rendering_apply_options (xr=0x82d0408, o=0x81d2344)
>     at /home/john/pspp-master/src/output/cairo.c:985
> #5  0x080822cc in expose_event_callback (widget=0x83bd8c0, event=0xbfffedcc, 
>     data=0x81d2270)
>     at /home/john/pspp-master/src/ui/gui/psppire-output-window.c:208

OK, I now see what the problem was.  Beats me why I couldn't
reproduce it before.  Other kinds of charts work just as well.

Anyhow, I pushed an adjustment to your fix:

--8<--------------------------cut here-------------------------->8--

From: Ben Pfaff <address@hidden>
Date: Sat, 7 Jan 2012 13:14:02 -0800
Subject: [PATCH] cairo: Only apply options to table items, to avoid crash.

Most of the members of struct xr_rendering, including the 'xr'
member, are used only for table items.  In chart items, these
members are zeroed.  But xr_rendering_apply_options() attempted to
use the 'xr' member even for chart items, which caused a crash.

This reverts and replaces the provisional fix already applied by
John Darrington in commit ee7b576822f (Avoid crash rendering charts
in the gui interface.), which also fixed the crash but added extra
unnecessary work.

Reported-by: Nick Macdonald <address@hidden>
---
 src/output/cairo.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/output/cairo.c b/src/output/cairo.c
index 8156016..cfa9669 100644
--- a/src/output/cairo.c
+++ b/src/output/cairo.c
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -982,7 +982,8 @@ xr_rendering_create_text (struct xr_driver *xr, const char 
*text, cairo_t *cr)
 void 
 xr_rendering_apply_options (struct xr_rendering *xr, struct string_map *o)
 {
-  apply_options (xr->xr, o);
+  if (is_table_item (xr->item))
+    apply_options (xr->xr, o);
 }
 
 struct xr_rendering *
@@ -1015,8 +1016,6 @@ xr_rendering_create (struct xr_driver *xr, const struct 
output_item *item,
     {
       r = xzalloc (sizeof *r);
       r->item = output_item_ref (item);
-      r->xr = xr;
-      xr_set_cairo (xr, cr);
     }
 
   return r;
-- 
1.7.2.5


-- 
Ben Pfaff 
http://benpfaff.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]