From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Asynchronous DNS Date: Sat, 27 Feb 2016 14:27:30 +1030 Message-ID: <87povils9h.fsf@gnus.org> References: <87k2mmzkry.fsf@gnus.org> <83k2mlyet8.fsf@gnu.org> <87lh71nriy.fsf@gnus.org> <8637t8opla.fsf@realize.ch> <871t8skg6c.fsf@gnus.org> <86y4b0n5q2.fsf@realize.ch> <87fux7gb7o.fsf@gnus.org> <83wpqjvd2f.fsf@gnu.org> <87zivfobn4.fsf@gnus.org> <86y4ao5g1c.fsf@realize.ch> <87r3ggdo9f.fsf@gnus.org> <86twlb5yl4.fsf@realize.ch> <83d1rzz1mu.fsf@gnu.org> <86egcc49qu.fsf@realize.ch> <87io1k41cg.fsf@gnus.org> <56C8A89C.4020909@cs.ucla.edu> <861t873zlj.fsf@realize.ch> <56C8CD9D.1020504@cs.ucla.edu> <86twl22w7b.fsf@realize.ch> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1456545510 21936 80.91.229.3 (27 Feb 2016 03:58:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 27 Feb 2016 03:58:30 +0000 (UTC) Cc: Alain Schneble , emacs-devel@gnu.org, Paul Eggert To: YAMAMOTO Mitsuharu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 27 04:58:21 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aZW1M-0007tk-1v for ged-emacs-devel@m.gmane.org; Sat, 27 Feb 2016 04:58:20 +0100 Original-Received: from localhost ([::1]:53223 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZW1L-000787-As for ged-emacs-devel@m.gmane.org; Fri, 26 Feb 2016 22:58:19 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZW17-00077c-PX for emacs-devel@gnu.org; Fri, 26 Feb 2016 22:58:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aZW12-000824-Q0 for emacs-devel@gnu.org; Fri, 26 Feb 2016 22:58:05 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:34279) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZW12-00081y-J4 for emacs-devel@gnu.org; Fri, 26 Feb 2016 22:58:00 -0500 Original-Received: from [175.103.25.178] (helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aZW0e-0001cI-1T; Sat, 27 Feb 2016 04:57:36 +0100 In-Reply-To: (YAMAMOTO Mitsuharu's message of "Sat, 27 Feb 2016 08:54:58 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-MailScanner-ID: 1aZW0e-0001cI-1T MailScanner-NULL-Check: 1457150257.1509@qGA/WJUDf2bSg7mzvuKSGQ X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.224.195 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:200703 Archived-At: YAMAMOTO Mitsuharu writes: > 845 #ifdef HAVE_GETADDRINFO_A > 846 if (p->dns_request) > 847 { > 848 gai_cancel (p->dns_request); > 849 free_dns_request (process); > 850 } > 851 #endif > > The man page says gai_cancel does not cancel the request if it is > currently being processed. So I suspect it is unsafe to free struct > gaicb by calling free_dns_request if the request was not canceled > actually. Yes, I think you're right. If we check the status and it's EAI_CANCELLED, then it's safe to free the request. However, what do we do if it isn't safe? This is in `delete-process', so the process object itself is going to go away, and then we lose track of p->dns_request, so we can't free it. I think. Anybody got any ideas for scheduling that free_dns_request? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no