Skip to content

Commit 6c708df

Browse files
authored
Merge branch 'release/8.0' into darc-release/8.0-46c191cd-d8f3-49a2-a3c2-5cbeaa832c8a
2 parents c4afd6e + e6c1b03 commit 6c708df

File tree

7 files changed

+279
-25
lines changed

7 files changed

+279
-25
lines changed

NuGet.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
1111
<!-- Begin: Package sources from dotnet-emsdk -->
1212
<add key="darc-pub-dotnet-emsdk-222749b" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-222749b4/nuget/v3/index.json" />
13+
<add key="darc-pub-dotnet-emsdk-6fd14a4" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-6fd14a46/nuget/v3/index.json" />
14+
<add key="darc-pub-dotnet-emsdk-6fd14a4-2" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-6fd14a46-2/nuget/v3/index.json" />
15+
<add key="darc-pub-dotnet-emsdk-6fd14a4-1" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-6fd14a46-1/nuget/v3/index.json" />
1316
<!-- End: Package sources from dotnet-emsdk -->
1417
<!-- Begin: Package sources from dotnet-sdk -->
1518
<!-- End: Package sources from dotnet-sdk -->

eng/Version.Details.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,9 +354,9 @@
354354
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
355355
<Sha>67613417f5e1af250e6ddfba79f8f2885d8e90fb</Sha>
356356
</Dependency>
357-
<Dependency Name="Microsoft.DotNet.HotReload.Utils.Generator.BuildTool" Version="8.0.0-alpha.0.25330.2">
357+
<Dependency Name="Microsoft.DotNet.HotReload.Utils.Generator.BuildTool" Version="8.0.0-alpha.0.25378.2">
358358
<Uri>https://github.com/dotnet/hotreload-utils</Uri>
359-
<Sha>733b3be8cce2b6eb42a151bf95fbb05500fa40ee</Sha>
359+
<Sha>0dcc0d22fc7b9c4eb8c7ae571ae4213324b006a6</Sha>
360360
</Dependency>
361361
<Dependency Name="System.Runtime.Numerics.TestData" Version="8.0.0-beta.25311.1">
362362
<Uri>https://github.com/dotnet/runtime-assets</Uri>

eng/Versions.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<Project>
22
<PropertyGroup>
33
<!-- The .NET product branding version -->
4-
<ProductVersion>8.0.19</ProductVersion>
4+
<ProductVersion>8.0.20</ProductVersion>
55
<!-- File version numbers -->
66
<MajorVersion>8</MajorVersion>
77
<MinorVersion>0</MinorVersion>
8-
<PatchVersion>19</PatchVersion>
8+
<PatchVersion>20</PatchVersion>
99
<SdkBandVersion>8.0.100</SdkBandVersion>
1010
<PackageVersionNet7>7.0.20</PackageVersionNet7>
1111
<PackageVersionNet6>6.0.36</PackageVersionNet6>
@@ -198,7 +198,7 @@
198198
<MicrosoftDotNetXHarnessTestRunnersCommonVersion>8.0.0-prerelease.25270.1</MicrosoftDotNetXHarnessTestRunnersCommonVersion>
199199
<MicrosoftDotNetXHarnessTestRunnersXunitVersion>8.0.0-prerelease.25270.1</MicrosoftDotNetXHarnessTestRunnersXunitVersion>
200200
<MicrosoftDotNetXHarnessCLIVersion>8.0.0-prerelease.25270.1</MicrosoftDotNetXHarnessCLIVersion>
201-
<MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>8.0.0-alpha.0.25330.2</MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>
201+
<MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>8.0.0-alpha.0.25378.2</MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>
202202
<XUnitVersion>2.4.2</XUnitVersion>
203203
<XUnitAnalyzersVersion>1.0.0</XUnitAnalyzersVersion>
204204
<XUnitRunnerVisualStudioVersion>2.4.5</XUnitRunnerVisualStudioVersion>

src/coreclr/gc/gc.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41060,10 +41060,13 @@ BOOL gc_heap::card_transition (uint8_t* po, uint8_t* end, size_t card_word_end,
4106041060
//dprintf(3,(" Clearing cards [%zx, %zx[ ",
4106141061
dprintf(3,(" CC [%zx, %zx[ ",
4106241062
(size_t)card_address(card), (size_t)po));
41063-
clear_cards (card, card_of(po));
41064-
n_card_set -= (card_of (po) - card);
41065-
n_cards_cleared += (card_of (po) - card);
41066-
41063+
uint8_t* card_clearing_limit = po;
41064+
#ifdef FEATURE_CARD_MARKING_STEALING
41065+
card_clearing_limit = min (limit, po);
41066+
#endif // FEATURE_CARD_MARKING_STEALING
41067+
clear_cards (card, card_of (card_clearing_limit));
41068+
n_card_set -= (card_of (card_clearing_limit) - card);
41069+
n_cards_cleared += (card_of (card_clearing_limit) - card);
4106741070
}
4106841071
n_eph +=cg_pointers_found;
4106941072
cg_pointers_found = 0;

src/coreclr/pal/src/thread/process.cpp

Lines changed: 252 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ extern "C"
103103
} \
104104
} while (false)
105105

106+
// On macOS 26, sem_open fails if debugger and debugee are signed with different team ids.
107+
// Use fifos instead of semaphores to avoid this issue, https://github.com/dotnet/runtime/issues/116545
108+
#define ENABLE_RUNTIME_EVENTS_OVER_PIPES
106109
#endif // __APPLE__
107110

108111
#ifdef __NetBSD__
@@ -1430,21 +1433,217 @@ static uint64_t HashSemaphoreName(uint64_t a, uint64_t b)
14301433
static const char *const TwoWayNamedPipePrefix = "clr-debug-pipe";
14311434
static const char* IpcNameFormat = "%s-%d-%llu-%s";
14321435

1433-
/*++
1434-
PAL_NotifyRuntimeStarted
1436+
#ifdef ENABLE_RUNTIME_EVENTS_OVER_PIPES
1437+
static const char* RuntimeStartupPipeName = "st";
1438+
static const char* RuntimeContinuePipeName = "co";
14351439

1436-
Signals the debugger waiting for runtime startup notification to continue and
1437-
waits until the debugger signals us to continue.
1440+
#define PIPE_OPEN_RETRY_DELAY_NS 500000000 // 500 ms
14381441

1439-
Parameters:
1440-
None
1442+
typedef enum
1443+
{
1444+
RuntimeEventsOverPipes_Disabled = 0,
1445+
RuntimeEventsOverPipes_Succeeded = 1,
1446+
RuntimeEventsOverPipes_Failed = 2,
1447+
} RuntimeEventsOverPipes;
14411448

1442-
Return value:
1443-
TRUE - successfully launched by debugger, FALSE - not launched or some failure in the handshake
1444-
--*/
1449+
typedef enum
1450+
{
1451+
RuntimeEvent_Unknown = 0,
1452+
RuntimeEvent_Started = 1,
1453+
RuntimeEvent_Continue = 2,
1454+
} RuntimeEvent;
1455+
1456+
static
1457+
int
1458+
OpenPipe(const char* name, int mode)
1459+
{
1460+
int fd = -1;
1461+
int flags = mode | O_NONBLOCK;
1462+
1463+
#if defined(FD_CLOEXEC)
1464+
flags |= O_CLOEXEC;
1465+
#endif
1466+
1467+
while (fd == -1)
1468+
{
1469+
fd = open(name, flags);
1470+
if (fd == -1)
1471+
{
1472+
if (mode == O_WRONLY && errno == ENXIO)
1473+
{
1474+
PAL_nanosleep(PIPE_OPEN_RETRY_DELAY_NS);
1475+
continue;
1476+
}
1477+
else if (errno == EINTR)
1478+
{
1479+
continue;
1480+
}
1481+
else
1482+
{
1483+
break;
1484+
}
1485+
}
1486+
}
1487+
1488+
if (fd != -1)
1489+
{
1490+
flags = fcntl(fd, F_GETFL);
1491+
if (flags != -1)
1492+
{
1493+
flags &= ~O_NONBLOCK;
1494+
if (fcntl(fd, F_SETFL, flags) == -1)
1495+
{
1496+
close(fd);
1497+
fd = -1;
1498+
}
1499+
}
1500+
else
1501+
{
1502+
close(fd);
1503+
fd = -1;
1504+
}
1505+
}
1506+
1507+
return fd;
1508+
}
1509+
1510+
static
1511+
void
1512+
ClosePipe(int fd)
1513+
{
1514+
if (fd != -1)
1515+
{
1516+
while (close(fd) < 0 && errno == EINTR);
1517+
}
1518+
}
1519+
1520+
static
1521+
RuntimeEventsOverPipes
1522+
NotifyRuntimeUsingPipes()
1523+
{
1524+
RuntimeEventsOverPipes result = RuntimeEventsOverPipes_Disabled;
1525+
char startupPipeName[MAX_DEBUGGER_TRANSPORT_PIPE_NAME_LENGTH];
1526+
char continuePipeName[MAX_DEBUGGER_TRANSPORT_PIPE_NAME_LENGTH];
1527+
int startupPipeFd = -1;
1528+
int continuePipeFd = -1;
1529+
size_t offset = 0;
1530+
1531+
LPCSTR applicationGroupId = PAL_GetApplicationGroupId();
1532+
1533+
PAL_GetTransportPipeName(continuePipeName, gPID, applicationGroupId, RuntimeContinuePipeName);
1534+
TRACE("NotifyRuntimeUsingPipes: opening continue '%s' pipe\n", continuePipeName);
1535+
1536+
continuePipeFd = OpenPipe(continuePipeName, O_RDONLY);
1537+
if (continuePipeFd == -1)
1538+
{
1539+
if (errno == ENOENT || errno == EACCES)
1540+
{
1541+
TRACE("NotifyRuntimeUsingPipes: pipe %s not found/accessible, runtime events over pipes disabled\n", continuePipeName);
1542+
}
1543+
else
1544+
{
1545+
TRACE("NotifyRuntimeUsingPipes: open(%s) failed: %d (%s)\n", continuePipeName, errno, strerror(errno));
1546+
result = RuntimeEventsOverPipes_Failed;
1547+
}
1548+
1549+
goto exit;
1550+
}
1551+
1552+
PAL_GetTransportPipeName(startupPipeName, gPID, applicationGroupId, RuntimeStartupPipeName);
1553+
TRACE("NotifyRuntimeUsingPipes: opening startup '%s' pipe\n", startupPipeName);
1554+
1555+
startupPipeFd = OpenPipe(startupPipeName, O_WRONLY);
1556+
if (startupPipeFd == -1)
1557+
{
1558+
if (errno == ENOENT || errno == EACCES)
1559+
{
1560+
TRACE("NotifyRuntimeUsingPipes: pipe %s not found/accessible, runtime events over pipes disabled\n", startupPipeName);
1561+
}
1562+
else
1563+
{
1564+
TRACE("NotifyRuntimeUsingPipes: open(%s) failed: %d (%s)\n", startupPipeName, errno, strerror(errno));
1565+
result = RuntimeEventsOverPipes_Failed;
1566+
}
1567+
1568+
goto exit;
1569+
}
1570+
1571+
TRACE("NotifyRuntimeUsingPipes: sending started event\n");
1572+
1573+
{
1574+
unsigned char event = (unsigned char)RuntimeEvent_Started;
1575+
unsigned char *buffer = &event;
1576+
int bytesToWrite = sizeof(event);
1577+
int bytesWritten = 0;
1578+
1579+
do
1580+
{
1581+
bytesWritten = write(startupPipeFd, buffer + offset, bytesToWrite - offset);
1582+
if (bytesWritten > 0)
1583+
{
1584+
offset += bytesWritten;
1585+
}
1586+
}
1587+
while ((bytesWritten > 0 && offset < bytesToWrite) || (bytesWritten == -1 && errno == EINTR));
1588+
1589+
if (offset != bytesToWrite)
1590+
{
1591+
TRACE("NotifyRuntimeUsingPipes: write(%s) failed: %d (%s)\n", startupPipeName, errno, strerror(errno));
1592+
goto exit;
1593+
}
1594+
}
1595+
1596+
TRACE("NotifyRuntimeUsingPipes: waiting on continue event\n");
1597+
1598+
{
1599+
unsigned char event = (unsigned char)RuntimeEvent_Unknown;
1600+
unsigned char *buffer = &event;
1601+
int bytesToRead = sizeof(event);
1602+
int bytesRead = 0;
1603+
1604+
offset = 0;
1605+
do
1606+
{
1607+
bytesRead = read(continuePipeFd, buffer + offset, bytesToRead - offset);
1608+
if (bytesRead > 0)
1609+
{
1610+
offset += bytesRead;
1611+
}
1612+
}
1613+
while ((bytesRead > 0 && offset < bytesToRead) || (bytesRead == -1 && errno == EINTR));
1614+
1615+
if (offset == bytesToRead && event == (unsigned char)RuntimeEvent_Continue)
1616+
{
1617+
TRACE("NotifyRuntimeUsingPipes: received continue event\n");
1618+
}
1619+
else
1620+
{
1621+
TRACE("NotifyRuntimeUsingPipes: received invalid event\n");
1622+
goto exit;
1623+
}
1624+
}
1625+
1626+
result = RuntimeEventsOverPipes_Succeeded;
1627+
1628+
exit:
1629+
1630+
if (startupPipeFd != -1)
1631+
{
1632+
ClosePipe(startupPipeFd);
1633+
}
1634+
1635+
if (continuePipeFd != -1)
1636+
{
1637+
ClosePipe(continuePipeFd);
1638+
}
1639+
1640+
return result;
1641+
}
1642+
#endif // ENABLE_RUNTIME_EVENTS_OVER_PIPES
1643+
1644+
static
14451645
BOOL
1446-
PALAPI
1447-
PAL_NotifyRuntimeStarted()
1646+
NotifyRuntimeUsingSemaphores()
14481647
{
14491648
char startupSemName[CLR_SEM_MAX_NAMELEN];
14501649
char continueSemName[CLR_SEM_MAX_NAMELEN];
@@ -1465,13 +1664,13 @@ PAL_NotifyRuntimeStarted()
14651664
CreateSemaphoreName(startupSemName, RuntimeStartupSemaphoreName, unambiguousProcessDescriptor, applicationGroupId);
14661665
CreateSemaphoreName(continueSemName, RuntimeContinueSemaphoreName, unambiguousProcessDescriptor, applicationGroupId);
14671666

1468-
TRACE("PAL_NotifyRuntimeStarted opening continue '%s' startup '%s'\n", continueSemName, startupSemName);
1667+
TRACE("NotifyRuntimeUsingSemaphores: opening continue '%s' startup '%s'\n", continueSemName, startupSemName);
14691668

14701669
// Open the debugger startup semaphore. If it doesn't exists, then we do nothing and return
14711670
startupSem = sem_open(startupSemName, 0);
14721671
if (startupSem == SEM_FAILED)
14731672
{
1474-
TRACE("sem_open(%s) failed: %d (%s)\n", startupSemName, errno, strerror(errno));
1673+
TRACE("NotifyRuntimeUsingSemaphores: sem_open(%s) failed: %d (%s)\n", startupSemName, errno, strerror(errno));
14751674
goto exit;
14761675
}
14771676

@@ -1494,7 +1693,7 @@ PAL_NotifyRuntimeStarted()
14941693
{
14951694
if (EINTR == errno)
14961695
{
1497-
TRACE("sem_wait() failed with EINTR; re-waiting");
1696+
TRACE("NotifyRuntimeUsingSemaphores: sem_wait() failed with EINTR; re-waiting");
14981697
continue;
14991698
}
15001699
ASSERT("sem_wait(continueSem) failed: errno is %d (%s)\n", errno, strerror(errno));
@@ -1516,6 +1715,45 @@ PAL_NotifyRuntimeStarted()
15161715
return launched;
15171716
}
15181717

1718+
/*++
1719+
PAL_NotifyRuntimeStarted
1720+
1721+
Signals the debugger waiting for runtime startup notification to continue and
1722+
waits until the debugger signals us to continue.
1723+
1724+
Parameters:
1725+
None
1726+
1727+
Return value:
1728+
TRUE - successfully launched by debugger, FALSE - not launched or some failure in the handshake
1729+
--*/
1730+
BOOL
1731+
PALAPI
1732+
PAL_NotifyRuntimeStarted()
1733+
{
1734+
#ifdef ENABLE_RUNTIME_EVENTS_OVER_PIPES
1735+
// Test pipes as runtime event transport.
1736+
RuntimeEventsOverPipes result = NotifyRuntimeUsingPipes();
1737+
switch (result)
1738+
{
1739+
case RuntimeEventsOverPipes_Disabled:
1740+
TRACE("PAL_NotifyRuntimeStarted: pipe handshake disabled, try semaphores\n");
1741+
return NotifyRuntimeUsingSemaphores();
1742+
case RuntimeEventsOverPipes_Failed:
1743+
TRACE("PAL_NotifyRuntimeStarted: pipe handshake failed\n");
1744+
return FALSE;
1745+
case RuntimeEventsOverPipes_Succeeded:
1746+
TRACE("PAL_NotifyRuntimeStarted: pipe handshake succeeded\n");
1747+
return TRUE;
1748+
default:
1749+
// Unexpected result.
1750+
return FALSE;
1751+
}
1752+
#else
1753+
return NotifyRuntimeUsingSemaphores();
1754+
#endif // ENABLE_RUNTIME_EVENTS_OVER_PIPES
1755+
}
1756+
15191757
LPCSTR
15201758
PALAPI
15211759
PAL_GetApplicationGroupId()

src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/CollectionMarshallingFails.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ public static partial void NegateBoolsRef2D_ClearMarshalling(
107107
public class CollectionMarshallingFails
108108
{
109109
[Fact]
110-
public void UTFStringConversionFailures()
110+
[SkipOnCI("Allocates enough memory that the OOM killer can kill the process on our Helix machines.")]
111+
public void BigUTFStringConversionFailures()
111112
{
112113
bool threw = false;
113114
try

0 commit comments

Comments
 (0)