-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
netcoredbg exits on macOS after upgrading to netcoredbg 1.2.0-767 #57
Comments
Hmm it seems that adding the
This, while handling the Raw messages which trigger this:
|
OK well the problem is that Form the help:
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:
Also, while this function can return 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:
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 |
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
Log:
|
since |
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 :/) |
Nice =) |
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?The text was updated successfully, but these errors were encountered: