Hi Peter,

On Mon, Apr 16, 2012 at 10:53:17PM +0300, Peter Eisentraut wrote:
> Calling lvs directly from the command line also shows messages about
> leaked file descriptors, so I'm not convinced that this is a problem in
> anacron.

I don't know what you mean "lvs directly from the command line". I never
noticed such messages from LVM commands ran from bash, dash. The only
other case I noticed is LVM under Midnight Commander. Midnight Commander
has this problem too. Hmm, I should report this problem on MC too :).

> Also note that anacron is not a long-running process, so even if there
> were a resource leak of some kind, it doesn't necessarily follow that
> that's a problem worth fixing.

Maybe you are right, but bugs should be fixed.

Ok, I will try to inspect this problem a bit deeper...

I ran the Anacron trough strace and after a short inspection of lvs
message and strace output I found one of leaked descriptors. The
following attached patch solves the message in the test case.

Unfortunately I'm afraid it is only a part :(.
But as I'm looking back on other leaked descriptors I originally
reported, these are probably inherited from parent processes of Anacron.

Can you accept the attached patch or rewrite it to your taste (maybe
report upstream)? I think, that after applying the fix this bug can be
closed. Other leaked descriptors should be reported to other packages.

Thanks for your time and work.

Best Regards
-- 
Zito
--- main.c.orig	2012-04-17 09:48:32.000000000 +0200
+++ main.c	2012-04-17 10:27:49.207407827 +0200
@@ -467,6 +467,7 @@
 
     record_start_time();
     read_tab(cwd);
+    if (close(cwd)) die_e("Can't close file descriptor %d", cwd);
     arrange_jobs();
 
     if (testing_only)

Reply via email to