Closed puremourning closed 3 years ago
Hmm it seems that adding the env
key doesn't resolve it. In fact, debugging netcoredbg
I find that it's crashing in ManagedDebugger::RunProcess
:
- Thread 4708883: 1: tid=4708883 (paused)
1001: 0@@0..0:3
1006: netcoredbg::ManagedDebugger::RunProcess(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&)::$_1::operator()() const@manageddebugger.cpp:1185
1007: std::__1::result_of<netcoredbg::ManagedDebugger::RunProcess(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&)::$_1 ()>::type netcoredbg::IORedirectHelper::exec<netcoredbg::ManagedDebugger::RunProcess(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&)::$_1>(netcoredbg::ManagedDebugger::RunProcess(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&)::$_1)@ioredirect.h:93
1008: netcoredbg::ManagedDebugger::RunProcess(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&)@manageddebugger.cpp:1184
1009: netcoredbg::ManagedDebugger::RunIfReady()@manageddebugger.cpp:542
1010: netcoredbg::ManagedDebugger::ConfigurationDone()@manageddebugger.cpp:582
1011: netcoredbg::VSCodeProtocol::HandleCommand(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer>&)::$_2::operator()(nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer>&) const@vscodeprotocol.cpp:451
1012: decltype(std::__1::forward<netcoredbg::VSCodeProtocol::HandleCommand(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer>&)::$_2&>(fp)(std::__1::forward<nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&>(fp0), std::__1::forward<nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer>&>(fp0))) std::__1::__invoke<netcoredbg::VSCodeProtocol::HandleCommand(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer>&)::$_2&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer>&>(netcoredbg::VSCodeProtocol::HandleCommand(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer>&)::$_2&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer>&)@type_traits:3545
1013: int std::__1::__invoke_void_return_wrapper<int>::__call<netcoredbg::VSCodeProtocol::HandleCommand(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer>&)::$_2&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer>&>(netcoredbg::VSCodeProtocol::HandleCommand(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer>&)::$_2&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer>&)@__functional_base:317
1014: std::__1::__function::__alloc_func<netcoredbg::VSCodeProtocol::HandleCommand(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer>&)::$_2, std::__1::allocator<netcoredbg::VSCodeProtocol::HandleCommand(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer>&)::$_2>, int (nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer>&)>::operator()(nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer>&)@functional:1546
1015: std::__1::__function::__func<netcoredbg::VSCodeProtocol::HandleCommand(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer>&)::$_2, std::__1::allocator<netcoredbg::VSCodeProtocol::HandleCommand(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer>&)::$_2>, int (nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer>&)>::operator()(nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer>&)@functional:1720
1016: std::__1::__function::__value_func<int (nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer>&)>::operator()(nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer>&) const@functional:1873
1017: std::__1::function<int (nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer>&)>::operator()(nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer>&) const@functional:2548
1018: netcoredbg::VSCodeProtocol::HandleCommand(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer> const&, nlohmann::basic_json<std::__1::map, std::__1::vector, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, long long, unsigned long long, double, std::__1::allocator, nlohmann::adl_serializer>&)@vscodeprotocol.cpp:708
1039: netcoredbg::VSCodeProtocol::CommandLoop()@vscodeprotocol.cpp:816
1044: main@main.cpp:421
1045: start@@start:4
+ Thread 4708921: 2: tid=4708921 (paused)
This, while handling the configurationDone
:
Raw messages which trigger this:
Content-Length: 340\r\n
\r\n
{"command": "initialize", "arguments": {"adapterID": "netcoredbg", "clientID": "vimspector", "clientName": "vimspector", "linesStartAt1": true, "columnsStartAt1": true, "locale": "en_GB", "pathFormat": "path", "supportsVariableType": true, "supportsVariablePaging": false, "supportsRunInTerminalRequest": true}, "seq": 0, "type": "request"}Content-Length: 239\r\n
\r\n
{"command": "setBreakpoints", "arguments": {"source": {"name": "Program.cs", "path": "/Users/ben/.vim/bundle/vimspector/support/test/csharp/Program.cs"}, "breakpoints": [{"line": 31}]}, "sourceModified": false, "seq": 1, "type": "request"}Content-Length: 313\r\n
\r\n
{"command": "launch", "arguments": {"cwd": "/Users/ben/.vim/bundle/vimspector/support/test/csharp", "request": "launch", "program": "/Users/ben/.vim/bundle/vimspector/support/test/csharp/bin/Debug/netcoreapp2.2/csharp.dll", "args": [], "stopAtEntry": true, "env": {}, "name": "test"}, "seq": 3, "type": "request"}Content-Length: 61\r\n
\r\n
{"command": "configurationDone", "seq": 4, "type": "request"}
OK so the problem there is simple: the values in g_dbgshim
are all NULL:
That may be just the way I'm running it. I'll investigate
OK well the problem is that _NSGetExecutablePath
doesn't work the way it's being used:
Form the help:
/ _NSGetExecutablePath() copies the path of the main executable into the buffer buf. The bufsize parameter should initially be the size of the buffer. This function returns 0 if the path was successfully copied. It returns -1 if the buffer is not large enough, and * bufsize is set to the size required. Note that _NSGetExecutablePath() will return "a path" to the executable not a "real path" to the executable. That is, the path may be a symbolic link and not the real file. With deep directories the total bufsize needed could be more than MAXPATHLEN.
But we're using it like this:
static span<char> get_exe_path(span<char> buffer)
{
uint32_t real_len;
if (_NSGetExecutablePath(buffer.data(), &real_len) < 0)
return {};
if (real_len >= buffer.size())
return {};
buffer[real_len] = 0;
return buffer.subspan(0, real_len);
}
So:
real_len
is undefined (random), not the total length buffer.size()
_NSExecutablePath()
does not return the length written to the buffer, real_len
would only be changed if the function returned -1
_NSExecutablePath()
is NULL terminated.Also, while this function can return {}
for multiple reasons, netcoredebug does not handle that, and just eventually crashes.
This patch fixes it:
diff --git a/src/unix/filesystem_unix.cpp b/src/unix/filesystem_unix.cpp
index ebc0c7e..fbbd78e 100644
--- a/src/unix/filesystem_unix.cpp
+++ b/src/unix/filesystem_unix.cpp
@@ -42,14 +42,11 @@ namespace
#elif defined(__APPLE__)
static span<char> get_exe_path(span<char> buffer)
{
- uint32_t real_len;
+ uint32_t real_len = buffer.size();
if (_NSGetExecutablePath(buffer.data(), &real_len) < 0)
return {};
- if (real_len >= buffer.size())
- return {};
-
- buffer[real_len] = 0;
+ real_len = strlen(buffer.data());
return buffer.subspan(0, real_len);
}
#endif
Hello, @puremourning this looks also wrong fix for me, we need detect size and allocate buffer in this case. As I see, previously code was:
#if defined(__APPLE__)
// On Mac, we ask the OS for the absolute path to the entrypoint executable
uint32_t lenActualPath = 0;
if (_NSGetExecutablePath(nullptr, &lenActualPath) == -1)
{
// OSX has placed the actual path length in lenActualPath,
// so re-attempt the operation
std::string resizedPath(lenActualPath, '\0');
char *pResizedPath = const_cast<char *>(resizedPath.data());
if (_NSGetExecutablePath(pResizedPath, &lenActualPath) == 0)
{
return pResizedPath;
}
}
return std::string();
#else
this looks like proper logic for me. IMO, we need revert this changes.
Agree 100%
As apple documentation (https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/dyld.3.html) says: "The bufsize parameter should initially be the size of the buffer". So the real source of the problem, is that real_len
isn't assigned initially. I think, @puremourning patch is right.
I also see in apple documentation: "With deep directories the total bufsize needed could be more than MAXPATHLEN.". In case of changes proposed by @puremourning we will fail in this case.
Agree with @viewizard - My patch is broken in the case where the returned path > MAXPATHLEN and the code pasted above is not.
@puremourning this issue should be fixed in upstream now. Could you please check it on macOS?
I just updated to netcoredbg
1.2.0-782 and get the following:
2021-04-15 17:06:39,835 - DEBUG - Message received: {'seq': 5, 'body': {'supportsExceptionOptions': False}, 'command': 'setExceptionBreakpoints', 'request_seq': 2, 'success': True, 'type': 'response'}
2021-04-15 17:06:39,835 - DEBUG - Sending Message: {"command": "configurationDone", "seq": 4, "type": "request"}
2021-04-15 17:06:39,835 - DEBUG - Message received: {'seq': 6, 'body': {}, 'command': 'launch', 'request_seq': 3, 'success': True, 'type': 'response'}
2021-04-15 17:06:39,849 - DEBUG - Message received: {'seq': 7, 'command': 'configurationDone', 'message': "Failed command 'configurationDone' : 0x80070002", 'request_seq': 4, 'success': False, 'type': 'response'}
2021-04-15 17:06:39,849 - ERROR - Request failed: Failed command 'configurationDone' : 0x80070002
Log:
4978.084 I/NETCOREDBG(P1678, T4294967295): main.cpp: main(346) > Netcoredbg started
4978.085 I/NETCOREDBG(P1678, T4294967295): main.cpp: instantiate_protocol(110) > Creating protocol VSCodeProtocol
4978.085 I/NETCOREDBG(P1678, T4294967295): main.cpp: main(383) > pidDebugee 0
4978.085 I/NETCOREDBG(P1678, T4294967295): ioredirect.cpp: worker(163) > worker started
4978.086 I/NETCOREDBG(P1678, T4294967295): vscodeprotocol.cpp: operator(495) > exception '[json.exception.out_of_range.403] key 'env' not found'
4978.100 E/NETCOREDBG(P1678, T4294967295): manageddebugger.cpp: operator(1228) > g_dbgshim.CreateProcessForLaunch(reinterpret_cast<LPWSTR>(const_cast<WCHAR*>(to_utf16(ss.str()).c_str())), TRUE, outEnv.empty() ? NULL : &outEnv[0], m_cwd.empty() ? NULL : reinterpret_cast<LPCWSTR>(to_utf16(m_cwd).c_str()), &m_processId, &resumeHandle) : 0x80070002
4978.101 E/NETCOREDBG(P1678, T4294967295): ioredirect.cpp: worker(325) > child process stdout/stderr reading error
4978.101 I/NETCOREDBG(P1678, T4294967295): ioredirect.cpp: operator(153) > IORedirectHelper::worker: terminated
g_dbgshim.CreateProcessForLaunch
return 0x80070002 ( IDS_EE_FILE_NOT_FOUND)
Is the any chance you could check m_cwd
right before g_dbgshim.CreateProcessForLaunch()
call? I believe its empty, cleared by this code:
if (!m_cwd.empty())
if (!IsDirExists(m_cwd.c_str()) || !SetWorkDir(m_cwd))
m_cwd.clear();
since SetWorkDir()
return false on macOS.
Err, you know what, this could be 100% me being a complete fool...
(let me just quickly make sure I actually built the app before trying to debug it :/)
Success!
I had the wrong framework version on this Mac it turned out. Fixed, and now working! Thanks!
Nice =)
But I also found issue in SetWorkDir
, that should be fixed now (limited path to MAX_PATH size).
Fixed in upstream.
Hi, after upgrading the version of netcoredbg in Vimspector to 1.2.0-767, netcoredbg exits after the initialize exchange. this does not happen with the previous version (netcoredbg 1.2.0-635).
Here is the log including the full message trace:
As you can see, the netcoredbg ("server") exits with status -1 immediately after sending the response to the
launch
request.With the previous version, this is the (working) log:
After enabling logging in
netcoredbg
(with--log
) I would that it's throwing an exception and exiting.It seems that the
env
key is now mandatory. this happened before with thecwd
key. Can we make it not mandatory?