Skip to contentSkip to conversation

linuxppc gnuplot segfaults in save

PATCH Dean Luick 2 participants 2 messages Apr 15, 1999

lore
Share & tools
lore

Dean Luick

author
#0 lore raw
Quoted 2 lines

Here is a minimal example, adapted from the gnuplot sources. If used

as

Quoted 1 line

"a.out foo.gnu", it segfaults for me. Compiler is egcs-2.91.66

19990314

Quoted 2 lines

(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. ]]

#1 lore raw

You can try invoking EGCS with the additional commandline argument
-mdebug-arg for it to print out additional information about how it is advancing through the arguments of functions and figure out where in rs6000.c:function_arg() it is not matching what fprintf expects. FP gets very complicated.

David

[[ 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. ]]