Bug 328021

Summary: invalid remote reply from gdbserver
Product: [Fedora] Fedora Reporter: David L. <idht4n>
Component: gdbAssignee: Jan Kratochvil <jan.kratochvil>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 8   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: gdb-6.6-33.fc8 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-10-12 09:22:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David L. 2007-10-11 17:23:04 UTC
Description of problem:
After attaching to a gdbserver and continuing, I get an error:
[New Thread 9788]
warning: Invalid remote reply:

This warning does not seem benign... I'm unable to debug.

Version-Release number of selected component (if applicable):
gdb-6.6-32.fc8
GNU gdb Red Hat Linux (6.6-32.fc8rh)


How reproducible:
Every time on the application I'm trying to debug.
It doesn't happen on a simple "helloworld" app.
Perhaps the error is related to multiple threads.

Steps to Reproduce:
1. gdbserver localhost:9100 myapp
2. gdb myapp
3. target remote localhost:9100
4. cont
  
Actual results:
warning: Invalid remote reply:

Expected results:


Additional info:

Comment 1 David L. 2007-10-11 18:12:05 UTC
This is slightly off-topic, but I'm unable to build gdb 6.6 or 6.7 to
check if my problem happens with those vanilla releases.  I get this
error:

/usr/include/netinet/tcp.h:236: error: field ‘tcpm_addr’ has incomplete type


Comment 2 Jan Kratochvil 2007-10-11 19:28:10 UTC
BTW what is the reason to use Fedora-built gdbserver on Fedora?
I was considering removing gdbserver from the Fedora packaging, IMO it is useful
only for embedded targets when one has to build everything specifically for his
custom hardware/arch.

Otherwise confirming some bug exists:
  warning: Invalid remote reply: 
It occurs for me on Firefox but even not on a simple threaded sample code.

(In reply to comment #1)
> /usr/include/netinet/tcp.h:236: error: field ‘tcpm_addr’ has incomplete type

It is really offtopic here, IMO it should be fixed with next glibc (2.6.20-19):
http://koji.fedoraproject.org/koji/buildinfo?buildID=20734
* Thu Oct 11 2007 Jakub Jelinek <jakub> 2.6.90-19
- fix <netinet/tcp.h>


Comment 3 Jan Kratochvil 2007-10-11 20:02:04 UTC
Related to Bug 314131, going to commit for F8 a backport.

gdbserver:
2007-06-27  Daniel Jacobowitz  <dan>

        * thread-db.c (thread_db_find_new_threads): Add prototype.
        (thread_db_create_event): Check for the main thread before adding
        a new thread.
        (maybe_attach_thread): Only enable event reporting if TID == 0.
        (thread_db_get_tls_address): Check for new threads.

It is broken in gdb-6.6 upstream (due to IMO the glibc changes since that time)
and I expect it would work in gdb-6.7 upstream.
gdb-6.7 is going to land only for F9, though.


Comment 4 Jan Kratochvil 2007-10-12 09:22:27 UTC
F-8 - gdb-6.6-33.fc8:
* Thu Oct 11 2007 Jan Kratochvil <jan.kratochvil> - 6.6-33
- Fix gdbserver for threaded applications and recent glibc (BZ 328021).

Rawhide - gdb-6.6-34.fc9:
* Fri Oct 12 2007 Jan Kratochvil <jan.kratochvil> - 6.6-34
- Fix gdbserver for threaded applications and recent glibc (BZ 328021).