Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 04-15-2017, 22:32
tusk tusk is offline
Friend
 
Join Date: Jun 2016
Posts: 36
Rept. Given: 0
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 8
Thanks Rcvd at 18 Times in 12 Posts
tusk Reputation: 0
[DnSpy] - Find out new launched threads (i.e. timers)

Hi

One of the application I'm working on will go to 99% CPU usage after a couple of minutes (always about 4/5 minutes). Even if I just launch and leave it untouched.

I guess the app has a timer, launch some parallel thread, and in this thread something is going wrong (we know this app tries to call home some times, but it also might be a local license check, or even something unrelated, no idea so far).


Question is : how can I find out which thread (+method adress) has been launched with dnSpy (or other tool ?)
The goal would be to be able to break later on the specific location to see what's going on, in DnSpy


Thanks a lot
tusk
Reply With Quote
  #2  
Old 04-16-2017, 05:54
korosh korosh is offline
Friend
 
Join Date: May 2007
Posts: 86
Rept. Given: 99
Rept. Rcvd 26 Times in 16 Posts
Thanks Given: 16
Thanks Rcvd at 23 Times in 12 Posts
korosh Reputation: 26
You need to do some data collection to identify the problem (threads) before using DnSpy.
Check out this articles:
http://improve.dk/debugging-in-production-part-1-analyzing-100-cpu-usage-using-windbg/
https://www.toptal.com/dot-net/hunting-high-cpu-usage-in-dot-net
Reply With Quote
The Following 3 Users Say Thank You to korosh For This Useful Post:
niculaita (04-16-2017), tonyweb (09-16-2017), tusk (04-16-2017)
  #3  
Old 04-16-2017, 23:50
tusk tusk is offline
Friend
 
Join Date: Jun 2016
Posts: 36
Rept. Given: 0
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 8
Thanks Rcvd at 18 Times in 12 Posts
tusk Reputation: 0
Thanks a lot korosh
I will start with this and hopefully be able to find out the method(s) responsible for the 99% Cpu
Reply With Quote
  #4  
Old 04-17-2017, 03:06
tusk tusk is offline
Friend
 
Join Date: Jun 2016
Posts: 36
Rept. Given: 0
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 8
Thanks Rcvd at 18 Times in 12 Posts
tusk Reputation: 0
korosh : that was exactly what I needed !!


I could find the method in no time.

Developer had indeed an infinite loop starting after a couple of minutes. This was triggered before the end of the main form's load after an integrity check (which of course failed because I edited the assembly many times)


Thanks again, I learned something good today
Reply With Quote
The Following User Says Thank You to tusk For This Useful Post:
tonyweb (09-16-2017)
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
To manage Threads in DLL's El Cid General Discussion 3 05-09-2014 21:05
Suspending Kernel Mode Threads... omidgl General Discussion 10 01-17-2005 17:56
How to deal with threads ? bcl25 General Discussion 4 03-29-2003 06:22
Need to find a pattern in a running file merlin General Discussion 14 07-20-2002 06:59


All times are GMT +8. The time now is 07:44.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( 1998 - 2024 )