Understanding why getaddrinfo_a and __gai_enqueue_request use recursive locks

Hal Murray hmurray@megapathdsl.net
Tue Sep 26 06:29:00 GMT 2017


> Do you mean annotations to find resource leaks?

No.  I was looking for a compiler like package that would scan all the source 
code to verify that the appropriate lock was held whenever an inner function 
was called.

The inner function would need an annotation to say that it was an inner 
function and which lock was needed.

The outer functions would need an annotation to say when it was locking or 
unlocking a lock.  It might work to recognize the POSIX functions.

That probably doesn't work if you lock in one function and unlock in a 
different function.  I don't think I've ever worked with code like that.


-- 
These are my opinions.  I hate spam.





More information about the Libc-help mailing list