From: Jader <jader@2mi.com.br>
To: openembedded-devel@lists.openembedded.org
Cc: openembedded-devel@openembedded.org
Subject: Re: Problem building kernel - too many files open
Date: Thu, 12 Mar 2009 10:14:34 -0300 [thread overview]
Message-ID: <1236863674.6250.21.camel@northpole> (raw)
In-Reply-To: <20090312085123.GD30336@ibawizard.net>
[-- Attachment #1: Type: text/plain, Size: 2798 bytes --]
Hello.
I had the same problem. It's inside classes/kernel.bbclass:298
(reproduced below):
python populate_packages_prepend () {
def extract_modinfo(file):
import tempfile, os, re
tempfile.tempdir = bb.data.getVar("WORKDIR", d, 1)
tmpfile = tempfile.mkstemp()[1]
cmd = "PATH=\"%s\" %sobjcopy -j .modinfo -O binary %s %s" % (bb.data.getVar("PATH", d, 1), bb.data.getVar("HOST_PREFIX", d, 1) or "", file, tmpfile)
os.system(cmd)
f = open(tmpfile)
l = f.read().split("\000")
f.close()
os.unlink(tmpfile)
tempfile.mkstemp() is used to create a temporary file. This function
return a tuple with an OS file descriptor and a filename. Filename is
stored in "tmpfile" but descriptor is not stored anywhere, but it is
still open because it's only an integer to python so it is not closed at
the end of the function.
For each iteration in which this function is called, a new OS file
descriptor is opened, but not closed. The solution is to store the file
descriptor and close it:
python populate_packages_prepend () {
def extract_modinfo(file):
import tempfile, os, re
tempfile.tempdir = bb.data.getVar("WORKDIR", d, 1)
tf = tempfile.mkstemp()
tmpfile = tf[1]
cmd = "PATH=\"%s\" %sobjcopy -j .modinfo -O binary %s %s" % (bb.data.getVar("PATH", d, 1), bb.data.getVar("HOST_PREFIX", d, 1) or "", file, tmpfile)
os.system(cmd)
f = open(tmpfile)
l = f.read().split("\000")
f.close()
os.close(tf[0])
os.unlink(tmpfile)
There's a patch attached. As Iḿ new to git, I don know it it was created
in the right way. Used command following:
git format-patch cab70860b89f0fd856c5de1c37c6a3d31fd3cc9d --stdout classes >kernel.bbclass.patch
Jader H. Silva
2MI Tecnologia
Em Qui, 2009-03-12 às 09:51 +0100, Petr Štetiar escreveu:
> Marco Cavallini <koansoftware@gmail.com> [2009-03-12 09:02:08]:
>
> > Piero Pezzin ha scritto:
>
> [...]
>
> > >>> During kernel building, I got the following error:
> > >>>
> > >>> OTE: package linux-2.6.28: started
> > >>> NOTE: package linux-2.6.28-r6: task do_package: started
> > >>> ERROR: Error in executing:
> > >>> /home/piero/work/qong-nobk/openembedded/openembedded/packages/linux/
> > >>> linux_2.6.28.bb
> > >>> ERROR: Exception:exceptions.IOError Message:[Errno 24] Too many open
> > >> files:
> >
> > this is a known error.
> > Nobody solved it yet.
>
> Maybe, that increasing the numbers of max. file handles and number of max.
> inodes might help you:
>
> /proc/sys/fs/file-max
> /proc/sys/fs/inode-max
>
> -- ynezz
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
[-- Attachment #2: kernel.bbclass.patch --]
[-- Type: text/x-patch, Size: 1074 bytes --]
From d74c9667b3cbc6a0631b5cda6e7ed7d1facd2fcb Mon Sep 17 00:00:00 2001
From: Jader H. Silva <vo@northpole.(none)>
Date: Thu, 12 Mar 2009 10:10:12 -0300
Subject: [PATCH] Kernel bbclass "too many open files" bugfix
---
classes/kernel.bbclass | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass
index 86f00da..4c1dbda 100644
--- a/classes/kernel.bbclass
+++ b/classes/kernel.bbclass
@@ -295,12 +295,14 @@ python populate_packages_prepend () {
def extract_modinfo(file):
import tempfile, os, re
tempfile.tempdir = bb.data.getVar("WORKDIR", d, 1)
- tmpfile = tempfile.mkstemp()[1]
+ tf = tempfile.mkstemp()
+ tmpfile = tf[1]
cmd = "PATH=\"%s\" %sobjcopy -j .modinfo -O binary %s %s" % (bb.data.getVar("PATH", d, 1), bb.data.getVar("HOST_PREFIX", d, 1) or "", file, tmpfile)
os.system(cmd)
f = open(tmpfile)
l = f.read().split("\000")
f.close()
+ os.close(tf[0])
os.unlink(tmpfile)
exp = re.compile("([^=]+)=(.*)")
vals = {}
--
1.5.6.3
next prev parent reply other threads:[~2009-03-12 13:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-10 14:33 Problem building kernel - too many files open Piero Pezzin
2009-03-10 18:22 ` Khem Raj
2009-03-11 8:49 ` Piero Pezzin
2009-03-12 8:02 ` Marco Cavallini
2009-03-12 8:51 ` Petr Štetiar
2009-03-12 13:14 ` Jader [this message]
2009-03-12 14:17 ` Piero Pezzin
2009-03-12 16:28 ` Marcin Juszkiewicz
2009-03-12 17:59 ` Chris Larson
2009-03-12 19:57 ` Khem Raj
2009-03-24 20:22 ` Jader H. Silva
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1236863674.6250.21.camel@northpole \
--to=jader@2mi.com.br \
--cc=openembedded-devel@lists.openembedded.org \
--cc=openembedded-devel@openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.