From: Khem Raj <raj.khem@gmail.com>
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 12:57:24 -0700 [thread overview]
Message-ID: <200903121257.36869.raj.khem@gmail.com> (raw)
In-Reply-To: <1236863674.6250.21.camel@northpole>
[-- Attachment #1: Type: text/plain, Size: 3177 bytes --]
On Thursday 12 March 2009 06:14:34 Jader wrote:
> 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:
How about using TemporaryFile () to create the file instead of mkstemp ?
we do not have to worry about cleaning it up once it is closed.
>
>
> 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
--
Khem Raj
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 204 bytes --]
next prev parent reply other threads:[~2009-03-12 19:57 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
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 [this message]
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=200903121257.36869.raj.khem@gmail.com \
--to=raj.khem@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox