Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
67b110e
[release/6.0] Fixing a possible null reference error in WebSocket def…
github-actions[bot] Dec 23, 2021
3b71fd8
[release/6.0] Don't create multiple large files at the same time (#63…
jozkee Dec 31, 2021
816653e
[release/6.0] Use Ubuntu 18.04 and dotnet-buildtools-prereq docker im…
github-actions[bot] Jan 3, 2022
2282b00
[release/6.0] Add runtime-community.yml pipeline and add s390x job (#…
directhex Jan 3, 2022
6f1e03f
[release/6.0] Do not promote struct locals with holes (#62738)
github-actions[bot] Jan 3, 2022
7d82ac7
[wasm][release/6.0] Reduce number of calls to setTimer (#62705)
maraf Jan 3, 2022
bdd6647
fix issue where HTTP2 connection could be scavenged but not disposed …
github-actions[bot] Jan 3, 2022
45d1f9e
Update dependencies from https://github.com/dotnet/arcade build 20211…
dotnet-maestro[bot] Jan 3, 2022
f86caa5
[release/6.0] Fix build with Clang 13 (#63314)
janvorli Jan 4, 2022
51b6749
[release/6.0] bump sourcebuild leg timeout (#63298)
safern Jan 5, 2022
dc6a86d
Fix bug where we reference the entry #0 in the pinned plug queue (#60…
cshung Jan 6, 2022
4f01ff5
Fix named mutexes on OSX to work between arm64 and emulated x64 proce…
kouvel Jan 6, 2022
b71484c
Unify the FlushProcessWriteBuffers mechanism for macOS arm64 / x64 (#…
github-actions[bot] Jan 6, 2022
898f09a
[release/6.0] Change macOS activatin injection failure handling (#63393)
janvorli Jan 6, 2022
1c2501d
[release/6.0] Fix XXHash for stripe size (#61923)
github-actions[bot] Jan 6, 2022
25d2a1f
[release/6.0] Making user secrets optional by default (#62917)
github-actions[bot] Jan 6, 2022
201673a
[release/6.0] WinHttp: always read HTTP/2 streams to the end (#63346)
github-actions[bot] Jan 7, 2022
73f902f
[release/6.0] Fix setting timestamp on Windows on readonly files (#62…
adamsitnik Jan 7, 2022
8abc8fc
[release/6.0] Undo breaking change in 6.0 in environment variable con…
github-actions[bot] Jan 7, 2022
a8b733b
[release/6.0] Ensure UserSecretsIdAttribute is added to assembly (#63…
eerhardt Jan 7, 2022
d575a6f
[release/6.0] Add explicit null-check for tailcalls to VSD (#62769)
github-actions[bot] Jan 7, 2022
dc56b08
[release/6.0] Port test-only test fixes (#63507)
danmoseley Jan 7, 2022
abe7d08
[release/6.0] Fix System.Object serialization with custom number hand…
github-actions[bot] Jan 8, 2022
039ab90
Fix bugs with generation for ctor param default values (#62798) (#63493)
layomia Jan 8, 2022
5af5538
Suppress warnings about [Obsolete] member usage in JSON src-gen'd cod…
github-actions[bot] Jan 8, 2022
26b0a12
[release/6.0] Fix TimeSpan support in sourcegen (#62191)
github-actions[bot] Jan 8, 2022
a9723f3
Include properties on records for (de)serialization in source-gen (#6…
github-actions[bot] Jan 8, 2022
4d8bebc
[wasm] Backport build improvements, and fixes from #61581 (#62757)
radical Jan 8, 2022
dfcba66
disable tests unstable on Windows 11 (#63527)
github-actions[bot] Jan 8, 2022
a16c322
[release/6.0] Suppress SendPacketsElement_FileStreamMultiPartMixed_Mu…
github-actions[bot] Jan 8, 2022
749c02b
[release/6.0] Fix GENERIC_MATH_FEATURE by making sure we always choos…
safern Jan 10, 2022
7a26492
Fix NETStandard library using JSON source gen (#63520)
ericstj Jan 10, 2022
3f6d8fa
Make delegates unsupported by JsonSerializer (#63514)
github-actions[bot] Jan 10, 2022
04a5836
[release/6.0] 1388 xml serializer assembly load context awareness (#6…
github-actions[bot] Jan 10, 2022
7780d28
Fix custom JsonConverterFactories not working with transitive type/pr…
github-actions[bot] Jan 10, 2022
beedfae
[release/6.0] Build all packages when in source-build (#63653)
safern Jan 13, 2022
fe7335c
[release/6.0] Use "read" to fetch misaligned 64bit values from bundle…
github-actions[bot] Jan 13, 2022
3c2d2a1
Fix the MacOS remote unwinder for VS4Mac (#63405)
Jan 13, 2022
6de5c5b
[wasm][debugger] Missing test files (#63148)
thaystg Jan 14, 2022
e08fc29
Merge branch 'release/6.0-maui' into merge/release/6.0-to-release/6.0…
akoeplinger Jan 17, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion eng/packaging.targets
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
'$(IsRIDSpecificProject)' != 'true' and
'$(PreReleaseVersionLabel)' == 'servicing' and
'$(GitHubRepositoryName)' != 'runtimelab'">false</GeneratePackageOnBuild>
<!-- When in source-build we need to generate all packages when building for all configurations even in servicing. -->
<GeneratePackageOnBuild Condition="!$(GeneratePackageOnBuild) and
'$(BuildAllConfigurations)' == 'true' and
'$(DotNetBuildFromSource)' == 'true'">true</GeneratePackageOnBuild>
<!-- Search for the documentation file in the intellisense package and otherwise pick up the generated one. -->
<LibIntellisenseDocumentationFilePath>$(XmlDocFileRoot)1033\$(AssemblyName).xml</LibIntellisenseDocumentationFilePath>
<UseIntellisenseDocumentationFile Condition="'$(UseIntellisenseDocumentationFile)' == '' and Exists('$(LibIntellisenseDocumentationFilePath)')">true</UseIntellisenseDocumentationFile>
Expand Down Expand Up @@ -279,7 +283,7 @@
</Target>

<Target Name="ValidateServicingVersionIsPropertlySet"
Condition="'$(PreReleaseVersionLabel)' == 'servicing'"
Condition="'$(PreReleaseVersionLabel)' == 'servicing' and '$(DotNetBuildFromSource)' != 'true'"
AfterTargets="GenerateNuspec">
<Error Condition="'$(ServicingVersion)' == '0'" Text="ServicingVersion is set to 0 and it should be an increment of the patch version from the last released package." />
</Target>
Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/debug/createdump/crashinfomac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@ void CrashInfo::VisitSegment(MachOModule& module, const segment_command_64& segm
uint64_t start = segment.vmaddr + module.LoadBias();
uint64_t end = start + segment.vmsize;

// Add this module segment to the set used by the thread unwinding to lookup the module base address for an ip.
AddModuleAddressRange(start, end, module.BaseAddress());

// Round to page boundary
start = start & PAGE_MASK;
_ASSERTE(start > 0);
Expand All @@ -297,9 +300,6 @@ void CrashInfo::VisitSegment(MachOModule& module, const segment_command_64& segm
}
// Add this module segment to the module mappings list
m_moduleMappings.insert(moduleRegion);

// Add this module segment to the set used by the thread unwinding to lookup the module base address for an ip.
AddModuleAddressRange(start, end, module.BaseAddress());
}
else
{
Expand Down
9 changes: 8 additions & 1 deletion src/coreclr/debug/createdump/stackframe.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,16 @@ struct StackFrame
}
}

// See comment in threadinfo.cpp UnwindNativeFrames function
#if defined(__aarch64__)
#define STACK_POINTER_MASK ~0x7
#else
#define STACK_POINTER_MASK ~0x0
#endif

inline uint64_t ModuleAddress() const { return m_moduleAddress; }
inline uint64_t InstructionPointer() const { return m_instructionPointer; }
inline uint64_t StackPointer() const { return m_stackPointer; }
inline uint64_t StackPointer() const { return m_stackPointer & STACK_POINTER_MASK; }
inline uint32_t NativeOffset() const { return m_nativeOffset; }
inline uint32_t Token() const { return m_token; }
inline uint32_t ILOffset() const { return m_ilOffset; }
Expand Down
10 changes: 10 additions & 0 deletions src/coreclr/debug/createdump/threadinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ ThreadInfo::UnwindNativeFrames(CONTEXT* pContext)
uint64_t ip = 0, sp = 0;
GetFrameLocation(pContext, &ip, &sp);

#if defined(__aarch64__)
// ARM64 can have frames with the same SP but different IPs. Increment sp so it gets added to the stack
// frames in the correct order and to prevent the below loop termination on non-increasing sp. Since stack
// pointers are always 8 byte align, this increase is masked off in StackFrame::StackPointer() to get the
// original stack pointer.
if (sp == previousSp && ip != previousIp)
{
sp++;
}
#endif
if (ip == 0 || sp <= previousSp) {
TRACE_VERBOSE("Unwind: sp not increasing or ip == 0 sp %p ip %p\n", (void*)sp, (void*)ip);
break;
Expand Down
5 changes: 2 additions & 3 deletions src/coreclr/debug/dbgutil/machoreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,8 @@ MachOModule::ReadLoadCommands()
m_segments.push_back(segment);

// Calculate the load bias for the module. This is the value to add to the vmaddr of a
// segment to get the actual address. For shared modules, this is 0 since those segments
// are absolute address.
if (segment->fileoff == 0 && segment->filesize > 0)
// segment to get the actual address.
if (strcmp(segment->segname, SEG_TEXT) == 0)
{
m_loadBias = m_baseAddress - segment->vmaddr;
}
Expand Down
129 changes: 95 additions & 34 deletions src/coreclr/pal/src/exception/remote-unwind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <mach-o/nlist.h>
#include <mach-o/dyld_images.h>
#include "compact_unwind_encoding.h"
#define MACOS_ARM64_POINTER_AUTH_MASK 0x7fffffffffffull
#endif

// Sub-headers included from the libunwind.h contain an empty struct
Expand Down Expand Up @@ -1422,25 +1423,56 @@ StepWithCompactNoEncoding(const libunwindInfo* info)

#if defined(TARGET_ARM64)

inline static bool
#define ARM64_SYSCALL_OPCODE 0xD4001001
#define ARM64_BL_OPCODE_MASK 0xFC000000
#define ARM64_BL_OPCODE 0x94000000
#define ARM64_BLR_OPCODE_MASK 0xFFFFFC00
#define ARM64_BLR_OPCODE 0xD63F0000
#define ARM64_BLRA_OPCODE_MASK 0xFEFFF800
#define ARM64_BLRA_OPCODE 0xD63F0800

static bool
StepWithCompactNoEncoding(const libunwindInfo* info)
{
// Check that the function is a syscall "wrapper" and assume there is no frame and pop the return address.
uint32_t opcode;
unw_word_t addr = info->Context->Pc - sizeof(opcode);
if (!ReadValue32(info, &addr, &opcode)) {
ERROR("StepWithCompactNoEncoding: can read opcode %p\n", (void*)addr);
return false;
}
// Is the IP pointing just after a "syscall" opcode?
if (opcode != ARM64_SYSCALL_OPCODE) {
ERROR("StepWithCompactNoEncoding: not in syscall wrapper function\n");
return false;
}
// Pop the return address from the stack
info->Context->Pc = info->Context->Lr;
TRACE("StepWithCompactNoEncoding: SUCCESS new pc %p sp %p\n", (void*)info->Context->Pc, (void*)info->Context->Sp);
return true;
}

static bool
ReadCompactEncodingRegister(const libunwindInfo* info, unw_word_t* addr, DWORD64* reg)
{
*addr -= sizeof(uint64_t);
if (!ReadValue64(info, addr, (uint64_t*)reg)) {
uint64_t value;
if (!info->ReadMemory((PVOID)*addr, &value, sizeof(value))) {
return false;
}
*reg = VAL64(value);
*addr -= sizeof(uint64_t);
return true;
}

inline static bool
ReadCompactEncodingRegisterPair(const libunwindInfo* info, unw_word_t* addr, DWORD64*second, DWORD64* first)
static bool
ReadCompactEncodingRegisterPair(const libunwindInfo* info, unw_word_t* addr, DWORD64* first, DWORD64* second)
{
// Registers are effectively pushed in pairs
//
// *first = **addr
// *addr -= 8
// **addr = *first
// *second= **addr
// *addr -= 8
// **addr = *second
if (!ReadCompactEncodingRegister(info, addr, first)) {
return false;
}
Expand All @@ -1450,8 +1482,8 @@ ReadCompactEncodingRegisterPair(const libunwindInfo* info, unw_word_t* addr, DWO
return true;
}

inline static bool
ReadCompactEncodingRegisterPair(const libunwindInfo* info, unw_word_t* addr, NEON128*second, NEON128* first)
static bool
ReadCompactEncodingRegisterPair(const libunwindInfo* info, unw_word_t* addr, NEON128* first, NEON128* second)
{
if (!ReadCompactEncodingRegisterPair(info, addr, &first->Low, &second->Low)) {
return false;
Expand Down Expand Up @@ -1484,30 +1516,28 @@ static bool
StepWithCompactEncodingArm64(const libunwindInfo* info, compact_unwind_encoding_t compactEncoding, bool hasFrame)
{
CONTEXT* context = info->Context;
unw_word_t addr;

unw_word_t callerSp;

if (hasFrame) {
// caller Sp is callee Fp plus saved FP and LR
callerSp = context->Fp + 2 * sizeof(uint64_t);
} else {
if (hasFrame)
{
context->Sp = context->Fp + 16;
addr = context->Fp + 8;
if (!ReadCompactEncodingRegisterPair(info, &addr, &context->Lr, &context->Fp)) {
return false;
}
// Strip pointer authentication bits
context->Lr &= MACOS_ARM64_POINTER_AUTH_MASK;
}
else
{
// Get the leat significant bit in UNWIND_ARM64_FRAMELESS_STACK_SIZE_MASK
uint64_t stackSizeScale = UNWIND_ARM64_FRAMELESS_STACK_SIZE_MASK & ~(UNWIND_ARM64_FRAMELESS_STACK_SIZE_MASK - 1);
uint64_t stackSize = (compactEncoding & UNWIND_ARM64_FRAMELESS_STACK_SIZE_MASK) / stackSizeScale * 16;
uint64_t stackSize = ((compactEncoding & UNWIND_ARM64_FRAMELESS_STACK_SIZE_MASK) / stackSizeScale) * 16;

callerSp = context->Sp + stackSize;
addr = context->Sp + stackSize;
}

context->Sp = callerSp;

unw_word_t addr = callerSp;

if (hasFrame &&
!ReadCompactEncodingRegisterPair(info, &addr, &context->Lr, &context->Fp)) {
return false;
}

// unwound return address is stored in Lr
// Unwound return address is stored in Lr
context->Pc = context->Lr;

if (compactEncoding & UNWIND_ARM64_FRAME_X19_X20_PAIR &&
Expand Down Expand Up @@ -1546,7 +1576,10 @@ StepWithCompactEncodingArm64(const libunwindInfo* info, compact_unwind_encoding_
!ReadCompactEncodingRegisterPair(info, &addr, &context->V[14], &context->V[15])) {
return false;
}

if (!hasFrame)
{
context->Sp = addr;
}
TRACE("SUCCESS: compact step encoding %08x pc %p sp %p fp %p lr %p\n",
compactEncoding, (void*)context->Pc, (void*)context->Sp, (void*)context->Fp, (void*)context->Lr);
return true;
Expand All @@ -1557,11 +1590,11 @@ StepWithCompactEncodingArm64(const libunwindInfo* info, compact_unwind_encoding_
static bool
StepWithCompactEncoding(const libunwindInfo* info, compact_unwind_encoding_t compactEncoding, unw_word_t functionStart)
{
#if defined(TARGET_AMD64)
if (compactEncoding == 0)
{
return StepWithCompactNoEncoding(info);
}
#if defined(TARGET_AMD64)
switch (compactEncoding & UNWIND_X86_64_MODE_MASK)
{
case UNWIND_X86_64_MODE_RBP_FRAME:
Expand All @@ -1575,11 +1608,6 @@ StepWithCompactEncoding(const libunwindInfo* info, compact_unwind_encoding_t com
return false;
}
#elif defined(TARGET_ARM64)
if (compactEncoding == 0)
{
TRACE("Compact unwind missing for %p\n", (void*)info->Context->Pc);
return false;
}
switch (compactEncoding & UNWIND_ARM64_MODE_MASK)
{
case UNWIND_ARM64_MODE_FRAME:
Expand Down Expand Up @@ -1717,6 +1745,12 @@ static void UnwindContextToContext(unw_cursor_t *cursor, CONTEXT *winContext)
unw_get_reg(cursor, UNW_AARCH64_X28, (unw_word_t *) &winContext->X28);
unw_get_reg(cursor, UNW_AARCH64_X29, (unw_word_t *) &winContext->Fp);
unw_get_reg(cursor, UNW_AARCH64_X30, (unw_word_t *) &winContext->Lr);
#ifdef __APPLE__
// Strip pointer authentication bits which seem to be leaking out of libunwind
// Seems like ptrauth_strip() / __builtin_ptrauth_strip() should work, but currently
// errors with "this target does not support pointer authentication"
winContext->Pc = winContext->Pc & MACOS_ARM64_POINTER_AUTH_MASK;
#endif // __APPLE__
TRACE("sp %p pc %p lr %p fp %p\n", winContext->Sp, winContext->Pc, winContext->Lr, winContext->Fp);
#elif defined(TARGET_S390X)
unw_get_reg(cursor, UNW_REG_IP, (unw_word_t *) &winContext->PSWAddr);
Expand Down Expand Up @@ -2126,6 +2160,33 @@ PAL_VirtualUnwindOutOfProc(CONTEXT *context, KNONVOLATILE_CONTEXT_POINTERS *cont
#elif defined(TARGET_ARM64)
TRACE("Unwind: pc %p sp %p fp %p\n", (void*)context->Pc, (void*)context->Sp, (void*)context->Fp);
result = GetProcInfo(context->Pc, &procInfo, &info, &step, false);
if (result && step)
{
// If the PC is at the start of the function, the previous instruction is BL and the unwind encoding is frameless
// with nothing on stack (0x02000000), back up PC by 1 to the previous function and get the unwind info for that
// function.
if ((context->Pc == procInfo.start_ip) &&
(procInfo.format & (UNWIND_ARM64_MODE_MASK | UNWIND_ARM64_FRAMELESS_STACK_SIZE_MASK)) == UNWIND_ARM64_MODE_FRAMELESS)
{
uint32_t opcode;
unw_word_t addr = context->Pc - sizeof(opcode);
if (ReadValue32(&info, &addr, &opcode))
{
// Is the previous instruction a BL opcode?
if ((opcode & ARM64_BL_OPCODE_MASK) == ARM64_BL_OPCODE ||
(opcode & ARM64_BLR_OPCODE_MASK) == ARM64_BLR_OPCODE ||
(opcode & ARM64_BLRA_OPCODE_MASK) == ARM64_BLRA_OPCODE)
{
TRACE("Unwind: getting unwind info for PC - 1 opcode %08x\n", opcode);
result = GetProcInfo(context->Pc - 1, &procInfo, &info, &step, false);
}
else
{
TRACE("Unwind: not BL* opcode %08x\n", opcode);
}
}
}
}
#else
#error Unexpected architecture
#endif
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<DebugType>full</DebugType>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;

namespace DebuggerTests
{
public class ClassToInspectWithDebugTypeFull
{
int a;
int b;
int c;
public ClassToInspectWithDebugTypeFull()
{
a = 10;
b = 20;
c = 30;
Console.WriteLine(a);
Console.WriteLine(b);
Console.WriteLine(c);
}
}
}
15 changes: 9 additions & 6 deletions src/native/corehost/bundle/file_entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,18 @@ file_entry_t file_entry_t::read(reader_t &reader, uint32_t bundle_major_version,
// First read the fixed-sized portion of file-entry
file_entry_fixed_t fixed_data;

fixed_data.offset = *(int64_t*)reader.read_direct(sizeof(int64_t));
fixed_data.size = *(int64_t*)reader.read_direct(sizeof(int64_t));
// NB: the file data is potentially unaligned, thus we use "read" to fetch 64bit values
reader.read(&fixed_data.offset, sizeof(int64_t));
reader.read(&fixed_data.size, sizeof(int64_t));

// compressedSize is present only in v6+ headers
fixed_data.compressedSize = bundle_major_version >= 6 ?
*(int64_t*)reader.read_direct(sizeof(int64_t)) :
0;
fixed_data.compressedSize = 0;
if (bundle_major_version >= 6)
{
reader.read(&fixed_data.compressedSize, sizeof(int64_t));
}

fixed_data.type = *(file_type_t*)reader.read_direct(sizeof(file_type_t));
fixed_data.type = (file_type_t)reader.read_byte();

file_entry_t entry(&fixed_data, force_extraction);

Expand Down
12 changes: 6 additions & 6 deletions src/native/corehost/bundle/header.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@ bool header_fixed_t::is_valid() const

header_t header_t::read(reader_t& reader)
{
const header_fixed_t* fixed_header = reinterpret_cast<const header_fixed_t*>(reader.read_direct(sizeof(header_fixed_t)));
header_fixed_t fixed_header;
reader.read(&fixed_header, sizeof(header_fixed_t));

if (!fixed_header->is_valid())
if (!fixed_header.is_valid())
{
trace::error(_X("Failure processing application bundle."));
trace::error(_X("Bundle header version compatibility check failed. Header version: %d.%d"), fixed_header->major_version, fixed_header->minor_version);
trace::error(_X("Bundle header version compatibility check failed. Header version: %d.%d"), fixed_header.major_version, fixed_header.minor_version);

throw StatusCode::BundleExtractionFailure;
}

header_t header(fixed_header->major_version, fixed_header->minor_version, fixed_header->num_embedded_files);
header_t header(fixed_header.major_version, fixed_header.minor_version, fixed_header.num_embedded_files);

// bundle_id is a component of the extraction path
reader.read_path_string(header.m_bundle_id);

const header_fixed_v2_t *v2_header = reinterpret_cast<const header_fixed_v2_t*>(reader.read_direct(sizeof(header_fixed_v2_t)));
header.m_v2_header = *v2_header;
reader.read(&header.m_v2_header, sizeof(header_fixed_v2_t));

return header;
}
Loading