Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Code review feedback
  • Loading branch information
Mike McLaughlin committed May 9, 2023
commit 45ec22b0c894e93c5fd003045103ae95d7dcce49
6 changes: 4 additions & 2 deletions src/coreclr/debug/createdump/crashinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,10 @@ GetHResultString(HRESULT hr)
bool
CrashInfo::InitializeDAC(DumpType dumpType)
{
// Don't attempt to load the DAC if native AOT app (there is no DAC)
if (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 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))
{
return true;
}
Expand Down
10 changes: 8 additions & 2 deletions src/coreclr/debug/createdump/createdumpunix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ CreateDump(const CreateDumpOptions& options)
#endif
TRACE("PAGE_SIZE %d\n", PAGE_SIZE);

if (options.CrashReport && (options.AppModel == AppModelType::SingleFile || options.AppModel != AppModelType::NativeAOT))
{
printf_error("The app model does not support crash report generation\n");
goto exit;
}

// Initialize the crash info
if (!crashInfo->Initialize())
{
Expand Down Expand Up @@ -51,8 +57,8 @@ CreateDump(const CreateDumpOptions& options)
{
goto exit;
}
// Write the crash report json file if enabled and createdump isn't statically linked into the runtime
if (options.CrashReport && options.AppModel != AppModelType::SingleFile && options.AppModel != AppModelType::NativeAOT)
// Write the crash report json file if enabled
if (options.CrashReport)
{
CrashReportWriter crashReportWriter(*crashInfo);
crashReportWriter.WriteCrashReport(dumpPath);
Expand Down
2 changes: 0 additions & 2 deletions src/coreclr/pal/src/thread/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2230,9 +2230,7 @@ PROCCreateCrashDump(
SEHCleanupSignals();

// Call the statically linked createdump code
fprintf(stderr, "[createdump] entering callback %d\n", gPID);
g_createdumpCallback(argv.size(), argv.data());
fprintf(stderr, "[createdump] returned from callback\n");
}
else
{
Expand Down