linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [Patch] linuxppc gnuplot segfaults in save
@ 1999-04-14 22:27 Martin Costabel
  1999-04-14 23:13 ` Tom Rini
  1999-04-15  7:05 ` Hans-Bernhard Broeker
  0 siblings, 2 replies; 14+ messages in thread
From: Martin Costabel @ 1999-04-14 22:27 UTC (permalink / raw)
  To: Tom Rini; +Cc: linuxppc-dev, bug-gnuplot

[-- Attachment #1: Type: text/plain, Size: 1200 bytes --]

Hi, 

I think I sent this already to the LinuxPPC developers some time ago,
but I had a look into the latest gnuplot-3.7-2.ppc.rpm, and the bug is
still there:

Bug: 
gnuplot-3.7 on LinuxPPC gives a segmentation fault when the command
'save' or 'save set' is used.

Repeat by: 
root[88]#/usr/bin/gnuplot

        G N U P L O T
        Linux version 3.7
        patchlevel 0
        last modified Thu Jan 14 19:34:53 BST 1999
etc.

Terminal type set to 'x11'
gnuplot> save 'foo.gnu'
Segmentation fault

Patch: 
See below. One just has to split an fprintf command into two.
It seems that the fprintf in the LinuxPPC libraries does not support
such long format strings. In gnuplot-3.6, at the corresponding place
there were 10 fprintf commands, one for each line.

In principle, it would be nice if this were included in the gnuplot
sources, but since it seems to be a ppc specific problem, it would be
sufficient to include the patch in the gnuplot-3.7-x.src.rpm for
LinuxPPC (Tom?). 

Or could someone find out what's wrong with the fprintf function in
LinuPPC? Note that this is not specific for one version of glibc. I
tried it on several from glibc-961212 to glibc-2.1.1-3a. Same result.

--
Martin

[-- Attachment #2: gnuplot_save.patch --]
[-- Type: text/plain, Size: 738 bytes --]

--- misc.c.ori	Thu Dec 10 19:33:22 1998
+++ misc.c	Sun Feb  7 00:16:08 1999
@@ -645,17 +645,18 @@
 set pointsize %g\n\
 set encoding %s\n\
 set %spolar\n\
-set %sparametric\n\
+set %sparametric\n",
+	    loff, roff, toff, boff,
+	    pointsize,
+	    encoding_names[encoding],
+	    (polar) ? "" : "no",
+	    (parametric) ? "" : "no");
+    fprintf(fp, "\
 set view %g, %g, %g, %g\n\
 set samples %d, %d\n\
 set isosamples %d, %d\n\
 set %ssurface\n\
 set %scontour",
-	    loff, roff, toff, boff,
-	    pointsize,
-	    encoding_names[encoding],
-	    (polar) ? "" : "no",
-	    (parametric) ? "" : "no",
 	    surface_rot_x, surface_rot_z, surface_scale, surface_zscale,
 	    samples_1, samples_2,
 	    iso_samples_1, iso_samples_2,

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re:[Patch]linuxppc gnuplot segfaults in save
@ 1999-04-15 19:00 Dean Luick
  1999-04-15 20:34 ` [Patch]linuxppc " David Edelsohn
  0 siblings, 1 reply; 14+ messages in thread
From: Dean Luick @ 1999-04-15 19:00 UTC (permalink / raw)
  To: costabel, linuxppc-dev


> Here is a minimal example, adapted from the gnuplot sources. If used
as
> "a.out foo.gnu", it segfaults for me. Compiler is egcs-2.91.66
19990314
> (egcs-1.1.2 release) (PowerPC GNU/Linux), glibc-2.1.1-3a.
> gbd backtrace gives

Using egcs 1.0.2 prelease, it looks like egcs is messing up how it
pushes
arguements on the stack.  In partiuclar, egcs should be filling all of
the integer
argument registers, r3-r10.  Instead, it places what should to in r8 in
r10, and placing
what should be in r9 and r10 on the stack.  This leave r8 and r9
completely random, plus
pushes the final two integer arguments (which should be on the stack) 8
bytes off from
their correct position.

Assuming that fprintf correctly interprets the format string, it is no
wonder that
it crashes.

Dean



[[ This message was sent via the linuxppc-dev mailing list.  Replies are ]]
[[ not  forced  back  to the list, so be sure to Cc linuxppc-dev if your ]]
[[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting.   ]]

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~1999-04-19 18:52 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-04-14 22:27 [Patch] linuxppc gnuplot segfaults in save Martin Costabel
1999-04-14 23:13 ` Tom Rini
1999-04-15  6:54   ` Martin Costabel
1999-04-15  9:16     ` Franz Sirl
1999-04-15 10:47       ` Lars Hecking
1999-04-15 10:55       ` Martin Costabel
1999-04-19 18:52         ` Troy Benjegerdes
1999-04-15 12:28       ` Gabriel Paubert
1999-04-15 14:07         ` Franz Sirl
1999-04-15 16:54           ` Gabriel Paubert
1999-04-15 11:56     ` Gary Thomas
1999-04-15  7:05 ` Hans-Bernhard Broeker
1999-04-15  7:58   ` Geert Uytterhoeven
  -- strict thread matches above, loose matches on Subject: below --
1999-04-15 19:00 Dean Luick
1999-04-15 20:34 ` [Patch]linuxppc " David Edelsohn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).