[Patch] linuxppc gnuplot segfaults in save

Troy Benjegerdes hozer at drgw.net
Tue Apr 20 04:52:35 EST 1999


There's a problem with the test code posted earlier.. It segfaults on x86
also..

int main(int argc, char** argv)
{
        char* file_name;                    <-----------
        strcpy(file_name, argv[1]);         <----------
        test_fprintf(fopen(file_name, "w"));
        exit(0);
}        

file_name is initially set to 0x0 on the RedHat 5.1 Intel box, thus
causeing a segfault. On PPC, the pointer is initially pointing somewhere
on the stack (in my case to 0x7ffffcf0)

with the following code, it doesn't segfault on the x86 box, and has the
same crash in _IO_vfprintf on my PPC boxes (glibc-2.1 and glibc-1.99)

int main(int argc, char** argv)
{
        test_fprintf(fopen(argv[1], "w"));
        exit(0);
}   

--------------------------------------------------------------------------
| Troy Benjegerdes    |       troy at microux.com     |    hozer at drgw.net   |
|    Unix is user friendly... You just have to be friendly to it first.  |
| This message composed with 100% free software.    http://www.gnu.org   |
--------------------------------------------------------------------------


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




More information about the Linuxppc-dev mailing list