public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug remote/18721] New: endless loop in sh-stub.c
@ 2015-07-26 17:03 pipcet at gmail dot com
  2022-01-07 21:05 ` [Bug remote/18721] " tromey at sourceware dot org
  0 siblings, 1 reply; 2+ messages in thread
From: pipcet at gmail dot com @ 2015-07-26 17:03 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18721

            Bug ID: 18721
           Summary: endless loop in sh-stub.c
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: remote
          Assignee: unassigned at sourceware dot org
          Reporter: pipcet at gmail dot com
  Target Milestone: ---

I would like to report the following bug in sh-stub.c, which affected me when
using the file as a template for my own gdb stubs file:

diff --git a/gdb/stubs/sh-stub.c b/gdb/stubs/sh-stub.c
index 76c98a5..20407a0 100644
--- a/gdb/stubs/sh-stub.c
+++ b/gdb/stubs/sh-stub.c
@@ -469,7 +469,7 @@ putpacket (char *buffer)
          /* Do run length encoding */
          for (runlen = 0; runlen < 100; runlen ++) 
            {
-             if (src[0] != src[runlen]) 
+             if (src[0] != src[runlen] || runlen == 99) 
                {
                  if (runlen > 3) 
                    {

Without this fix, putpacket() will loop endlessly when presented with an
all-zero buffer.

Thanks!

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug remote/18721] endless loop in sh-stub.c
  2015-07-26 17:03 [Bug remote/18721] New: endless loop in sh-stub.c pipcet at gmail dot com
@ 2022-01-07 21:05 ` tromey at sourceware dot org
  0 siblings, 0 replies; 2+ messages in thread
From: tromey at sourceware dot org @ 2022-01-07 21:05 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18721

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
It's best to send patches to gdb-patches.
If you have write access, you could send this as an FYI patch,
as the stubs are not truly maintained - if you've used one,
you have more experience than most of us.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-07 21:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-26 17:03 [Bug remote/18721] New: endless loop in sh-stub.c pipcet at gmail dot com
2022-01-07 21:05 ` [Bug remote/18721] " tromey at sourceware dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).