GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Obsolete constructor public StackTrace(Thread targetThread, bool needFileInfo) · Issue #80555 · dotnet/runtime

Obsolete constructor public StackTrace(Thread targetThread, bool needFileInfo) #80555

New issue
Copy link
New issue
Copy link
Open
Open
Obsolete constructor public StackTrace(Thread targetThread, bool needFileInfo)#80555
Copy link
Labels
api-suggestionEarly API idea and discussion, it is NOT ready for implementationarea-System.Diagnosticsfeature-request
Milestone
Future

Description

@DamirLisak
DamirLisak
opened on Jan 12, 2023
Issue body actions

I wan't to come back to the sentence from Originally posted by @leculver in #31508 (comment)
"It's just on my roadmap. Feel free to create an issue in the clrmd github repo though if you'd like to track it."

https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.stacktrace.-ctor?view=net-7.0

This feature was automatically closed by the msftbot. Is this feature still planned to be implemented? If not - why?
Stack-Tracing of managed threads is not only useful for unresponsive threads, it's very useful for the diagnostic during runtime.
1.) For example in very multithreaded projects to detect deadlocks and prevent deadlocks by lock leveling (https://learn.microsoft.com/en-us/archive/msdn-magazine/2007/october/net-matters-deadlock-monitor). Only by suspending all relevant threads, dumping the stack trace and resuming them afterwards is it possible to find problems on productive systems.
2.) A another example for diagnosing performance issues when the processing time of a thread is to long because it waits for a lock, that is currently hold by another thread. Another monitoring thread would then temporarily stop the relevant threads and dump the stacks.
I think there are far more examples where suspending and resuming threads is useful. Therefore, I cannot understand why such functionalities that existed in .NET 4 should no longer be available in .net core.

Reacted by Aleksandar Agincic, Ivan Hrastinski, Mario Žitković, Damir Lisak, ldfreenet, dhbprog and Tim Cassell

Activity

  1. ghost added
    untriagedNew issue has not been triaged by the area owner
    on Jan 12, 2023
  2. DamirLisak commented on Jan 12, 2023

    @DamirLisak
    DamirLisak
    on Jan 12, 2023
    Author
    More actions

    I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

    Label is:
    area-System.Diagnostics

  3. teo-tsirpanis
    added
    area-System.Diagnostics
    on Jan 12, 2023
  4. tommcdon commented on Jan 17, 2023

    @tommcdon
    tommcdon
    on Jan 17, 2023
    Member
    More actions

    @noahfalk

  5. noahfalk commented on Jan 18, 2023

    @noahfalk
    noahfalk
    on Jan 18, 2023
    Member
    More actions

    Originally posted by @leculver in #31508 (comment)
    "It's just on my roadmap. Feel free to create an issue in the clrmd github repo though if you'd like to track it."
    https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.stacktrace.-ctor?view=net-7.0
    This feature was automatically closed by the msftbot. Is this feature still planned to be implemented? If not - why?

    There may have been some confusion but I believe the "It" that Lee Culver was referring to implementing at that point in the discussion was the ability for the CLRMD library to attach to a running process on Linux. I'll defer to @leculver to understand what the current status of that work is.

    In terms of StackTrace API that takes a Thread parameter, any attempt to recreate the API would require a new implementation because the underlying runtime code it relied on has undergone some significant changes. The more interest we see from developers to use that API the more priority we would give it, but so far I think requests have been few and far between.

    In the meantime there are some potential alternatives that might fulfill what you are looking for. The dotnet-stack tool can produce a textual version of stacktraces for all threads. It is intended for developers that are diagnosing hangs/deadlocks to understand where threads are blocked. If you didn't want to run a 2nd process there is also the Microsoft.Diagnostics.NetCore.Client library which has the underlying APIs you could invoke directly and all the code to dotnet-stack is OSS if you want to see how it works. These APIs are a little more involved than a one-liner new StackTrace(...), but they are also considerably more powerful letting you capture complete profiling traces or dumps. For example with a trace you could distinguish whether the non-responsive thread is deadlocked, live locked, or just executing abnormally slowly.
    If you captured dumps instead of profiling traces the CLRMD library Lee was refering to can help programmatically analyze them, or you can load them in a debugger like any other dump.

    Sorry I know its not quite what you were hoping for, but hopefully some of the alternatives help. I'm also happy to leave this issue open to allow other .NET devs to +1 their interest in the StackTrace(Thread, ...) APIs.

    Reacted by 三少爷的码, dhbprog and Damir Lisak
  6. noahfalk
    added
    api-suggestionEarly API idea and discussion, it is NOT ready for implementation
    feature-request
    and removed
    untriagedNew issue has not been triaged by the area owner
    on Jan 18, 2023
  7. tommcdon
    added this to the Future milestone on Jul 10, 2023
  8. DamirLisak commented on Oct 6, 2023

    @DamirLisak
    DamirLisak
    on Oct 6, 2023
    Author
    More actions

    @tommcdon : Thank you for adding to future milestone 🙏!

  9. DamirLisak commented on Apr 23, 2026

    @DamirLisak
    DamirLisak
    on Apr 23, 2026
    Author
    More actions

    @tommcdon - any news? Is there any chance to get it in the milestone?

  10. DamirLisak
    added a commit that references this issue on Apr 23, 2026

    Temporary Workaround for missing StackTrace constructor. dotnet/runti…

    5943369
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-suggestionEarly API idea and discussion, it is NOT ready for implementationarea-System.Diagnosticsfeature-request

    Type

    No type

    Projects

    No projects

      Milestone

      • FutureNo due date

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402792 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.