This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

remote/1944: "load" to remote target fails with "Memory access error"


>Number:         1944
>Category:       remote
>Synopsis:       "load" to remote target fails with "Memory access error"
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat May 14 10:38:01 UTC 2005
>Closed-Date:
>Last-Modified:
>Originator:     Steven Johnson
>Release:        GDB 6.3
>Organization:
>Environment:
Linux x86 (Suspect all)
>Description:
When attempting a "load" to a remote target, "load" fails after first packet is successfuly transfered to the target with:

Loading section .text, size 0xdc220 lma 0x0
Sending packet: $X0,400:.....
[$][O][K][#][9][a]Packet received: OK
remote:target_xfer_partial (2, (null), 0x0,  0x40ed9008,  0x0, 1024) = 1024, bytes = 48 00 40 00 41 50 50 20 ...
Memory access error while loading section .text.

Problem is because "err" variable in "load_section_callback" function of "symfile.c" is not initialised, and the call to target_write_memory_partial will not set "err" if it uses "target_xfer_partial" to do the memory transfer.
>How-To-Repeat:
Be unlucky enough to have "err" not = 0 when trying to "load" a remote target.
>Fix:
Initialise the "err" variable to 0 in "load_section_callback"

Patch included in the file attachment
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-patch; name="gdb-6.3-load-remote-target-bug.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="gdb-6.3-load-remote-target-bug.patch"

ZGlmZiAtTmF1ciBnZGItNi4zL2dkYi9zeW1maWxlLmMgZ2RiLTYuMy1tb2RpZmllZC9nZGIvc3lt
ZmlsZS5jCi0tLSBnZGItNi4zL2dkYi9zeW1maWxlLmMJMjAwNC0wOS0zMCAyMzoyMzowOS4wMDAw
MDAwMDAgLTExMDAKKysrIGdkYi02LjMtbW9kaWZpZWQvZ2RiL3N5bWZpbGUuYwkyMDA1LTA1LTE0
IDIxOjAxOjE4Ljk1OTMyMTY1MyAtMTEwMApAQCAtMTQwNSw3ICsxNDA1LDcgQEAKIAkgIHN0cnVj
dCBjbGVhbnVwICpvbGRfY2hhaW47CiAJICBDT1JFX0FERFIgbG1hID0gYmZkX3NlY3Rpb25fbG1h
IChhYmZkLCBhc2VjKSArIGFyZ3MtPmxvYWRfb2Zmc2V0OwogCSAgYmZkX3NpemVfdHlwZSBibG9j
a19zaXplOwotCSAgaW50IGVycjsKKwkgIGludCBlcnIgPSAwOwogCSAgY29uc3QgY2hhciAqc2Vj
dF9uYW1lID0gYmZkX2dldF9zZWN0aW9uX25hbWUgKGFiZmQsIGFzZWMpOwogCSAgYmZkX3NpemVf
dHlwZSBzZW50OwogCg==


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]