bug-ddd
[Top][All Lists]
Advanced

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

DDD 3.2.1 (sparc-sun-solaris2.6) gets 'Bus Error' signal.


From: Carlos Ramos Estrada
Subject: DDD 3.2.1 (sparc-sun-solaris2.6) gets 'Bus Error' signal.
Date: Wed, 14 Feb 2001 18:17:04 +0100 (MET)

I wanted to beggug my program, se program code below.

Steps:
1- open ddd with no arguments.
2- open File->program->copychar.
3- put Breakpoints in lines;
        L-18,L-26 and L-44
4- open View->Data Window.
5- Select Data->Display Local Variables.
6- click on RUN.

I get a Buss error signal!

P.S.
If I click inside the window(there the code is) before I click "Run"
then I don't get any error signal???


************************
log file
************************
attached.


***************
compiler
***********
gcc v3.10


***************
the program code
***************
#include <stdio.h>
#include <stdlib.h>

/* open infil for reading, open outfil for writing. */
void open_files(char *inname,FILE *infil,char *outname,FILE *outfil);

/* close both files. */
void close_files(FILE *infil,FILE *outfil);

int main(void)
{
    FILE *infile, *outfile;
    int c;
    
    open_files("intext",infile,"outtext",outfile);

    /* read one character */
    if ((c=fgetc(infile)) == EOF) {
        perror("kan ej läsa");
        exit(1);
    }

    printf("inlas char = %c\t%c\n",c,c+1);

    /* put one character */
    if ((c=fputc(c,outfile)) == EOF) {
        perror("kan ej skriva");
        exit(1);
    }

    printf("char = %c\t%c\n",c,c+1);

    close_files(infile,outfile);

    return 0;
}

void open_files(char *inname,FILE *infil,char *outname,FILE *outfil)
{
    if ((infil=fopen(inname,"r")) == NULL) {
        perror("vid open_files - 1 -");
        exit(1);
    }
    if ((outfil=fopen(outname,"w")) == NULL) {
        perror("vid open_files - 2 -");
        exit(1);
    }
}
    
void close_files(FILE *infil,FILE *outfil)
{
    int c;

    if ((c=fclose(infil)) == EOF) {
        perror("vid close_files - 1 -");
        exit(1);
    }
    if ((c=fclose(outfil)) == EOF) {
        perror("vid close_files - 1 -");
        exit(1);
    }
    
}

*******************************************************

My regards
-- 

/ Carlos 

e-mail :  address@hidden
 
GNU DDD 3.2.1 (sparc-sun-solaris2.6)
Copyright (C) 1995-1999 Technische Universitaet Braunschweig, Germany.
Copyright (C) 1999-2000 Universitaet Passau, Germany.
Compiled with SunPRO CC 0x420
Requires X11R6, Xt11R6, Motif 1.2.6 (OSF/Motif Version 1.2.6)
Includes DDD core, Manual, App defaults, XPM 3.4.10, Athena Panner
Built 2000-07-05 by Andreas Jonasson <address@hidden>.
$  /usr/pd/gnu/bin/ddd
+  /bin/sh -c 'exec gdb -q -fullname'
#  Hello, world!
#  Starting GDB...
#  Enabling core dumps...
#  Enabling core dumps...done.
#  Running GDB (pid 14631, tty /dev/pts/3)...
#  Current language: c/c++
<- "(gdb) "
-> "set prompt (gdb) "
<- "(gdb) "
-> "set height 0"
<- "(gdb) "
-> "set width 0"
<- "(gdb) "
-> "set annotate 1"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
   "(gdb) "
-> " set verbose off"
<- "(gdb) "
-> "info line"
<- "No line number information available.\n"
   "(gdb) "
-> "list"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
   "(gdb) "
-> "info line"
<- "No line number information available.\n"
   "(gdb) "
-> "output 4711"
<- "4711(gdb) "
-> "show language"
<- "The current source language is \"auto; currently c\".\n"
   "(gdb) "
-> "pwd"
<- "Working directory /users/mdstud/md96/md6cares/SysC.\n"
   "(gdb) "
-> "info breakpoints"
<- "No breakpoints or watchpoints.\n"
   "(gdb) "
-> "show history filename"
<- "The filename in which to record the command history is 
\"/users/mdstud/md96/md6cares/SysC/.gdb_history\".\n"
   "(gdb) "
-> "show history size"
<- "The size of the command history is 256.\n"
   "(gdb) "
-> "info source"
<- "No current source file.\n"
   "(gdb) "
-> "info sources"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
   "(gdb) "
-> "info files"
<- "(gdb) "
-> "info program"
<- "The program being debugged is not being run.\n"
   "(gdb) "
-> "info line main"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
   "(gdb) "
-> "info breakpoints"
<- "No breakpoints or watchpoints.\n"
   "(gdb) "
-> "info source"
<- "No current source file.\n"
   "(gdb) "
-> "info line MAIN"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
   "(gdb) "
-> "info breakpoints"
<- "No breakpoints or watchpoints.\n"
   "(gdb) "
-> "info source"
<- "No current source file.\n"
   "(gdb) "
-> "info line main_"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
   "(gdb) "
-> "info breakpoints"
<- "No breakpoints or watchpoints.\n"
   "(gdb) "
-> "info source"
<- "No current source file.\n"
   "(gdb) "
-> "info line MAIN_"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
   "(gdb) "
-> "info breakpoints"
<- "No breakpoints or watchpoints.\n"
   "(gdb) "
-> "info source"
<- "No current source file.\n"
   "(gdb) "
-> "info line main__"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
   "(gdb) "
-> "info breakpoints"
<- "No breakpoints or watchpoints.\n"
   "(gdb) "
-> "info source"
<- "No current source file.\n"
   "(gdb) "
-> "info line MAIN__"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
   "(gdb) "
-> "info breakpoints"
<- "No breakpoints or watchpoints.\n"
   "(gdb) "
-> "info source"
<- "No current source file.\n"
   "(gdb) "
-> "info line _main"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
   "(gdb) "
-> "info breakpoints"
<- "No breakpoints or watchpoints.\n"
   "(gdb) "
-> "info source"
<- "No current source file.\n"
   "(gdb) "
-> "info line _MAIN"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
   "(gdb) "
-> "info breakpoints"
<- "No breakpoints or watchpoints.\n"
   "(gdb) "
-> "info source"
<- "No current source file.\n"
   "(gdb) "
-> "info line __main"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
   "(gdb) "
-> "info breakpoints"
<- "No breakpoints or watchpoints.\n"
   "(gdb) "
-> "info source"
<- "No current source file.\n"
   "(gdb) "
-> "info line __MAIN"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
   "(gdb) "
-> "info breakpoints"
<- "No breakpoints or watchpoints.\n"
   "(gdb) "
-> "source /var/tmp/caazxa4JC"
<- "(gdb) "
-> "info breakpoints"
<- "No breakpoints or watchpoints.\n"
   "(gdb) "
-> "# reset"
<- "(gdb) "
-> "info breakpoints"
<- "No breakpoints or watchpoints.\n"
   "(gdb) "
-> "display"
<- "(gdb) "
-> "info display"
<- "There are no auto-display expressions now.\n"
   "(gdb) "
-> "set environment TERM dumb"
<- "(gdb) "
-> "info files"
<- "(gdb) "
-> "info program"
<- "The program being debugged is not being run.\n"
   "(gdb) "
-> "help detach"
<- "Detach a process or file previously attached.\n"
   "If a process, it is no longer traced, and it continues its execution.  If 
you\n"
   "were debugging a file, the file is closed and gdb no longer accesses it.\n"
   "(gdb) "
-> "help run"
<- "Start debugged program.  You may specify arguments to give it.\n"
   "Args may include \"*\", or \"[...]\"; they are expanded using \"sh\".\n"
   "Input and output redirection with \">\", \"<\", or \">>\" are also 
allowed.\n"
   "\n"
   "With no arguments, uses arguments last specified (with \"run\" or \"set 
args\").\n"
   "To cancel previous arguments and run with no arguments,\n"
   "use \"set args\" without arguments.\n"
   "(gdb) "
-> "help step"
<- "Step program until it reaches a different source line.\n"
   "Argument N means do this N times (or till program stops for another 
reason).\n"
   "(gdb) "
-> "help stepi"
<- "Step one instruction exactly.\n"
   "Argument N means do this N times (or till program stops for another 
reason).\n"
   "(gdb) "
-> "help next"
<- "Step program, proceeding through subroutine calls.\n"
   "Like the \"step\" command as long as subroutine calls do not happen;\n"
   "when they do, the call is treated as one instruction.\n"
   "Argument N means do this N times (or till program stops for another 
reason).\n"
   "(gdb) "
#  Starting GDB...done.
#  Welcome to DDD 3.2.1 "Liftoff" (sparc-sun-solaris2.6)
-> "help nexti"
<- "Step one instruction, but proceed through subroutine calls.\n"
   "Argument N means do this N times (or till program stops for another 
reason).\n"
   "(gdb) "
-> "help until"
<- "Execute until the program reaches a source line greater than the current\n"
   "or a specified line or address or function (same args as break command).\n"
   "Execution will also stop upon exit from the current stack frame.\n"
   "(gdb) "
-> "help finish"
<- "Execute until selected stack frame returns.\n"
   "Upon return, the value returned is printed and put in the value history.\n"
   "(gdb) "
-> "help cont"
<- "Continue program being debugged, after signal or breakpoint.\n"
   "If proceeding from breakpoint, a number N may be used as an argument,\n"
   "which means to set the ignore count of that breakpoint to N - 1 (so that\n"
   "the breakpoint won\'t break until the Nth time it is reached).\n"
   "(gdb) "
-> "help signal"
<- "Continue program giving it signal specified by the argument.\n"
   "An argument of \"0\" means continue program without giving it a signal.\n"
   "(gdb) "
-> "help kill"
<- "Kill execution of program being debugged.\n"
   "(gdb) "
-> "help up"
<- "Select and print stack frame that called this one.\n"
   "An argument says how many frames up to go.\n"
   "(gdb) "
-> "help down"
<- "Select and print stack frame called by this one.\n"
   "An argument says how many frames down to go.\n"
   "(gdb) "
#  Filtering files...
#  Filtering files...done.
-> "info files"
<- "(gdb) "
-> "info program"
<- "The program being debugged is not being run.\n"
   "(gdb) "
-> "file /users/mdstud/md96/md6cares/SysC/copychar"
<- "Reading symbols from /users/mdstud/md96/md6cares/SysC/copychar...done."
<- "(gdb) "
-> "info line"
<- "No line number information available.\n"
   "(gdb) "
-> "list"
<- "6\t\n"
   "7\t/* close both files. */\n"
   "8\tvoid close_files(FILE *infil,FILE *outfil);\n"
   "9\t\n"
   "10\tint main(void)\n"
   "11\t{\n"
   "12\t    FILE *infile, *outfile;\n"
   "13\t    int c;\n"
   "14\t    \n"
   "15\t    open_files(\"intext\",infile,\"outtext\",outfile);\n"
   "(gdb) "
-> "info line"
<- "Line 15 of \"cpchar.c\" starts at address 0x107d0 <main+4> and ends at 
0x107f0 <main+36>.\n"
   "\032\032/users/mdstud/md96/md6cares/SysC/cpchar.c:15:296:beg:0x107d0\n"
   "(gdb) "
-> "info breakpoints"
<- "No breakpoints or watchpoints."
<- "(gdb) "
-> "display"
<- "(gdb) "
-> "info display"
<- "There are no auto-display expressions now."
<- "(gdb) "
#  Reading file "/users/mdstud/md96/md6cares/SysC/cpchar.c"...
#  Reading file "/users/mdstud/md96/md6cares/SysC/cpchar.c"...done.
#  File "/users/mdstud/md96/md6cares/SysC/cpchar.c" 64 lines, 1299 characters
#  Setting buttons...
#  Setting buttons...done.
-> "info source"
<- "Current source file is cpchar.c\n"
   "Compilation directory is /users/mdstud/md96/md6cares/SysC/\n"
   "Located in /users/mdstud/md96/md6cares/SysC/cpchar.c\n"
   "Contains 64 lines.\n"
   "Source language is c.\n"
   "(gdb) "
-> "info files"
<- "Symbols from \"/users/mdstud/md96/md6cares/SysC/copychar\".\n"
   "Local exec file:\n"
   "\t`/users/mdstud/md96/md6cares/SysC/copychar\', file type elf32-sparc.\n"
   "\tEntry point: 0x106f4\n"
   "\t0x000100d4 - 0x000100e5 is .interp\n"
   "\t0x000100e8 - 0x00010238 is .hash\n"
   "\t0x00010238 - 0x00010568 is .dynsym\n"
   "\t0x00010568 - 0x0001065b is .dynstr\n"
   "\t0x0001067c - 0x00010688 is .rela.bss\n"
   "\t0x00010688 - 0x000106f4 is .rela.plt\n"
   "\t0x000106f4 - 0x00010a5c is .text\n"
   "\t0x00010a5c - 0x00010a70 is .init\n"
   "\t0x00010a70 - 0x00010a84 is .fini\n"
   "\t0x00010a88 - 0x00010b3e is .rodata\n"
   "\t0x00020b40 - 0x00020b4c is .got\n"
   "\t0x00020b4c - 0x00020bec is .plt\n"
   "\t0x00020bec - 0x00020c9c is .dynamic\n"
   "\t0x00020c9c - 0x00020ca4 is .ctors\n"
   "\t0x00020ca4 - 0x00020cac is .dtors\n"
   "\t0x00020cac - 0x00020cb0 is .bss\n"
   "(gdb) "
-> "info program"
<- "The program being debugged is not being run.\n"
   "(gdb) "
-> "output inlas"
<- "No symbol \"inlas\" in current context.\n"
   "(gdb) "
-> "output c"
<- "No symbol \"c\" in current context.\n"
   "(gdb) "
-> "output open_files"
<- "{void (char *, FILE *, char *, FILE *)} 0x108c8 <open_files>(gdb) "
-> "output infile"
<- "No symbol \"infile\" in current context.\n"
   "(gdb) "
-> "output intext"
<- "No symbol \"intext\" in current context.\n"
   "(gdb) "
-> "output if"
<- "A parse error in expression, near `if\'.\n"
   "(gdb) "
-> "break cpchar.c:18"
<- "Breakpoint 1 at 0x107f0: file cpchar.c, line 18.\n"
   "(gdb) "
-> "info breakpoints"
<- "Num Type           Disp Enb Address    What\n"
   "1   breakpoint     keep y   0x000107f0 in main at cpchar.c:18\n"
   "(gdb) "
-> "output outfile"
<- "No symbol \"outfile\" in current context.\n"
   "(gdb) "
-> "break cpchar.c:26"
<- "Breakpoint 2 at 0x10848: file cpchar.c, line 26.\n"
   "(gdb) "
-> "info breakpoints"
<- "Num Type           Disp Enb Address    What\n"
   "1   breakpoint     keep y   0x000107f0 in main at cpchar.c:18\n"
   "2   breakpoint     keep y   0x00010848 in main at cpchar.c:26\n"
   "(gdb) "
-> "break cpchar.c:44"
<- "Breakpoint 3 at 0x10920: file cpchar.c, line 44.\n"
   "(gdb) "
-> "info breakpoints"
<- "Num Type           Disp Enb Address    What\n"
   "1   breakpoint     keep y   0x000107f0 in main at cpchar.c:18\n"
   "2   breakpoint     keep y   0x00010848 in main at cpchar.c:26\n"
   "3   breakpoint     keep y   0x00010920 in open_files at cpchar.c:44\n"
   "(gdb) "
-> "frame"
<- "No stack.\n"
   "(gdb) "
-> "info locals"
<- "No frame selected.\n"
   "(gdb) "
#  Creating status display...
#  Creating status display...done.
#  Display -1: `info locals` (enabled)
#  Display -1: `info locals` (enabled)
-> "set environment TERM dumb"
<- "(gdb) "
-> "run"
<- "Starting program: /users/mdstud/md96/md6cares/SysC/copychar "
<- "warning: Unable to find dynamic linker breakpoint function.\n"
   "warning: GDB will be unable to debug shared library initializers\n"
   "warning: and track explicitly loaded dynamic code."
<- "\n"
   "Breakpoint 3, "
<- "open_files"
<- " ("
<- "inname"
<- "="
<- "0x10a90"
<- " "
<- "\""
<- "i"
<- "n"
<- "t"
<- "ext\", infil=0xef7a7470, outname=0x10a98 \"outtext\", outfil=0x5) at 
cpchar.c:44\n"
   "\032\032/users/mdstud/md96/md6cares/SysC/cpchar.c:44:862:beg:0x10920\n"
   "(gdb) "
-> "info breakpoints"
<- "Num Type           Disp Enb Address    What\n"
   "1   breakpoint     keep y   0x000107f0 in main at cpchar.c:18\n"
   "2   breakpoint     keep y   0x00010848 in main at cpchar.c:26\n"
   "3   breakpoint     keep y   0x00010920 in open_files at cpchar.c:44\n"
   "\tbreakpoint already hit 1 time\n"
   "(gdb) "
-> "info locals"
<- "No locals."
<- "(gdb) "
!  Bus Error
-> "\003"
+  /bin/sh -c 'gdb -x /var/tmp/daaAxa4JC /usr/pd/gnu/bin/ddd core'
GDB is free software and you are welcome to 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.
GDB 4.16.gnat.1.13 (sparc-sun-solaris2.5.1), 
Copyright 1996 Free Software Foundation, Inc...
Core was generated by `/usr/pd/gnu/bin/ddd'.
Program terminated with signal 10, Bus error.
Reading symbols from /usr/dt/lib/libXm.so.3...done.
Reading symbols from /usr/X11/lib/libXp.so.6.2...done.
Reading symbols from /usr/pd/X11/lib/libXpm.so.4.7...done.
Reading symbols from /usr/X11/lib/libXaw.so.6.1...done.
Reading symbols from /usr/X11/lib/libXmu.so.6.0...done.
Reading symbols from /usr/X11/lib/libXext.so.6.3...done.
Reading symbols from /usr/X11/lib/libXt.so.6.0...done.
Reading symbols from /usr/X11/lib/libSM.so.6.0...done.
Reading symbols from /usr/X11/lib/libICE.so.6.3...done.
Reading symbols from /usr/X11/lib/libX11.so.6.1...done.
Reading symbols from /usr/lib/libsocket.so.1...done.
Reading symbols from /usr/lib/libnsl.so.1...done.
Reading symbols from /opt/SUNWspro/lib/libm.so.1...done.
Reading symbols from /usr/lib/libC.so.5...done.
Reading symbols from /usr/lib/libw.so.1...done.
Reading symbols from /usr/lib/libc.so.1...done.
Reading symbols from /usr/openwin/lib/libXt.so.4...done.
Reading symbols from /usr/openwin/lib/libX11.so.4...done.
Reading symbols from /usr/lib/libdl.so.1...done.
Reading symbols from /usr/lib/libmp.so.2...done.
Reading symbols from /usr/openwin/lib/libSM.so.6...done.
Reading symbols from /usr/openwin/lib/libICE.so.6...done.
Reading symbols from /usr/openwin/lib/libXext.so.0...done.
Reading symbols from /usr/platform/SUNW,Ultra-1/lib/libc_psr.so.1...done.
Reading symbols from /usr/lib/locale/iso_8859_1/iso_8859_1.so.1...done.
#0  0xef18878c in   ()
#0  0xef18878c in   ()
#1  0x24a4d8 in __0FNddd_dump_coreie (sig=10, __builtin_va_alist=<error type>)
    at exit.C:538
#2  0x24a258 in __0FJddd_fatalie (sig=10, __builtin_va_alist=<error type>)
    at exit.C:476
#3  <signal handler called>
#4  0x220f30 in __0oGstringasRC6Gstring (this=<incomplete type>, address@hidden)
    at strclass.h:970
#5  0x224018 in   () at DynArray.h:104
#6  0x21e230 in   () at VarArray.h:97
#7  0x21d318 in __0FPextra_completedRC6IVarArray76Gstring_RC6IVarArray7Pv_Pv (
    address@hidden, address@hidden, data=<incomplete type>)
    at comm-manag.C:2975
#8  0x3a5560 in __0fIGDBAgentMhandle_inputR6Gstring (this=0x635bb0, 
    answer=<incomplete type>) at GDBAgent.C:1442
#9  0x3a4644 in __0fIGDBAgentHInputHPP6FAgentPvTCT (agent=<incomplete type>, 
    __0U__ARG=<incomplete type>, call_data=<incomplete type>)
    at GDBAgent.C:1173
#10 0x1172e4 in __0fLHandlerListEcallUiCPvTCK (this=0x635bd8, type=10, 
    source=<incomplete type>, call_data=<incomplete type>) at HandlerL.C:152
#11 0x119a5c in :: (this=<incomplete type>, type=10, 
    call_data=<incomplete type>) at Agent.h:175
#12 0x1189cc in __0fNLiterateAgentIdispatchiPcTB (this=0x635bb0, type=10, 
    data=<incomplete type>, length=6) at LiterateA.C:342
#13 0x118d1c in __0fNLiterateAgentKinputReadyP6KAsyncAgentT (
    c=<incomplete type>) at LiterateA.C:369
#14 0x115288 in __0fKAsyncAgentIdispatchPiPUl (this=<incomplete type>, 
    __0U__ARG=<incomplete type>, inputId=0xefffda5c) at AsyncAgent.C:218
#15 0x114d50 in __0fKAsyncAgentRsomethingHappenedPvPiPUlT (
    client_data=<incomplete type>, fid=<incomplete type>, inputId=0xefffda5c)
    at AsyncAgent.C:106
#16 0xef4c8074 in   ()
#17 0xef4c84d8 in   ()
#18 0xda164 in __0FSprocess_next_eventv () at ddd.C:2850
#19 0x28a074 in __0FNddd_main_loopv () at mainloop.C:89
#20 0xd96cc in main (argc=1, argv=<incomplete type>) at ddd.C:2804
<- "Quit\n"
   "(gdb) "
#  Display -1: `info locals` (enabled)
-> "output one"
<- "No symbol \"one\" in current context."
<- "(gdb) "
-> "quit"
<- "The program is running.  Quit anyway (and kill it)? (y or n) "
-> "yes"
#  Running GDB (pid 14631, tty /dev/pts/3)...Exit 0.
#  Saving history in "/users/mdstud/md96/md6cares/SysC/.gdb_history"...
#  Saving history in "/users/mdstud/md96/md6cares/SysC/.gdb_history"...done.
#  Saving history in "/users/mdstud/md96/md6cares/.ddd/history"...
#  Saving history in "/users/mdstud/md96/md6cares/.ddd/history"...done.
#  Thanks for using DDD 3.2.1!  (We apologize for the inconvenience.)

reply via email to

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