bug-gnu-utils
[Top][All Lists]
Advanced

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

Bug report on plotutils-2.4.1


From: Simon Ching
Subject: Bug report on plotutils-2.4.1
Date: Tue, 6 Jan 2004 16:01:04 +0800 (CST)

Hello,

RE: Bug report on plotutils-2.4.1

Segfault when the following program is compiled and
run:

---- start quote ----
#include <stdio.h>
#include <plot.h>

int
main ()
{

   FILE* file;
   plPlotter* plotter;
   plPlotterParams* plotter_params;

   file = fopen ("foo.png", "w");

   plotter_params = pl_newplparams ();
   pl_setplparam (plotter_params, "BIGMAPSIZE",
                  (char*)"640x640");
   plotter = pl_newpl_r ("PNG", NULL, file,
                         NULL, plotter_params);

   pl_openpl_r (plotter);
   pl_fspace_r (plotter, 0, 0, 640, 640);

   pl_colorname_r (plotter, "red");

   pl_flinewidth_r (plotter, 10);
   pl_farc_r (plotter, 320, 320, 400, 400, 500, 300);
   //pl_fcircle_r (plotter, 320, 320, 100);

   pl_closepl_r (plotter);
   pl_deletepl_r (plotter);

}
---- end quote ----

Necessary ingredients for the segfault are
the PNG plotter, linewidth setting function and
the arc drawing function.

The segfault will go away if either:
1. Use X plotter instead of PNG plotter;
2. Comment out the pl_flinewidth_r line; or
3. Do not issue the pl_farc_r function (the circle
   function, e.g., runs flawlessly)


The gdb trace of the above test program:

---- start quote ----
03:56pm
address@hidden:~/lab/libplot $ gdb foo
GNU gdb 5.2.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General
Public License, and you are
welcome to change it and/or distribute copies of it
under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show
warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) run
Starting program: /home/simon/lab/libplot/foo 
where

Program received signal SIGSEGV, Segmentation fault.
0x4004ec03 in computeAcc () from
/usr/local/lib/libplot.so.2
(gdb) where
#0  0x4004ec03 in computeAcc () from
/usr/local/lib/libplot.so.2
#1  0x40050743 in drawArc () from
/usr/local/lib/libplot.so.2
#2  0x4004a99a in miArcSegment () from
/usr/local/lib/libplot.so.2
#3  0x4004a48e in __miPolyArc_r () from
/usr/local/lib/libplot.so.2
#4  0x4004a172 in __miDrawArcs_r_internal () from
/usr/local/lib/libplot.so.2
#5  0x4004a118 in _miDrawArcs_r () from
/usr/local/lib/libplot.so.2
#6  0x40073a1e in _b_draw_elliptic_arc_internal ()
   from /usr/local/lib/libplot.so.2
#7  0x40073165 in _b_draw_elliptic_arc () from
/usr/local/lib/libplot.so.2
#8  0x40072284 in _b_paint_path () from
/usr/local/lib/libplot.so.2
#9  0x4006570f in pl_endpath_r () from
/usr/local/lib/libplot.so.2
#10 0x40062b60 in pl_closepl_r () from
/usr/local/lib/libplot.so.2
#11 0x080489ee in main () at foo.c:29
#12 0x402492eb in __libc_start_main (main=0x80488a0
<main>, argc=1, 
    ubp_av=0xbffff6f4, init=0x8048660 <_init>,
fini=0x8048a30 <_fini>, 
    rtld_fini=0x4000c130 <_dl_fini>,
stack_end=0xbffff6ec)
    at ../sysdeps/generic/libc-start.c:129
(gdb) 
---- end quota ----

Notes:
- setting pl_flinewidth_r (plotter, 1) do not help
- using pl_linewidth_r and pl_arc_r (integer
  versions) also gives segfaults

This don't look like a system-specifc problem
but nevertheless my (partial) system config
is:
- libpng version 1.2.5
- The compiler used is gcc 3.2
- The system is a Linux Slackware 8.1
  with kernel 2.4.18

Regards,
Simon.

P.S. Is the plotutils homepage on www.gnu.org
down? The web server reponds with "Not Found"
error for the URL
http://www.gnu.org/software/plotutils/

=====
Simon E Ching
-----------------------------------------------------------
                               email: address@hidden
                      http://www.geocities.com/simon_ching/

_______________________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com.hk address at http://mail.english.yahoo.com.hk




reply via email to

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