| Summary: | [tcf] request of small amount of memory causes Byte64 conversion to "overflow" passed buffer | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] TCF | Reporter: | Kirk Beitz <kirk.beitz> | ||||
| Component: | Core | Assignee: | Project Inbox <dsdp.tm.tcf-inbox> | ||||
| Status: | RESOLVED INVALID | QA Contact: | Martin Oberhuber <mober.at+eclipse> | ||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | cdtdoug, eugene | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Kirk Beitz
Created attachment 179604 [details]
patch to MemoryProxy.java that bulletproofs the call to JSON.toByteArray()
I cannot reproduce the error. Reading 3-byte chunk of memory appears to work fine in the current code. It looks like you are using agent that is different from one in Eclipse repository, and it produces malformed BASE64 strings. Can you send a value of BASE64 string that causes JSON.toByteArray() to fail? If the string is indeed malformed, throwing IllegalArgumentException is correct behavior. BTW, what does the exception message say? the problem occurs on a target which disallows the reading of the 3 bytes in question due to access restriction. an error message is getting sent back. the String being sent back is something like "TLTVAA==" ... 8 characters, with the last two being "=" signs. when the Byte64 translator parses this, it starts with an outlen of 8/4*3 or 6, and then reduces the size for each of the "=" signs so outlen is 4 … which is still larger than the input buffer which is 3. So the agent does misbehave. Even if it can read memory only in 4-byte chucks, it should transmit only requested number of bytes. Otherwise it is a communication error and an the exception seems to be the best way to report it. Looks like agent problem to me. i will see about what the agent is doing. sounds like the expectation is that it should only be returning a JSON string of 4 bytes that gets turned into the buffer of 3 that i want. Moving bugs to new home for IP log. |