breakpoints/2115: invalid number of printf arguments within command block causes segfault

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

breakpoints/2115: invalid number of printf arguments within command block causes segfault

unix.gurus

>Number:         2115
>Category:       breakpoints
>Synopsis:       invalid number of printf arguments within command block causes segfault
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 13 20:18:01 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Sean Burford
>Release:        6.3
>Organization:
>Environment:
Ubuntu
>Description:
Setting up a printf with an invalid number of arguments within a command block will crash gdb.
>How-To-Repeat:
Populate test.gdb with:
break _init
commands
  printf "goodbye", $arg0
end
run

And run:
gdb -x test.gdb /bin/ls

gdb will segfault, and then the output of ls will still appear.  Here is the bt for gdb:

#0  0x080ae46a in if_command ()
#1  0x080adfdb in execute_control_command ()
#2  0x080c7d45 in bpstat_do_actions ()
#3  0x0807d4a5 in command_loop ()
#4  0x0807d0ba in read_command_file ()
#5  0x080af34b in script_from_file ()
#6  0x080af95b in source_command ()
#7  0x0807cfff in catch_errors ()
#8  0x0807cf7e in catch_exceptions_with_msg ()
#9  0x0807ce11 in throw_exception ()
#10 0x0807cfd4 in catch_errors ()
#11 0x0807d04e in catch_command_errors ()
#12 0x0807544e in main ()
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
Reply | Threaded
Open this post in threaded view
|

Re: breakpoints/2115: invalid number of printf arguments within command block causes segfault

Daniel Jacobowitz-2
The following reply was made to PR breakpoints/2115; it has been noted by GNATS.

From: Daniel Jacobowitz <[hidden email]>
To: [hidden email]
Cc: [hidden email]
Subject: Re: breakpoints/2115: invalid number of printf arguments within command block causes segfault
Date: Tue, 18 Apr 2006 16:13:20 -0400

 On Thu, Apr 13, 2006 at 08:15:33PM -0000, [hidden email] wrote:
 > >Synopsis:       invalid number of printf arguments within command block causes segfault
 > >Release:        6.3
 
 This is a very tricky thing to fix - but fortunately, we've already
 fixed it!
 
 There has not yet been a release with the fix, but the next release
 will include it.  I now get:
 
 Breakpoint 1 at 0x401e40
 (no debugging symbols found)
 (no debugging symbols found)
 (no debugging symbols found)
 (no debugging symbols found)
 (no debugging symbols found)
 [Thread debugging using libthread_db enabled]
 [New Thread 46912507519568 (LWP 30477)]
 (no debugging symbols found)
 (no debugging symbols found)
 (no debugging symbols found)
 (no debugging symbols found)
 [Switching to Thread 46912507519568 (LWP 30477)]
 
 Breakpoint 1, 0x0000000000401e40 in _init ()
 /home/drow/q/test.gdb:5: Error in sourced command file:
 Wrong number of arguments for specified format-string
 (gdb)
 
 
 --
 Daniel Jacobowitz
 CodeSourcery