[prev in list] [next in list] [prev in thread] [next in thread] 

List:       privoxy-developers
Subject:    [privoxy-devel] [ ijbswa-Bugs-1729174 ] OpenBSD resolver deadlock
From:       "SourceForge.net" <noreply () sourceforge ! net>
Date:       2007-06-01 18:32:44
Message-ID: E1HuBvY-00074N-L9 () sc8-sf-web23 ! sourceforge ! net
[Download RAW message or body]

Bugs item #1729174, was opened at 2007-05-31 21:34
Message generated for change (Comment added) made by fabiankeil
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=111118&aid=1729174&group_id=11118

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: unix-specific
Group: version 3.0.6
> Status: Closed
> Resolution: Fixed
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Fabian Keil (fabiankeil)
Summary: OpenBSD resolver deadlock

Initial Comment:
Depending on timing, privoxy might call gethostbyname and gethostbyaddr \
simultaneously from different threads, since both are protected by a separate  mutex. \
On OpenBSD, these two functions share a global socket. See:

http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/net/res_send.c?rev=1.19

> From time to this results in a deadlock. Attaching with gdb showed that two threads \
> were in gethostbyname/gethostbyaddr using recvfrom or poll on the same socket.

I have attached patch that solved the problem for me. It uses only one mutex to \
protect both gethostbyname and gethostbyaddr.

Kind Regards,
Ralf Horstmann
<ralf.horstmann@gmx.de>


----------------------------------------------------------------------

> Comment By: Fabian Keil (fabiankeil)
Date: 2007-06-01 18:32

Message:
Logged In: YES 
user_id=875547
Originator: NO

I committed an updated version of your patch to CVS.

It does indeed fix the hosts-file related crashes
on OpenBSD as well. I still assume it also fixes them
for NetBSD, but somehow managed to misplace my
test system ...

----------------------------------------------------------------------

Comment By: Fabian Keil (fabiankeil)
Date: 2007-06-01 08:35

Message:
Logged In: YES 
user_id=875547
Originator: NO

Thanks a lot, I'll give it a try over the weekend.

I think there's a fair chance that your patch will
also fix reproducible crashes with insanely large
/etc/hosts files (several MB) on OpenBSD and NetBSD.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=111118&aid=1729174&group_id=11118

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Ijbswa-developers mailing list
Ijbswa-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ijbswa-developers


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic