error reading variable on Windows Docker Containers

Pedro Alves
Thu Nov 21 13:45:00 GMT 2019

On 11/15/19 5:19 PM, Jonah Graham wrote:
> Hello folks,
> I have a strange error using GDB on a Windows Docker container and I don't
> know where to start in diagnosing the problem.
> Simply, when trying to print characters or strings I get "error reading
> variable". For example:
> (gdb) p 'Z'
> $1 = 90 '<error reading variable>
> instead of:
> $1 = 90 'Z'
> Full log below. This is running a Windows Docker container (FROM
> using msys2's distribution of
> mingw-w64-x86_64-gdb.

Since this is about characters and strings, maybe this is somehow related
to charset conversion?  Compare what does "show charset" and
say in the container vs non-container cases.  Maybe one of the GDB's is
built against GNU iconv, while the other one isn't.  Maybe comparing
"show configuration" gives you some clue.

Otherwise, debugging gdb should help you find the problem.  A
breakpoint on "error" should find what is throwing the error.

Pedro Alves

More information about the Gdb mailing list