-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[release/8.0] Merge release/8.0-staging changes #118763
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0ea8b5e
[release/8.0-staging] [Test Only] Disable the UTFStringConversionFail…
github-actions[bot] 2afbeb1
Merge pull request #117672 from dotnet/merge/release/8.0-to-release/8…
tarekgh c11dbaf
[release/8.0-staging] [Test Only] Fix BuildChainCustomTrustStore test
github-actions[bot] 435981f
Update dependencies from https://github.com/dotnet/hotreload-utils bu…
dotnet-maestro[bot] 28a27a4
fixing a bug in card mark stealing (#118009)
github-actions[bot] 4e270e8
[release/8.0-staging] Fix broken debugger/debuggee startup handshake …
github-actions[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -103,6 +103,9 @@ extern "C" | |||||||||||||||||||||||||||
} \ | ||||||||||||||||||||||||||||
} while (false) | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
// On macOS 26, sem_open fails if debugger and debugee are signed with different team ids. | ||||||||||||||||||||||||||||
// Use fifos instead of semaphores to avoid this issue, https://github.com/dotnet/runtime/issues/116545 | ||||||||||||||||||||||||||||
#define ENABLE_RUNTIME_EVENTS_OVER_PIPES | ||||||||||||||||||||||||||||
#endif // __APPLE__ | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
#ifdef __NetBSD__ | ||||||||||||||||||||||||||||
|
@@ -1430,21 +1433,217 @@ static uint64_t HashSemaphoreName(uint64_t a, uint64_t b) | |||||||||||||||||||||||||||
static const char *const TwoWayNamedPipePrefix = "clr-debug-pipe"; | ||||||||||||||||||||||||||||
static const char* IpcNameFormat = "%s-%d-%llu-%s"; | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
/*++ | ||||||||||||||||||||||||||||
PAL_NotifyRuntimeStarted | ||||||||||||||||||||||||||||
#ifdef ENABLE_RUNTIME_EVENTS_OVER_PIPES | ||||||||||||||||||||||||||||
static const char* RuntimeStartupPipeName = "st"; | ||||||||||||||||||||||||||||
static const char* RuntimeContinuePipeName = "co"; | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
Signals the debugger waiting for runtime startup notification to continue and | ||||||||||||||||||||||||||||
waits until the debugger signals us to continue. | ||||||||||||||||||||||||||||
#define PIPE_OPEN_RETRY_DELAY_NS 500000000 // 500 ms | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
Parameters: | ||||||||||||||||||||||||||||
None | ||||||||||||||||||||||||||||
typedef enum | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
RuntimeEventsOverPipes_Disabled = 0, | ||||||||||||||||||||||||||||
RuntimeEventsOverPipes_Succeeded = 1, | ||||||||||||||||||||||||||||
RuntimeEventsOverPipes_Failed = 2, | ||||||||||||||||||||||||||||
} RuntimeEventsOverPipes; | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
Return value: | ||||||||||||||||||||||||||||
TRUE - successfully launched by debugger, FALSE - not launched or some failure in the handshake | ||||||||||||||||||||||||||||
--*/ | ||||||||||||||||||||||||||||
typedef enum | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
RuntimeEvent_Unknown = 0, | ||||||||||||||||||||||||||||
RuntimeEvent_Started = 1, | ||||||||||||||||||||||||||||
RuntimeEvent_Continue = 2, | ||||||||||||||||||||||||||||
} RuntimeEvent; | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
static | ||||||||||||||||||||||||||||
int | ||||||||||||||||||||||||||||
OpenPipe(const char* name, int mode) | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
int fd = -1; | ||||||||||||||||||||||||||||
int flags = mode | O_NONBLOCK; | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
#if defined(FD_CLOEXEC) | ||||||||||||||||||||||||||||
flags |= O_CLOEXEC; | ||||||||||||||||||||||||||||
#endif | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
while (fd == -1) | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
fd = open(name, flags); | ||||||||||||||||||||||||||||
if (fd == -1) | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
if (mode == O_WRONLY && errno == ENXIO) | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
PAL_nanosleep(PIPE_OPEN_RETRY_DELAY_NS); | ||||||||||||||||||||||||||||
continue; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
else if (errno == EINTR) | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
continue; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
else | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
break; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
if (fd != -1) | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
flags = fcntl(fd, F_GETFL); | ||||||||||||||||||||||||||||
if (flags != -1) | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
flags &= ~O_NONBLOCK; | ||||||||||||||||||||||||||||
if (fcntl(fd, F_SETFL, flags) == -1) | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
close(fd); | ||||||||||||||||||||||||||||
fd = -1; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
else | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
close(fd); | ||||||||||||||||||||||||||||
fd = -1; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
return fd; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
static | ||||||||||||||||||||||||||||
void | ||||||||||||||||||||||||||||
ClosePipe(int fd) | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
if (fd != -1) | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
while (close(fd) < 0 && errno == EINTR); | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
static | ||||||||||||||||||||||||||||
RuntimeEventsOverPipes | ||||||||||||||||||||||||||||
NotifyRuntimeUsingPipes() | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
RuntimeEventsOverPipes result = RuntimeEventsOverPipes_Disabled; | ||||||||||||||||||||||||||||
char startupPipeName[MAX_DEBUGGER_TRANSPORT_PIPE_NAME_LENGTH]; | ||||||||||||||||||||||||||||
char continuePipeName[MAX_DEBUGGER_TRANSPORT_PIPE_NAME_LENGTH]; | ||||||||||||||||||||||||||||
int startupPipeFd = -1; | ||||||||||||||||||||||||||||
int continuePipeFd = -1; | ||||||||||||||||||||||||||||
size_t offset = 0; | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
LPCSTR applicationGroupId = PAL_GetApplicationGroupId(); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
PAL_GetTransportPipeName(continuePipeName, gPID, applicationGroupId, RuntimeContinuePipeName); | ||||||||||||||||||||||||||||
TRACE("NotifyRuntimeUsingPipes: opening continue '%s' pipe\n", continuePipeName); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
continuePipeFd = OpenPipe(continuePipeName, O_RDONLY); | ||||||||||||||||||||||||||||
if (continuePipeFd == -1) | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
if (errno == ENOENT || errno == EACCES) | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
TRACE("NotifyRuntimeUsingPipes: pipe %s not found/accessible, runtime events over pipes disabled\n", continuePipeName); | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
else | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
TRACE("NotifyRuntimeUsingPipes: open(%s) failed: %d (%s)\n", continuePipeName, errno, strerror(errno)); | ||||||||||||||||||||||||||||
result = RuntimeEventsOverPipes_Failed; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
goto exit; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
PAL_GetTransportPipeName(startupPipeName, gPID, applicationGroupId, RuntimeStartupPipeName); | ||||||||||||||||||||||||||||
TRACE("NotifyRuntimeUsingPipes: opening startup '%s' pipe\n", startupPipeName); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
startupPipeFd = OpenPipe(startupPipeName, O_WRONLY); | ||||||||||||||||||||||||||||
if (startupPipeFd == -1) | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
if (errno == ENOENT || errno == EACCES) | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
TRACE("NotifyRuntimeUsingPipes: pipe %s not found/accessible, runtime events over pipes disabled\n", startupPipeName); | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
else | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
TRACE("NotifyRuntimeUsingPipes: open(%s) failed: %d (%s)\n", startupPipeName, errno, strerror(errno)); | ||||||||||||||||||||||||||||
result = RuntimeEventsOverPipes_Failed; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
goto exit; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
TRACE("NotifyRuntimeUsingPipes: sending started event\n"); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
unsigned char event = (unsigned char)RuntimeEvent_Started; | ||||||||||||||||||||||||||||
unsigned char *buffer = &event; | ||||||||||||||||||||||||||||
int bytesToWrite = sizeof(event); | ||||||||||||||||||||||||||||
int bytesWritten = 0; | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
do | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
bytesWritten = write(startupPipeFd, buffer + offset, bytesToWrite - offset); | ||||||||||||||||||||||||||||
if (bytesWritten > 0) | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
offset += bytesWritten; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
while ((bytesWritten > 0 && offset < bytesToWrite) || (bytesWritten == -1 && errno == EINTR)); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
if (offset != bytesToWrite) | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
TRACE("NotifyRuntimeUsingPipes: write(%s) failed: %d (%s)\n", startupPipeName, errno, strerror(errno)); | ||||||||||||||||||||||||||||
goto exit; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
TRACE("NotifyRuntimeUsingPipes: waiting on continue event\n"); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
unsigned char event = (unsigned char)RuntimeEvent_Unknown; | ||||||||||||||||||||||||||||
unsigned char *buffer = &event; | ||||||||||||||||||||||||||||
int bytesToRead = sizeof(event); | ||||||||||||||||||||||||||||
int bytesRead = 0; | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
offset = 0; | ||||||||||||||||||||||||||||
do | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
bytesRead = read(continuePipeFd, buffer + offset, bytesToRead - offset); | ||||||||||||||||||||||||||||
if (bytesRead > 0) | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
offset += bytesRead; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
while ((bytesRead > 0 && offset < bytesToRead) || (bytesRead == -1 && errno == EINTR)); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
if (offset == bytesToRead && event == (unsigned char)RuntimeEvent_Continue) | ||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The variable
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
TRACE("NotifyRuntimeUsingPipes: received continue event\n"); | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
else | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
TRACE("NotifyRuntimeUsingPipes: received invalid event\n"); | ||||||||||||||||||||||||||||
goto exit; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
result = RuntimeEventsOverPipes_Succeeded; | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
exit: | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
if (startupPipeFd != -1) | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
ClosePipe(startupPipeFd); | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
if (continuePipeFd != -1) | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
ClosePipe(continuePipeFd); | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
return result; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
#endif // ENABLE_RUNTIME_EVENTS_OVER_PIPES | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
static | ||||||||||||||||||||||||||||
BOOL | ||||||||||||||||||||||||||||
PALAPI | ||||||||||||||||||||||||||||
PAL_NotifyRuntimeStarted() | ||||||||||||||||||||||||||||
NotifyRuntimeUsingSemaphores() | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
char startupSemName[CLR_SEM_MAX_NAMELEN]; | ||||||||||||||||||||||||||||
char continueSemName[CLR_SEM_MAX_NAMELEN]; | ||||||||||||||||||||||||||||
|
@@ -1465,13 +1664,13 @@ PAL_NotifyRuntimeStarted() | |||||||||||||||||||||||||||
CreateSemaphoreName(startupSemName, RuntimeStartupSemaphoreName, unambiguousProcessDescriptor, applicationGroupId); | ||||||||||||||||||||||||||||
CreateSemaphoreName(continueSemName, RuntimeContinueSemaphoreName, unambiguousProcessDescriptor, applicationGroupId); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
TRACE("PAL_NotifyRuntimeStarted opening continue '%s' startup '%s'\n", continueSemName, startupSemName); | ||||||||||||||||||||||||||||
TRACE("NotifyRuntimeUsingSemaphores: opening continue '%s' startup '%s'\n", continueSemName, startupSemName); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
// Open the debugger startup semaphore. If it doesn't exists, then we do nothing and return | ||||||||||||||||||||||||||||
startupSem = sem_open(startupSemName, 0); | ||||||||||||||||||||||||||||
if (startupSem == SEM_FAILED) | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
TRACE("sem_open(%s) failed: %d (%s)\n", startupSemName, errno, strerror(errno)); | ||||||||||||||||||||||||||||
TRACE("NotifyRuntimeUsingSemaphores: sem_open(%s) failed: %d (%s)\n", startupSemName, errno, strerror(errno)); | ||||||||||||||||||||||||||||
goto exit; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
|
@@ -1494,7 +1693,7 @@ PAL_NotifyRuntimeStarted() | |||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
if (EINTR == errno) | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
TRACE("sem_wait() failed with EINTR; re-waiting"); | ||||||||||||||||||||||||||||
TRACE("NotifyRuntimeUsingSemaphores: sem_wait() failed with EINTR; re-waiting"); | ||||||||||||||||||||||||||||
continue; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
ASSERT("sem_wait(continueSem) failed: errno is %d (%s)\n", errno, strerror(errno)); | ||||||||||||||||||||||||||||
|
@@ -1516,6 +1715,45 @@ PAL_NotifyRuntimeStarted() | |||||||||||||||||||||||||||
return launched; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
/*++ | ||||||||||||||||||||||||||||
PAL_NotifyRuntimeStarted | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
Signals the debugger waiting for runtime startup notification to continue and | ||||||||||||||||||||||||||||
waits until the debugger signals us to continue. | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
Parameters: | ||||||||||||||||||||||||||||
None | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
Return value: | ||||||||||||||||||||||||||||
TRUE - successfully launched by debugger, FALSE - not launched or some failure in the handshake | ||||||||||||||||||||||||||||
--*/ | ||||||||||||||||||||||||||||
BOOL | ||||||||||||||||||||||||||||
PALAPI | ||||||||||||||||||||||||||||
PAL_NotifyRuntimeStarted() | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
#ifdef ENABLE_RUNTIME_EVENTS_OVER_PIPES | ||||||||||||||||||||||||||||
// Test pipes as runtime event transport. | ||||||||||||||||||||||||||||
RuntimeEventsOverPipes result = NotifyRuntimeUsingPipes(); | ||||||||||||||||||||||||||||
switch (result) | ||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||
case RuntimeEventsOverPipes_Disabled: | ||||||||||||||||||||||||||||
TRACE("PAL_NotifyRuntimeStarted: pipe handshake disabled, try semaphores\n"); | ||||||||||||||||||||||||||||
return NotifyRuntimeUsingSemaphores(); | ||||||||||||||||||||||||||||
case RuntimeEventsOverPipes_Failed: | ||||||||||||||||||||||||||||
TRACE("PAL_NotifyRuntimeStarted: pipe handshake failed\n"); | ||||||||||||||||||||||||||||
return FALSE; | ||||||||||||||||||||||||||||
case RuntimeEventsOverPipes_Succeeded: | ||||||||||||||||||||||||||||
TRACE("PAL_NotifyRuntimeStarted: pipe handshake succeeded\n"); | ||||||||||||||||||||||||||||
return TRUE; | ||||||||||||||||||||||||||||
default: | ||||||||||||||||||||||||||||
// Unexpected result. | ||||||||||||||||||||||||||||
return FALSE; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
#else | ||||||||||||||||||||||||||||
return NotifyRuntimeUsingSemaphores(); | ||||||||||||||||||||||||||||
#endif // ENABLE_RUNTIME_EVENTS_OVER_PIPES | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
LPCSTR | ||||||||||||||||||||||||||||
PALAPI | ||||||||||||||||||||||||||||
PAL_GetApplicationGroupId() | ||||||||||||||||||||||||||||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
offset
variable is declared at function scope but used within a local block scope. This could lead to incorrect behavior asoffset
is initialized to 0 at the top of the function but then reused for a different purpose in the read operation later.Copilot uses AI. Check for mistakes.