All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sanity.bbclass: Reading /proc/sys/vm/mmap_min_addr is not permitted with 2.6.33+ on host
@ 2010-01-02 17:10 Martin Jansa
  2010-01-02 18:10 ` Phil Blundell
  0 siblings, 1 reply; 7+ messages in thread
From: Martin Jansa @ 2010-01-02 17:10 UTC (permalink / raw)
  To: openembedded-devel

* With 2.6.33-rc2-00252-ge9e5521 on my host I noticed that
  "cat /proc/sys/vm/mmap_min_addr" returns now
  "cat: /proc/sys/vm/mmap_min_addr: Operation not permitted"
  Its probably becuse of
  http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0e1a6ef2dea88101b056b6d9984f3325c5efced3
  But I'm not sure if checking CAP_SYS_RAWIO even for reading this value
  is intentional or just bug which should be fixed in kernel.

* This patch prints notice about need to check that value yourself (as
  root) instead of failing with "ERROR: IO Error: [Errno 1] Operation
  not permitted"

* Its not optimal, because this notice is shown every time you run
  bitbake (even after checking/setting 0 to mmap_min_addr if you have
  kernel not allowing to read it

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 classes/sanity.bbclass |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/classes/sanity.bbclass b/classes/sanity.bbclass
index f65df61..4f90975 100644
--- a/classes/sanity.bbclass
+++ b/classes/sanity.bbclass
@@ -97,10 +97,15 @@ def check_sanity(e):
 				messages = messages + "qemu-native was in ASSUME_PROVIDED but the QEMU binaries (qemu-arm) can't be found in PATH"
 
 		if os.path.exists("/proc/sys/vm/mmap_min_addr"):
-			f = file("/proc/sys/vm/mmap_min_addr", "r")
-			if (f.read().strip() != "0"):
-				messages = messages + "/proc/sys/vm/mmap_min_addr is not 0. This will cause problems with qemu so please fix the value (as root).\n\nTo fix this in later reboots, set vm.mmap_min_addr = 0 in /etc/sysctl.conf.\n"
-			f.close()
+			try:
+				f = file("/proc/sys/vm/mmap_min_addr", "r")
+				if (f.read().strip() != "0"):
+					messages = messages + "/proc/sys/vm/mmap_min_addr is not 0. This will cause problems with qemu so please fix the value (as root).\n\nTo fix this in later reboots, set vm.mmap_min_addr = 0 in /etc/sysctl.conf.\n"
+				f.close()
+			except:
+				import bb
+				bb.msg.note(1, bb.msg.domain.Parsing, "/proc/sys/vm/mmap_min_addr cannot be checked. This will cause problems with qemu if it is not set to 0, so please check the value (as root).\n\nTo fix this in later reboots, set vm.mmap_min_addr = 0 in /etc/sysctl.conf.\n")
+				
 
 	for util in required_utilities.split():
 		if not check_app_exists( util, e.data ):
-- 
1.6.6




^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] sanity.bbclass: Reading /proc/sys/vm/mmap_min_addr is not permitted with 2.6.33+ on host
  2010-01-02 17:10 [PATCH] sanity.bbclass: Reading /proc/sys/vm/mmap_min_addr is not permitted with 2.6.33+ on host Martin Jansa
@ 2010-01-02 18:10 ` Phil Blundell
  2010-01-03  0:53   ` Denys Dmytriyenko
  2010-01-03  7:00   ` [PATCH] sanity.bbclass: Reading /proc/sys/vm/mmap_min_addr " Martin Jansa
  0 siblings, 2 replies; 7+ messages in thread
From: Phil Blundell @ 2010-01-02 18:10 UTC (permalink / raw)
  To: openembedded-devel

On Sat, 2010-01-02 at 18:10 +0100, Martin Jansa wrote:
> * With 2.6.33-rc2-00252-ge9e5521 on my host I noticed that
>   "cat /proc/sys/vm/mmap_min_addr" returns now
>   "cat: /proc/sys/vm/mmap_min_addr: Operation not permitted"
>   Its probably becuse of
>   http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0e1a6ef2dea88101b056b6d9984f3325c5efced3
>   But I'm not sure if checking CAP_SYS_RAWIO even for reading this value
>   is intentional or just bug which should be fixed in kernel.
> 
> * This patch prints notice about need to check that value yourself (as
>   root) instead of failing with "ERROR: IO Error: [Errno 1] Operation
>   not permitted"
> 
> * Its not optimal, because this notice is shown every time you run
>   bitbake (even after checking/setting 0 to mmap_min_addr if you have
>   kernel not allowing to read it
> 

That does sound fairly unsatisfactory.  Printing a diagnostic on every
build, with no way for the user to suppress it, surely can't be the way
of the future.

If you can't tell whether mmap_min_addr is set correctly or not then it
would probably be better to not show the diagnostic at all.  Perhaps you
could investigate patching qemu to print a more meaningful message if it
actually encounters a mmap() failure of this kind.

p.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] sanity.bbclass: Reading /proc/sys/vm/mmap_min_addr is not permitted with 2.6.33+ on host
  2010-01-02 18:10 ` Phil Blundell
@ 2010-01-03  0:53   ` Denys Dmytriyenko
  2010-01-15 17:14     ` Marcin Juszkiewicz
  2010-01-03  7:00   ` [PATCH] sanity.bbclass: Reading /proc/sys/vm/mmap_min_addr " Martin Jansa
  1 sibling, 1 reply; 7+ messages in thread
From: Denys Dmytriyenko @ 2010-01-03  0:53 UTC (permalink / raw)
  To: openembedded-devel

On Sat, Jan 02, 2010 at 06:10:05PM +0000, Phil Blundell wrote:
> On Sat, 2010-01-02 at 18:10 +0100, Martin Jansa wrote:
> > * With 2.6.33-rc2-00252-ge9e5521 on my host I noticed that
> >   "cat /proc/sys/vm/mmap_min_addr" returns now
> >   "cat: /proc/sys/vm/mmap_min_addr: Operation not permitted"
> >   Its probably becuse of
> >   http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0e1a6ef2dea88101b056b6d9984f3325c5efced3
> >   But I'm not sure if checking CAP_SYS_RAWIO even for reading this value
> >   is intentional or just bug which should be fixed in kernel.
> > 
> > * This patch prints notice about need to check that value yourself (as
> >   root) instead of failing with "ERROR: IO Error: [Errno 1] Operation
> >   not permitted"
> > 
> > * Its not optimal, because this notice is shown every time you run
> >   bitbake (even after checking/setting 0 to mmap_min_addr if you have
> >   kernel not allowing to read it
> > 
> 
> That does sound fairly unsatisfactory.  Printing a diagnostic on every
> build, with no way for the user to suppress it, surely can't be the way
> of the future.
> 
> If you can't tell whether mmap_min_addr is set correctly or not then it
> would probably be better to not show the diagnostic at all.  Perhaps you
> could investigate patching qemu to print a more meaningful message if it
> actually encounters a mmap() failure of this kind.

BTW, wasn't the latest qemu "fixed" for this mmap() issue?

-- 
Denys



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] sanity.bbclass: Reading /proc/sys/vm/mmap_min_addr is not permitted with 2.6.33+ on host
  2010-01-02 18:10 ` Phil Blundell
  2010-01-03  0:53   ` Denys Dmytriyenko
@ 2010-01-03  7:00   ` Martin Jansa
  1 sibling, 0 replies; 7+ messages in thread
From: Martin Jansa @ 2010-01-03  7:00 UTC (permalink / raw)
  To: openembedded-devel

On Sat, Jan 02, 2010 at 06:10:05PM +0000, Phil Blundell wrote:
> On Sat, 2010-01-02 at 18:10 +0100, Martin Jansa wrote:
> > * With 2.6.33-rc2-00252-ge9e5521 on my host I noticed that
> >   "cat /proc/sys/vm/mmap_min_addr" returns now
> >   "cat: /proc/sys/vm/mmap_min_addr: Operation not permitted"
> >   Its probably becuse of
> >   http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0e1a6ef2dea88101b056b6d9984f3325c5efced3
> >   But I'm not sure if checking CAP_SYS_RAWIO even for reading this value
> >   is intentional or just bug which should be fixed in kernel.
> > 
> > * This patch prints notice about need to check that value yourself (as
> >   root) instead of failing with "ERROR: IO Error: [Errno 1] Operation
> >   not permitted"
> > 
> > * Its not optimal, because this notice is shown every time you run
> >   bitbake (even after checking/setting 0 to mmap_min_addr if you have
> >   kernel not allowing to read it
> > 
> 
> That does sound fairly unsatisfactory.  Printing a diagnostic on every
> build, with no way for the user to suppress it, surely can't be the way
> of the future.

Yes, agreed. I consider this only as temporary solution, because 
without this change I cannot use bitbake at all and of course I can
remove that message if this behavior stay the same in 2.6.33 release or
someone check qemu mmap failure.

That's why I didn't push it and just sent it here as heads up for
builders with 2.6.33-rc* to save tham few mins checking what happen to
bitbake.

> If you can't tell whether mmap_min_addr is set correctly or not then it
> would probably be better to not show the diagnostic at all.  Perhaps you
> could investigate patching qemu to print a more meaningful message if it
> actually encounters a mmap() failure of this kind.

Cheers,

-- 
uin:136542059                jid:Martin.Jansa@gmail.com
Jansa Martin                 sip:jamasip@voip.wengo.fr 
JaMa                         



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] sanity.bbclass: Reading /proc/sys/vm/mmap_min_addr is not permitted with 2.6.33+ on host
  2010-01-03  0:53   ` Denys Dmytriyenko
@ 2010-01-15 17:14     ` Marcin Juszkiewicz
  2010-01-15 18:56       ` [PATCH] sanity.bbclass: Reading?/proc/sys/vm/mmap_min_addr " Denys Dmytriyenko
  0 siblings, 1 reply; 7+ messages in thread
From: Marcin Juszkiewicz @ 2010-01-15 17:14 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: Text/Plain, Size: 508 bytes --]

Dnia niedziela, 3 stycznia 2010 o 01:53:09 Denys Dmytriyenko napisał(a):

> BTW, wasn't the latest qemu "fixed" for this mmap() issue?

It was. I am running qemu 0.12.1 on my Debian host without problem. Did not 
made recipe for it anyway.

Attached is cleaned version of Martin's patch which I use with stable/2009 and 
OE.dev branches. Please Ack it.

Regards, 
-- 
JID:      hrw@jabber.org
Website:  http://marcin.juszkiewicz.com.pl/
LinkedIn: http://www.linkedin.com/in/marcinjuszkiewicz

[-- Attachment #2: 0001-sanity.bbclass-handle-lack-of-permission-to-read-pro.patch --]
[-- Type: text/x-patch, Size: 2218 bytes --]

From 2c335c2bfba52b8a7672cec02159c9d8bba658a1 Mon Sep 17 00:00:00 2001
From: Martin Jansa <martin.jansa@gmail.com>
Date: Fri, 15 Jan 2010 18:10:29 +0100
Subject: [PATCH] sanity.bbclass: handle lack of permission to read /proc/sys/vm/mmap_min_addr

* With 2.6.33-rc2-00252-ge9e5521 on my host I noticed that
  "cat /proc/sys/vm/mmap_min_addr" returns now
  "cat: /proc/sys/vm/mmap_min_addr: Operation not permitted"
  Its probably becuse of
  http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0e1a6ef2dea88101b056b6d9984f3325c5efced3
  But I'm not sure if checking CAP_SYS_RAWIO even for reading this value
  is intentional or just bug which should be fixed in kernel.

This patch makes bitbake ignore reading error. Possible QEmu failure is not
handled yet.

Signed-off-by: Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
---
 classes/sanity.bbclass |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/classes/sanity.bbclass b/classes/sanity.bbclass
index f65df61..f57d8e4 100644
--- a/classes/sanity.bbclass
+++ b/classes/sanity.bbclass
@@ -96,11 +96,14 @@ def check_sanity(e):
 			if not check_app_exists("qemu-arm", e.data):
 				messages = messages + "qemu-native was in ASSUME_PROVIDED but the QEMU binaries (qemu-arm) can't be found in PATH"
 
-		if os.path.exists("/proc/sys/vm/mmap_min_addr"):
-			f = file("/proc/sys/vm/mmap_min_addr", "r")
-			if (f.read().strip() != "0"):
-				messages = messages + "/proc/sys/vm/mmap_min_addr is not 0. This will cause problems with qemu so please fix the value (as root).\n\nTo fix this in later reboots, set vm.mmap_min_addr = 0 in /etc/sysctl.conf.\n"
-			f.close()
+		try:
+			if os.path.exists("/proc/sys/vm/mmap_min_addr"):
+				f = file("/proc/sys/vm/mmap_min_addr", "r")
+				if (f.read().strip() != "0"):
+					messages = messages + "/proc/sys/vm/mmap_min_addr is not 0. This will cause problems with qemu so please fix the value (as root).\n\nTo fix this in later reboots, set vm.mmap_min_addr = 0 in /etc/sysctl.conf.\n"
+				f.close()
+		except:
+			pass
 
 	for util in required_utilities.split():
 		if not check_app_exists( util, e.data ):
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] sanity.bbclass: Reading?/proc/sys/vm/mmap_min_addr is not permitted with 2.6.33+ on host
  2010-01-15 17:14     ` Marcin Juszkiewicz
@ 2010-01-15 18:56       ` Denys Dmytriyenko
  2010-01-15 19:00         ` Marcin Juszkiewicz
  0 siblings, 1 reply; 7+ messages in thread
From: Denys Dmytriyenko @ 2010-01-15 18:56 UTC (permalink / raw)
  To: openembedded-devel

On Fri, Jan 15, 2010 at 06:14:10PM +0100, Marcin Juszkiewicz wrote:
> Dnia niedziela, 3 stycznia 2010 o 01:53:09 Denys Dmytriyenko napisa??(a):
> 
> > BTW, wasn't the latest qemu "fixed" for this mmap() issue?
> 
> It was. I am running qemu 0.12.1 on my Debian host without problem. Did not 
> made recipe for it anyway.
> 
> Attached is cleaned version of Martin's patch which I use with stable/2009 and 
> OE.dev branches. Please Ack it.

Is there any way to remove the check altogether? Are there any other issues, 
besides backward compatibility with older QEMU?

-- 
Denys


> Regards, 
> -- 
> JID:      hrw@jabber.org
> Website:  http://marcin.juszkiewicz.com.pl/
> LinkedIn: http://www.linkedin.com/in/marcinjuszkiewicz

> From 2c335c2bfba52b8a7672cec02159c9d8bba658a1 Mon Sep 17 00:00:00 2001
> From: Martin Jansa <martin.jansa@gmail.com>
> Date: Fri, 15 Jan 2010 18:10:29 +0100
> Subject: [PATCH] sanity.bbclass: handle lack of permission to read /proc/sys/vm/mmap_min_addr
> 
> * With 2.6.33-rc2-00252-ge9e5521 on my host I noticed that
>   "cat /proc/sys/vm/mmap_min_addr" returns now
>   "cat: /proc/sys/vm/mmap_min_addr: Operation not permitted"
>   Its probably becuse of
>   http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0e1a6ef2dea88101b056b6d9984f3325c5efced3
>   But I'm not sure if checking CAP_SYS_RAWIO even for reading this value
>   is intentional or just bug which should be fixed in kernel.
> 
> This patch makes bitbake ignore reading error. Possible QEmu failure is not
> handled yet.
> 
> Signed-off-by: Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
> ---
>  classes/sanity.bbclass |   13 ++++++++-----
>  1 files changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/classes/sanity.bbclass b/classes/sanity.bbclass
> index f65df61..f57d8e4 100644
> --- a/classes/sanity.bbclass
> +++ b/classes/sanity.bbclass
> @@ -96,11 +96,14 @@ def check_sanity(e):
>  			if not check_app_exists("qemu-arm", e.data):
>  				messages = messages + "qemu-native was in ASSUME_PROVIDED but the QEMU binaries (qemu-arm) can't be found in PATH"
>  
> -		if os.path.exists("/proc/sys/vm/mmap_min_addr"):
> -			f = file("/proc/sys/vm/mmap_min_addr", "r")
> -			if (f.read().strip() != "0"):
> -				messages = messages + "/proc/sys/vm/mmap_min_addr is not 0. This will cause problems with qemu so please fix the value (as root).\n\nTo fix this in later reboots, set vm.mmap_min_addr = 0 in /etc/sysctl.conf.\n"
> -			f.close()
> +		try:
> +			if os.path.exists("/proc/sys/vm/mmap_min_addr"):
> +				f = file("/proc/sys/vm/mmap_min_addr", "r")
> +				if (f.read().strip() != "0"):
> +					messages = messages + "/proc/sys/vm/mmap_min_addr is not 0. This will cause problems with qemu so please fix the value (as root).\n\nTo fix this in later reboots, set vm.mmap_min_addr = 0 in /etc/sysctl.conf.\n"
> +				f.close()
> +		except:
> +			pass
>  
>  	for util in required_utilities.split():
>  		if not check_app_exists( util, e.data ):
> -- 
> 1.6.6
> 

> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] sanity.bbclass: Reading?/proc/sys/vm/mmap_min_addr is not permitted with 2.6.33+ on host
  2010-01-15 18:56       ` [PATCH] sanity.bbclass: Reading?/proc/sys/vm/mmap_min_addr " Denys Dmytriyenko
@ 2010-01-15 19:00         ` Marcin Juszkiewicz
  0 siblings, 0 replies; 7+ messages in thread
From: Marcin Juszkiewicz @ 2010-01-15 19:00 UTC (permalink / raw)
  To: openembedded-devel

Dnia piątek, 15 stycznia 2010 o 19:56:39 Denys Dmytriyenko napisał(a):
> Is there any way to remove the check altogether? Are there any other
>  issues,  besides backward compatibility with older QEMU?
 
Fine for me.

Regards, 
-- 
JID:      hrw@jabber.org
Website:  http://marcin.juszkiewicz.com.pl/
LinkedIn: http://www.linkedin.com/in/marcinjuszkiewicz





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-01-15 19:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-02 17:10 [PATCH] sanity.bbclass: Reading /proc/sys/vm/mmap_min_addr is not permitted with 2.6.33+ on host Martin Jansa
2010-01-02 18:10 ` Phil Blundell
2010-01-03  0:53   ` Denys Dmytriyenko
2010-01-15 17:14     ` Marcin Juszkiewicz
2010-01-15 18:56       ` [PATCH] sanity.bbclass: Reading?/proc/sys/vm/mmap_min_addr " Denys Dmytriyenko
2010-01-15 19:00         ` Marcin Juszkiewicz
2010-01-03  7:00   ` [PATCH] sanity.bbclass: Reading /proc/sys/vm/mmap_min_addr " Martin Jansa

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.