Subject: Re: bug#46439: 26.1; command“break” within gdb afterwards run “list 1”infinitely

From: Alexandre Garreau <[email-masked]>
Date: Thu, 11 Feb 2021 21:47:28 +0100

Le jeudi 11 février 2021 18:05:52 CET, vous avez écrit :
> > From: [email-masked] (Alexandre François Garreau)
> > Date: Thu, 11 Feb 2021 17:43:24 +0100
> > 
> > If I run M-x gdb and then within the GUD prompt type “b main:1” for
> > instance (but it’ll be the same for any “break” command), it will
> > print
> > the classical “Breakpoint 1 at 0xXXXX: file file.c, line N.”, then
> > will
> > run “l 1” repeatedly while feeling the buffer with thousands of lines
> > of the first ten lines of source file.  I don’t know why’s that, nor
> > how to investigate.  I use the Debian GNU/Linux version.
> 
> I cannot reproduce this, neither in Emacs 26.1 nor in the current
> development version.

That’s unfortunate… I somehow was afraid of that…  I hoped a such problem 
couldn’t be a debian thing because of what it pertained to…

> Which version of GDB do you have?

GNU gdb (Debian 8.2.1-2+b3) 8.2.1

> And these messages might have something to do with the problem you
> 
> see:
> > error in process filter: gdb-input: Process gud-commissaire-priseur
> > not running error in process filter: Process gud-commissaire-priseur
> > not running

No, these were after the problem appeared, when I killed the buffer and 
mistyped something.  I can reproduce without these errors.  Only the 
 “Target doesn’t support non-stop mode.  Turning it off.” stays.

> Do you have some GUD customizations?  Does the problem happen in
> "emacs -Q"?

These time I have practically no customization.  Yes it also happens with 
emacs -Q.

Let me copy the buffer I get:
Current directory is /home/gal/doc/perso/scol/univ/ubo/s6-2020-2021/rip/c/
tp/udp/enchères/
GNU gdb (Debian 8.2.1-2+b3) 8.2.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/
gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from test...done.
(gdb) break main:1
Breakpoint 1 at 0x1129: file test.c, line 4.
(gdb) list test.c:1
1	int
2	main()
3	{
4		return 0;
5	}

and those lasts lines from “(gdb) list test.c:1” keeps repeating 
infinitely.  The fact it begins with the prompt made me think it’s a 
problem with emacs sending this command, not with gdb.

When reproducing, some times I got a y-or-n question “File /home/gal/tmp/
français/"/home/gal/tmp/fran\303\247ais/test.c" is read-only on disk.  
Make buffer read-only, too? (y or n)” and get the error whatever is the 
answer.

Actually, trying to reproduce with that smaller file, I first failed, then 
tried again in the same directory as before, and got the same problem, 
then tried again in the other directory with the same Makefile, and no 
problem, then with a path as long as before (70 chars, 13 directories) or 
with a path involving non-ascii chars… I got again the error, but if 
deleting the Makefile the error is gone…

Turned out the *minimal* requirement to reproduce are: compiling with 
debugging symbols AND doing that in a directory containing 
a non-ascii character (which will end inside the binary, and create the 
problem even if you’re not anymore in a such path afterward).