Closed ayakael closed 10 months ago
Turns out this is caused by today's update to latest musl.
lttng has similar bug: https://review.lttng.org/c/lttng-tools/+/9268
The following diff is a workaround:
diff --git a/src/runtime/src/coreclr/debug/createdump/crashinfounix.cpp b/src/runtime/src/coreclr/debug/createdump/crashinfounix.cpp
index 03712c3b684..99d8a457957 100644
--- a/src/runtimr/src/coreclr/debug/createdump/crashinfounix.cpp
+++ b/src/runtime/src/coreclr/debug/createdump/crashinfounix.cpp
@@ -395,7 +395,7 @@ CrashInfo::ReadProcessMemory(void* address, void* buffer, size_t size, size_t* r
// performance optimization.
m_canUseProcVmReadSyscall = false;
assert(m_fd != -1);
- *read = pread64(m_fd, buffer, size, (off64_t)address);
+ *read = pread(m_fd, buffer, size, (off_t)address);
}
if (*read == (size_t)-1)
We'd have to implement something else to maintain libc support.
edit On main:
diff --git a/src/runtime/src/coreclr/debug/createdump/crashinfounix.cpp.orig b/src/runtime/src/coreclr/debug/createdump/crashinfounix.cpp
index 20b2494..165b190 100644
--- a/src/runtime/src/coreclr/debug/createdump/crashinfounix.cpp.orig
+++ b/src/runtime/src/coreclr/debug/createdump/crashinfounix.cpp
@@ -469,7 +469,7 @@ CrashInfo::ReadProcessMemory(void* address, void* buffer, size_t size, size_t* r
// performance optimization.
m_canUseProcVmReadSyscall = false;
assert(m_fdMem != -1);
- *read = pread64(m_fdMem, buffer, size, (off64_t)address);
+ *read = pread(m_fdMem, buffer, size, (off_t)address);
}
if (*read == (size_t)-1)
diff --git a/src/runtime/src/coreclr/debug/createdump/crashinfo.cpp.orig b/src/runtime/src/coreclr/debug/createdump/crashinfo.cpp
index 5addb79..79655d1 100644
--- a/src/runtime/src/coreclr/debug/createdump/crashinfo.cpp.orig
+++ b/src/runtime/src/coreclr/debug/createdump/crashinfo.cpp
@@ -760,7 +760,7 @@ CrashInfo::PageMappedToPhysicalMemory(uint64_t start)
}
uint64_t pagemapOffset = (start / PAGE_SIZE) * sizeof(uint64_t);
- uint64_t seekResult = lseek64(m_fdPagemap, (off64_t) pagemapOffset, SEEK_SET);
+ uint64_t seekResult = lseek(m_fdPagemap, (off_t) pagemapOffset, SEEK_SET);
if (seekResult != pagemapOffset)
{
int seekErrno = errno;
Tagging subscribers to this area: @tommcdon See info in area-owners.md if you want to be subscribed.
Author: | ayakael |
---|---|
Assignees: | - |
Labels: | `area-Diagnostics-coreclr`, `untriaged`, `needs-area-label` |
Milestone: | - |
Hello @ayakael! Please feel free to submit a PR to main to address this issue.
This has been fixed.
Description
Building runtime
v6.0.116
andv7.0.105
andv8.0.0-preview.3.23174.8
on Alpine Linux with clang-16 fails due to following error:Full log: https://lab.ilot.io/ayakael/dotnet-stage0/-/jobs/2058/raw
Reproduction Steps
On Alpine Linux, build any recent tag.
Expected behavior
Build should work
Actual behavior
Build fails
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response