Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 5.6k
Remove createdump's DAC dependency for the PAL for NativeAOT#88802
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
f9d18c4b3cb87d5fa8c02cc533300401fade2f1dcacfa1c25cfabe256b3eb6cFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,22 @@ | ||
| check_function_exists(process_vm_readv HAVE_PROCESS_VM_READV) | ||
| check_symbol_exists( | ||
| clock_gettime_nsec_np | ||
| time.h | ||
| HAVE_CLOCK_GETTIME_NSEC_NP) | ||
| check_cxx_source_runs(" | ||
| #include <stdlib.h> | ||
| #include <time.h> | ||
| #include <sys/time.h> | ||
| int main() | ||
| { | ||
| int ret; | ||
| struct timespec ts; | ||
| ret = clock_gettime(CLOCK_MONOTONIC, &ts); | ||
| exit(ret); | ||
| }" HAVE_CLOCK_MONOTONIC) | ||
| configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -280,10 +280,11 @@ GetHResultString(HRESULT hr) | ||
| bool | ||
| CrashInfo::InitializeDAC(DumpType dumpType) | ||
| { | ||
| // Don't attempt to load the DAC if the app model doesn't support it by default. The default for single-file is a | ||
| // full dump, but if the dump type requested is a mini, triage or heap and the DAC is side-by-side to the single-file | ||
| // application the core dump will be generated. | ||
| if (dumpType == DumpType::Full && (m_appModel == AppModelType::SingleFile || m_appModel == AppModelType::NativeAOT)) | ||
| // Don't attempt to load the DAC if the app model doesn't support it by default. The default for single-file is | ||
| // a full dump, but if the dump type requested is a mini, triage or heap and the DAC is next to the single-file | ||
| // application the core dump will be generated. For NativeAOT, there is currently no DAC available so never | ||
| // attempt to load it. | ||
| if ((dumpType == DumpType::Full && m_appModel == AppModelType::SingleFile) || m_appModel == AppModelType::NativeAOT) | ||
hoyosjs marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| { | ||
| return true; | ||
| } | ||
| @@ -483,19 +484,24 @@ CrashInfo::EnumerateManagedModules() | ||
| bool | ||
| CrashInfo::UnwindAllThreads() | ||
| { | ||
| TRACE("UnwindAllThreads: STARTED (%d)\n", m_dataTargetPagesAdded); | ||
| ReleaseHolder<ISOSDacInterface> pSos = nullptr; | ||
| if (m_pClrDataProcess != nullptr) { | ||
| m_pClrDataProcess->QueryInterface(__uuidof(ISOSDacInterface), (void**)&pSos); | ||
| } | ||
| // For each native and managed thread | ||
| for (ThreadInfo* thread : m_threads) | ||
| // Don't unwind any threads if Native AOT since there isn't a DAC to get the remote | ||
| // unwinder support and they are full dumps. | ||
| if (m_appModel != AppModelType::NativeAOT) | ||
mikem8361 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| { | ||
| if (!thread->UnwindThread(m_pClrDataProcess, pSos)) { | ||
| return false; | ||
| TRACE("UnwindAllThreads: STARTED (%d)\n", m_dataTargetPagesAdded); | ||
| ReleaseHolder<ISOSDacInterface> pSos = nullptr; | ||
| if (m_pClrDataProcess != nullptr) { | ||
| m_pClrDataProcess->QueryInterface(__uuidof(ISOSDacInterface), (void**)&pSos); | ||
| } | ||
| // For each native and managed thread | ||
| for (ThreadInfo* thread : m_threads) | ||
| { | ||
| if (!thread->UnwindThread(m_pClrDataProcess, pSos)) { | ||
| return false; | ||
| } | ||
| } | ||
| TRACE("UnwindAllThreads: FINISHED (%d)\n", m_dataTargetPagesAdded); | ||
| } | ||
| TRACE("UnwindAllThreads: FINISHED (%d)\n", m_dataTargetPagesAdded); | ||
| return true; | ||
| } | ||
| @@ -959,9 +965,9 @@ FormatString(const char* format, ...) | ||
| ArrayHolder<char> buffer = new char[MAX_LONGPATH + 1]; | ||
| va_list args; | ||
| va_start(args, format); | ||
| int result = vsprintf_s(buffer, MAX_LONGPATH, format, args); | ||
| int result = vsnprintf(buffer, MAX_LONGPATH, format, args); | ||
| va_end(args); | ||
| return result > 0 ? std::string(buffer) : std::string(); | ||
| return result > 0 && result < MAX_LONGPATH ? std::string(buffer) : std::string(); | ||
| } | ||
| // | ||
| @@ -971,15 +977,16 @@ std::string | ||
| ConvertString(const WCHAR* str) | ||
| { | ||
| if (str == nullptr) | ||
| return{}; | ||
| return { }; | ||
| int len = WideCharToMultiByte(CP_UTF8, 0, str, -1, nullptr, 0, nullptr, nullptr); | ||
| size_t cch = u16_strlen(str) + 1; | ||
| int len = minipal_get_length_utf16_to_utf8((CHAR16_T*)str, cch, 0); | ||
| if (len == 0) | ||
| return{}; | ||
| return { }; | ||
| ArrayHolder<char> buffer = new char[len + 1]; | ||
| WideCharToMultiByte(CP_UTF8, 0, str, -1, buffer, len + 1, nullptr, nullptr); | ||
| return std::string{ buffer }; | ||
| minipal_convert_utf16_to_utf8((CHAR16_T*)str, cch, buffer, len + 1, 0); | ||
| return std::string{ buffer }; | ||
| } | ||
| // | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -33,7 +33,8 @@ const char* g_help = "createdump [options]\n" | ||
| "--crashreportonly - write crash report file only (no dump).\n" | ||
| "--crashthread <id> - the thread id of the crashing thread.\n" | ||
| "--signal <code> - the signal code of the crash.\n" | ||
| "--singlefile - enable single-file app check.\n" | ||
| "--singlefile - single-file app model.\n" | ||
| "--nativeaot - native AOT app model.\n" | ||
| #endif | ||
| ; | ||
| @@ -126,6 +127,10 @@ int createdump_main(const int argc, const char* argv[]) | ||
| { | ||
| options.AppModel = AppModelType::SingleFile; | ||
| } | ||
| else if (strcmp(*argv, "--nativeaot") == 0) | ||
mikem8361 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| { | ||
| options.AppModel = AppModelType::NativeAOT; | ||
| } | ||
| else if (strcmp(*argv, "--code") == 0) | ||
| { | ||
| options.SignalCode = atoi(*++argv); | ||
| @@ -199,9 +204,8 @@ int createdump_main(const int argc, const char* argv[]) | ||
| { | ||
| if (::GetTempPathA(MAX_LONGPATH, tmpPath) == 0) | ||
| { | ||
| //printf_error("GetTempPath failed %s", GetLastErrorString().c_str()); | ||
| printf_error("GetTempPath failed\n"); | ||
| return ::GetLastError(); | ||
| return -1; | ||
mikem8361 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| } | ||
| exitCode = strcat_s(tmpPath, MAX_LONGPATH, DEFAULT_DUMP_TEMPLATE); | ||
| if (exitCode != 0) | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.