<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><br><br><div dir="ltr">Sent from my iPhone</div><div dir="ltr"><br>Begin forwarded message:<br><br></div><blockquote type="cite"><div dir="ltr"><b>From:</b> "Mark D. Gray" <notifications@github.com><br><b>Date:</b> October 20, 2020 at 12:05:12 EDT<br><b>To:</b> libreswan/libreswan <libreswan@noreply.github.com><br><b>Cc:</b> Subscribed <subscribed@noreply.github.com><br><b>Subject:</b> <b>[libreswan/libreswan] Pluto hangs on start up with large open file ulimit (ulimit -n) (#373)</b><br><b>Reply-To:</b> libreswan/libreswan <reply+AAW5L6P4APR54X7FG3MOFRN5TLV3FEVBNHHCWQPKIY@reply.github.com><br><br></div></blockquote><blockquote type="cite"><div dir="ltr"><p></p>
<h2>Description</h2>
<p>When starting pluto on a machine with a large "open file" ulimit (e.g ulimit -n 1073741816), pluto is unresponsive for a long time (~30 minutes). This is due to it iterating over potentially open file descriptors at <a href="https://github.com/libreswan/libreswan/blob/fcddd2602368639a5fdec67cc740b1b624467fca/programs/pluto/plutomain.c#L1548">https://github.com/libreswan/libreswan/blob/fcddd2602368639a5fdec67cc740b1b624467fca/programs/pluto/plutomain.c#L1548</a>.</p>
<h2>Reproduce</h2>
<p>This can be reproduced by running the following commands:</p>
<pre><code># Shell 1:
$ ulimit -n 1073741816
$ /usr/libexec/ipsec/pluto --leak-detective --config /etc/ipsec.conf --logfile /var/log/libreswan.log --nofork &
# Shell 2:
$ ipsec status
</code></pre>
<h2>Output</h2>
<h3>Expected Output</h3>
<pre><code>000 using kernel interface: netkey
..
..
..
000 IPsec SAs: total(0), authenticated(0), anonymous(0)
000  
000 Bare Shunt list:
000  
</code></pre>
<h3>Actual Output</h3>
<p>N/A (<code>ipsec status</code> command hangs)</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>You are receiving this because you are subscribed to this thread.<br>Reply to this email directly, <a href="https://github.com/libreswan/libreswan/issues/373">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAW5L6NS37QXX7VMGCTUF7TSLWYLFANCNFSM4SYR3XGA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAW5L6LVSM6ZTHU5Y53OBUTSLWYLFA5CNFSM4SYR3XGKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4K2B5JDA.gif" height="1" width="1" alt="" data-unique-identifier=""></p>
</div></blockquote></body></html>