Skip to content

Try getting a crashdump for #70010 - #71177

Closed
MichalStrehovsky wants to merge 10 commits into
mainfrom
MichalStrehovsky-patch-2
Closed

MichalStrehovsky wants to merge 10 commits into
mainfrom
MichalStrehovsky-patch-2

Conversation

@MichalStrehovsky

Copy link
Copy Markdown
Member

Hangs don't produce crashdumps in Helix.

@MichalStrehovsky MichalStrehovsky added NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) area-NativeAOT-coreclr labels Jun 23, 2022
@MichalStrehovsky

Copy link
Copy Markdown
Member Author

Wat?

[SKIP] System.Tests.EnumTests.IsDefined_InvokeBoolEnum_ReturnsExpected
/root/helix/work/workitem/e
----- end Fri Jun 24 02:39:37 UTC 2022 ----- exit code 124 ----------------------------------------------------------
Waiting a few seconds for any dump to be written..
cat /proc/sys/kernel/core_pattern: /home/helixbot/dotnetbuild/dumps/core.%u.%p
cat /proc/sys/kernel/core_uses_pid: 0
cat: /proc/sys/kernel/coredump_filter: No such file or directory
cat /proc/sys/kernel/coredump_filter:
Looking around for any Linux dump..
... found no dump in /root/helix/work/workitem/e

@MichalStrehovsky

Copy link
Copy Markdown
Member Author

@dotnet/runtime-infrastructure anyone knows if there was a change in how we collect coredumps in Helix?

The CI run for a3731bb failed but no crashdump was found by the RunnerTemplate.sh script and no crashdump is attached to the test result either:

https://dev.azure.com/dnceng/public/_build/results?buildId=1842929&view=ms.vss-test-web.build-test-results-tab&runId=48641322&resultId=109560&paneView=dotnet-dnceng.dnceng-build-release-tasks.helix-test-information-tab

I then made a hacky change in RunnerTemplate.sh (last 3 commits) to look for crashdumps in one more location and changed things up to reliably crash. The test results now have a crashdump attached in the latest run.

Looks like Helix decided to place crashdumps where we don't expect them?

@hoyosjs

hoyosjs commented Jun 24, 2022

Copy link
Copy Markdown
Member

There's a dump file:

2022-06-24T02:40:21.393Z	INFO   	executor(767)	_dump_file_upload	Dump files created in /home/helixbot/dotnetbuild/dumps are ready to be uploaded
2022-06-24T02:40:21.395Z	INFO   	executor(780)	_dump_file_upload	Dump file: /home/helixbot/dotnetbuild/dumps/core.1001.26, size: 16384
2022-06-24T02:40:21.396Z	INFO   	executor(802)	_dump_file_upload	Copying...
2022-06-24T02:40:21.397Z	INFO   	executor(805)	_dump_file_upload	Copy successful.

The upload should happen as long as it's in the helix crashdump dir, and as far as I know, the filter, the ulimit, and the pattern are all set to point to the right place. Not sure why they didn't get correlated - I saw this:

20042527	a57bb04e-656d-4a0f-b8b1-62cbad26c824	992768133	f41c866a-7934-4a15-b51d-c92be056f055	System.Runtime.Tests	1	16179137951	https://helixre107v0xdeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-71177-merge-a57bb04e656d4a0fb8/System.Runtime.Tests/1/core.1001.26?helixlogtype=result	core.1001.26	47	203829248	1	2022-06-24T06:25:10.066Z	203829248

@dotnet/dnceng, any ideas why the dump wasn't correlated to the workitem?

@alexperovich

Copy link
Copy Markdown
Member

If you look a bit farther in the logs it shows this:

2022-06-24T02:40:21.400Z	INFO   	executor(963)	_upload_files	Uploading file core.1001.26...
2022-06-24T02:40:21.401Z	WARNING	executor(908)	_upload_single_file	File core.1001.26 is empty, skipping upload
2022-06-24T02:40:21.401Z	INFO   	executor(963)	_upload_files	Uploading file how-to-debug-dump.md...
2022-06-24T02:40:21.402Z	INFO   	executor(920)	_upload_single_file	Uploading the file how-to-debug-dump.md

It skipped upload of that file because it appeared to be empty. This is strange though as it had a size higher up. I will check things.

@alexperovich

Copy link
Copy Markdown
Member

Ahh yes, I know what happened here. That dump file is actually a 0 byte file. The log about the dump file shows its size as 16384 because we force files smaller than that number to be that number for our file discovery code. That helps make our network timeout code not be overly aggressive. Otherwise we would give 100 2 byte files a very small amount of upload time, which would cause timeouts due to network overhead. In this case the actual file was 0 bytes, and os.path.getsize returned 0.

@hoyosjs

hoyosjs commented Jun 24, 2022

Copy link
Copy Markdown
Member

Oh, the dump I shared seems to be from this PR but a different run and ironically with the same pids. Entirely possible then, thanks alex.

@MichalStrehovsky

Copy link
Copy Markdown
Member Author

It's odd seeing a 0 byte dump.

What I was working with is this code in RunnerTemplate.sh:

if [[ "$core_name_uses_pid" == "1" ]]; then
# We don't know what the PID of the process was, so let's look at all core
# files whose name matches core.NUMBER
echo Looking for files matching core.* ...
for f in core.*; do
[[ $f =~ core.[0-9]+ ]] && print_info_from_core_file "$f" "dotnet" && copy_core_file_to_temp_location "$f" && rm "$f"
done
elif [ -f core ]; then
echo found a dump named core in $EXECUTION_DIR !
print_info_from_core_file "core" "dotnet"
copy_core_file_to_temp_location "core"
rm "core"
else
echo ... found no dump in $PWD
fi
fi

It's looking for coredumps in current directory.

But per the output of the script:

cat /proc/sys/kernel/core_pattern: /home/helixbot/dotnetbuild/dumps/core.%u.%p

Coredumps are now placed somewhere under helixbot/dotnetbuild.

Once I "fixed" it by hardcoding that, the crasdump was "magically" uploaded.

@MichalStrehovsky
MichalStrehovsky deleted the MichalStrehovsky-patch-2 branch June 26, 2022 23:52
@ghost ghost locked as resolved and limited conversation to collaborators Jul 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-NativeAOT-coreclr NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants