0

I am trying to analyze .NET memory dump and state of Task objects on heap. I am using fantastic WinDBg extension MEX. !TaskTriage shows all Tasks in very nice table. Some of them has value in method column but for most there is null like this:

000001fa33b4e658 | Task<System.Object>             |           <null> | TASK_STATE_WAITINGFORACTIVATION | <null>

I would like to know in which situations info about method is available and if I can do something in my code to have this information included.

Michal
  • 1,324
  • 2
  • 16
  • 38
  • Is the dump from a Debug or Release build? – stuartd Oct 12 '19 at 18:14
  • It is from Release build. However method isn't for all tasks – Michal Oct 12 '19 at 18:17
  • In a Release build the compiler can inline methods, which would result in there not being a mrthod name. – stuartd Oct 12 '19 at 18:20
  • That would mean that almost all async methods I have in code has been inlined and few from 3rd party library weren't. I will study rules for inlining but looks unlikely to me. Can there be something different? – Michal Oct 12 '19 at 18:29
  • Yes, I think you're probably right there. Do you have the [.pdb files](https://stackoverflow.com/questions/3899573/what-is-a-pdb-file) available from the Release build? – stuartd Oct 12 '19 at 19:45
  • I would speculate the tasks without a method are created with `TaskCompletionSource` which are not bound to any async method. – Serge Semenov Oct 13 '19 at 03:54
  • @stuartd Yes I have pdb files loaded – Michal Oct 22 '19 at 13:03

0 Answers0