Coder Social home page Coder Social logo

locksinfo's Introduction

Prints acquired threads in given process with pid. This is similar to windbg extenions for dumping critsecs !locks

A bit more information here: https://msdn.microsoft.com/en-us/library/windows/hardware/ff541979%28v=vs.85%29.aspx

C:\>locksinfo.exe 51204

a handy utility to list locks acquired in a process
author: Sarang Baheti, source: https://github.com/sarangxyz/locksinfo

Locks information for process- 51204, testprocess.exe
Found 63391 locks

Printing 3 acquired locks
------------------------------------------------------------------------

#0 Lock at address-   0x00000000249251D0
Type:              0
OwningThread:      57620
LockingSemaphore:  0x0000000000000A24
ContentionCount:   0
LockCountRaw:      -2
  LockStatus:      locked
  AnyThreadsWoken: no
  #ThreadsWaiting: 0

#1 Lock at address-   0x000000002CB69C70
Type:              0
OwningThread:      84440
LockingSemaphore:  0x0000000000000000
ContentionCount:   0
LockCountRaw:      -2
  LockStatus:      locked
  AnyThreadsWoken: no
  #ThreadsWaiting: 0

#2 Lock at address-   0x0000000013EC4C50
Type:              0
OwningThread:      53540
LockingSemaphore:  0x0000000000001BB4
ContentionCount:   1
LockCountRaw:      -6
  LockStatus:      locked
  AnyThreadsWoken: no
  #ThreadsWaiting: 1
  

If you run with flags set to track Locks in your process it can print creation site for the critical section: Off course i am not translating symbols but that is not too hard if you want to try. Perhaps i will do it later.

Appverifier Settings

Printing 1 acquired locks
------------------------------------------------------------------------

#0 Lock at address-   0x000007FED6B539C0
Type:              0
OwningThread:      44356
LockingSemaphore:  0x0000000000000000
ContentionCount:   0
LockCountRaw:      -2
  LockStatus:      locked
  AnyThreadsWoken: no
  #ThreadsWaiting: 0

Creation traceback:
[ 0] 000F003500000040
[ 1] 000007FEF210A992
[ 2] 000007FEFD1C32CA
[ 3] 000007FED6AAD0C1
[ 4] 000007FED6A7DCF6
[ 5] 000007FED6A7D70C
[ 6] 000007FED6A7D575
[ 7] 000007FED6A7DF86
[ 8] 000007FED6A79363
[ 9] 000007FEF2053EB8
[10] 000007FEF24BBAE5
[11] 000007FEF2106F62
[12] 00000000774A6CA8
[13] 00000000774AD0D7
[14] 000000007750BD09
[15] 000000007749A36E

locksinfo's People

Contributors

sarangxyz avatar sarangbaheti avatar

Stargazers

wyrover avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.