Closed U2654 closed 3 years ago
It works on our computers.
Could you post more information about your system, and especially where the exception was thrown (maybe with gdb catch throw
).
Thanks. I set up new installations and can confirm that the problem does not appear on a Linux native machine and a Linux VM. I have the problem within a Linux Docker container. I guess it might be some port/socket issue if I understand the gdb output. It is strange that the problem did not appear with the same container and a former risc-vp version. Maybe we can close this issue?
`Catchpoint 1 (exception thrown), 0x00007f4c368b4d1d in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (gdb) bt
at /home/risc-v/riscv-vp/vp/src/core/common/gdb-mc/gdb_server.cpp:94
mm=0x7ffec7a05210, port=5005, mmus=std::vector of length 0, capacity 0)
at /home/risc-v/riscv-vp/vp/src/core/common/gdb-mc/gdb_server.cpp:49
fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffec7a0e998) at ../csu/libc-start.c:310
`
Looking at the backtrace, this seems to be a problem with GDBServer::create_sock()
:
This code binds to the IPv6 loopback address (i.e. ::1
) and uses the IPV6_V6ONLY
socket option to make sure that the socket also works with IPv4. The old GDB setup only created an IPv4 socket (that's likely why you didn't encounter this before). Maybe your Docker setup does not allow binding to the loopback interface? Or it doesn't support IPv6 and/or the IPV6_V6ONLY
socket option? Unfortunately, I am not familiar with Docker. You could set a breakpoint in the create_sock
function to check which specific function fails and check the errno
to figure out why it fails.
Maybe we can close this issue?
Would be nice to figure out what's causing this. How do I reproduce this?
It seems to me that IPv6 is disabled in Docker by default. That would explain why you didn't encounter this issue previously. Enabling IPv6 support in the Docker Daemon should fix this https://docs.docker.com/config/daemon/ipv6/
Maybe we can adjust this function to fallback to v4-only if binding to IPv6 fails.
I enabled IPv6 in Docker. It works now. Thanks.
Using riscv-vp or hifive-vp with --debug-mode in the current master throws:
_Error: (E549) uncaught exception: Cannot assign requested address In file: ../../../src/sysc/kernel/scexcept.cpp:101
To reproduce, try
riscv-vp --debug-mode main
in sw/simple-sensorThe problem wasn't in earlier versions.