This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

-data-disassemble segmetation fault


Hi,

I tried using the -data-disassemble command on the attached file.
I ran this command,
-data-disassemble -f basic.c -l 25 -n -1 -- 1
and gdb segfaulted.

I am concerned that the MI code is being presented as an alternative 
interface to GDB, but it is mainly untested when it comes to building 
a practical application on top of it. Either that, or I just found the
needle in the haystack crash, since it was the first or second command I
ran.

Please let me know if I am doing anything wrong.

I have attached the file that reproduced the crash ( basic.c ), and I also
attached a backtrace. I was running a gdb out of cvs, freshly updated
tonight ( 07/29/2003 ).

Thanks,
Bob Rossi
#include <stdio.h>
#include <unistd.h>

int two(int a){
   return a*a;
}

int one(int a, int b){
   return two(a) + two(b);
}

void short_func(void){
   int i = 0;
   i = 1;
   i = 2;
}

void long_func(void){
   int k = 0;
   k = 1;
   k = 2;
}

#define SIZE 100000

struct test {
   int a;
   int b;
   int c;  
} a = { 1, 2, 3 };

int main(int argc, char **argv){
   int i = 3;
   int j = 4;
   char temp[SIZE];

   long_func();

   fprintf(stderr, "ABCDEFGHI\n");
   fprintf(stderr, "ABCDEFGH\n");
   fprintf(stderr, "ABCDEFG\n");
   fprintf(stderr, "ABCDEF\n");
   fprintf(stderr, "ABCDE\n");
   fprintf(stderr, "ABCD\n");
   fprintf(stderr, "ABC\n");
   fprintf(stderr, "AB\n");
   fprintf(stderr, "A\n");

   for ( i = 0; i < 100; i++)
       fprintf(stderr, "Yo\n");

   long_func();

   short_func();
   short_func();
   short_func();

   /* A simple loop */
   for(i = 0; i < 100000; ++i)
      j++;

   i = one(i, j);
   j = two(i);

   for(i = 0; i < 6; ++i)
      fprintf(stderr, "returned from init\n");

   for(i = 0; i < SIZE; ++i)
      temp[i] = (i % 40) + 40;

   i += j;
   
   return 0;
}

Attachment: gdb.bt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]