Nmap Development mailing list archives

Re: Locking a mutex by name?


From: Ron <ron () skullsecurity net>
Date: Fri, 14 Nov 2008 09:12:33 -0600

Patrick Donnelly wrote:
Hi Ron,

On Thu, Nov 13, 2008 at 8:17 PM, Ron <ron () skullsecurity net> wrote:

What you are doing is the expected use. Storing the mutexes in the
registry should not be necessary.


Unless I'm doing something wrong, it isn't working like that. I currently have this code for testing:

local function get_mutex(state)
  return nmap.mutex("RONTEST")
end

If I use that function in two different places, I seem to get different results (judging by the error, "Do not have a lock on this mutex"). I've put debug statements all over, and I don't think I'm doing anything weird.

I tried storing it in the registry instead, and that seemed to work. I'm storing the mutex itself, not the string.

I'm wondering whether this is an artifact of how Lua handles strings, or if there's a bug in the Mutex code? I can do more testing, if anybody wants, but it seems to be working now (albeit a little roundabout).

Ron


_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org


Current thread: