linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [mmotm:master 251/287] lib/test-string_helpers.c:293:1: warning: the frame size of 1316 bytes is larger than 1024 bytes
@ 2014-08-29 23:28 kbuild test robot
  2014-09-03 22:26 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: kbuild test robot @ 2014-08-29 23:28 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Linux Memory Management List, Andrew Morton, Johannes Weiner,
	kbuild-all

tree:   git://git.cmpxchg.org/linux-mmotm.git master
head:   8f1fc64dc9b39fedb7390e086001ce5ec327e80d
commit: 626105764fd29c75bd8b01d36b54d0aaca61ac36 [251/287] lib / string_helpers: introduce string_escape_mem()
config: make ARCH=i386 allyesconfig

All warnings:

   lib/test-string_helpers.c: In function 'test_string_escape':
>> lib/test-string_helpers.c:293:1: warning: the frame size of 1316 bytes is larger than 1024 bytes [-Wframe-larger-than=]
    }
    ^

vim +293 lib/test-string_helpers.c

   277				continue;
   278	
   279			/* Copy string to in buffer */
   280			len = strlen(s2->in);
   281			memcpy(&in[p], s2->in, len);
   282			p += len;
   283	
   284			/* Copy expected result for given flags */
   285			len = strlen(out);
   286			memcpy(&out_test[q_test], out, len);
   287			q_test += len;
   288		}
   289	
   290		q_real = string_escape_mem(in, p, &buf, q_real, flags, esc);
   291	
   292		test_string_check_buf(name, flags, in, p, out_real, q_real, out_test, q_test);
 > 293	}
   294	
   295	static __init void test_string_escape_nomem(void)
   296	{
   297		char *in = "\eb \\C\007\"\x90\r]";
   298		char out[64], *buf = out;
   299		int rc = -ENOMEM, ret;
   300	
   301		ret = string_escape_str_any_np(in, &buf, strlen(in), NULL);

---
0-DAY kernel build testing backend              Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild                 Intel Corporation

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [mmotm:master 251/287] lib/test-string_helpers.c:293:1: warning: the frame size of 1316 bytes is larger than 1024 bytes
  2014-08-29 23:28 [mmotm:master 251/287] lib/test-string_helpers.c:293:1: warning: the frame size of 1316 bytes is larger than 1024 bytes kbuild test robot
@ 2014-09-03 22:26 ` Andrew Morton
  2014-09-04  9:19   ` Andy Shevchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2014-09-03 22:26 UTC (permalink / raw)
  To: kbuild test robot
  Cc: Andy Shevchenko, Linux Memory Management List, Johannes Weiner,
	kbuild-all

On Sat, 30 Aug 2014 07:28:12 +0800 kbuild test robot <fengguang.wu@intel.com> wrote:

> tree:   git://git.cmpxchg.org/linux-mmotm.git master
> head:   8f1fc64dc9b39fedb7390e086001ce5ec327e80d
> commit: 626105764fd29c75bd8b01d36b54d0aaca61ac36 [251/287] lib / string_helpers: introduce string_escape_mem()
> config: make ARCH=i386 allyesconfig
> 
> All warnings:
> 
>    lib/test-string_helpers.c: In function 'test_string_escape':
> >> lib/test-string_helpers.c:293:1: warning: the frame size of 1316 bytes is larger than 1024 bytes [-Wframe-larger-than=]
>     }

1k isn't excessive for an __init function but I guess we should fix it
to avoid drawing attention to ourselves.

Andy, please review, test, etc?


I figure the out-of-memory warning means we don't need a warning
printk.  It won't happen anyway.


--- a/lib/test-string_helpers.c~lib-string_helpers-introduce-string_escape_mem-fix
+++ a/lib/test-string_helpers.c
@@ -5,6 +5,7 @@
 
 #include <linux/init.h>
 #include <linux/kernel.h>
+#include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/random.h>
 #include <linux/string.h>
@@ -62,10 +63,14 @@ static const struct test_string strings[
 static void __init test_string_unescape(const char *name, unsigned int flags,
 					bool inplace)
 {
-	char in[256];
-	char out_test[256];
-	char out_real[256];
-	int i, p = 0, q_test = 0, q_real = sizeof(out_real);
+	int q_real = 256;
+	char *in = kmalloc(q_real, GFP_KERNEL);
+	char *out_test = kmalloc(q_real, GFP_KERNEL);
+	char *out_real = kmalloc(q_real, GFP_KERNEL);
+	int i, p = 0, q_test = 0;
+
+	if (!in || !out_test || !out_real)
+		goto out;
 
 	for (i = 0; i < ARRAY_SIZE(strings); i++) {
 		const char *s = strings[i].in;
@@ -100,6 +105,10 @@ static void __init test_string_unescape(
 
 	test_string_check_buf(name, flags, in, p - 1, out_real, q_real,
 			      out_test, q_test);
+out:
+	kfree(out_real);
+	kfree(out_test);
+	kfree(in);
 }
 
 struct test_string_1 {
@@ -255,10 +264,15 @@ static __init void test_string_escape(co
 				      const struct test_string_2 *s2,
 				      unsigned int flags, const char *esc)
 {
-	char in[256];
-	char out_test[512];
-	char out_real[512], *buf = out_real;
-	int p = 0, q_test = 0, q_real = sizeof(out_real);
+	int q_real = 512;
+	char *out_test = kmalloc(q_real, GFP_KERNEL);
+	char *out_real = kmalloc(q_real, GFP_KERNEL);
+	char *in = kmalloc(256, GFP_KERNEL);
+	char *buf = out_real;
+	int p = 0, q_test = 0;
+
+	if (!out_test || !out_real || !in)
+		goto out;
 
 	for (; s2->in; s2++) {
 		const char *out;
@@ -289,7 +303,12 @@ static __init void test_string_escape(co
 
 	q_real = string_escape_mem(in, p, &buf, q_real, flags, esc);
 
-	test_string_check_buf(name, flags, in, p, out_real, q_real, out_test, q_test);
+	test_string_check_buf(name, flags, in, p, out_real, q_real, out_test,
+			      q_test);
+out:
+	kfree(in);
+	kfree(out_real);
+	kfree(out_test);
 }
 
 static __init void test_string_escape_nomem(void)
_

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [mmotm:master 251/287] lib/test-string_helpers.c:293:1: warning: the frame size of 1316 bytes is larger than 1024 bytes
  2014-09-03 22:26 ` Andrew Morton
@ 2014-09-04  9:19   ` Andy Shevchenko
  0 siblings, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2014-09-04  9:19 UTC (permalink / raw)
  To: Andrew Morton
  Cc: kbuild test robot, Linux Memory Management List, Johannes Weiner,
	kbuild-all

On Wed, 2014-09-03 at 15:26 -0700, Andrew Morton wrote:
> On Sat, 30 Aug 2014 07:28:12 +0800 kbuild test robot <fengguang.wu@intel.com> wrote:
> 
> > tree:   git://git.cmpxchg.org/linux-mmotm.git master
> > head:   8f1fc64dc9b39fedb7390e086001ce5ec327e80d
> > commit: 626105764fd29c75bd8b01d36b54d0aaca61ac36 [251/287] lib / string_helpers: introduce string_escape_mem()
> > config: make ARCH=i386 allyesconfig
> > 
> > All warnings:
> > 
> >    lib/test-string_helpers.c: In function 'test_string_escape':
> > >> lib/test-string_helpers.c:293:1: warning: the frame size of 1316 bytes is larger than 1024 bytes [-Wframe-larger-than=]
> >     }
> 
> 1k isn't excessive for an __init function but I guess we should fix it
> to avoid drawing attention to ourselves.
> 
> Andy, please review, test, etc?

Sorry, living in the other timezone :-)

Now confirm it works. Compiled and real run testing.

Thanks for fixes!

> 
> 
> I figure the out-of-memory warning means we don't need a warning
> printk.  It won't happen anyway.
> 
> 
> --- a/lib/test-string_helpers.c~lib-string_helpers-introduce-string_escape_mem-fix
> +++ a/lib/test-string_helpers.c
> @@ -5,6 +5,7 @@
>  
>  #include <linux/init.h>
>  #include <linux/kernel.h>
> +#include <linux/slab.h>
>  #include <linux/module.h>
>  #include <linux/random.h>
>  #include <linux/string.h>
> @@ -62,10 +63,14 @@ static const struct test_string strings[
>  static void __init test_string_unescape(const char *name, unsigned int flags,
>  					bool inplace)
>  {
> -	char in[256];
> -	char out_test[256];
> -	char out_real[256];
> -	int i, p = 0, q_test = 0, q_real = sizeof(out_real);
> +	int q_real = 256;
> +	char *in = kmalloc(q_real, GFP_KERNEL);
> +	char *out_test = kmalloc(q_real, GFP_KERNEL);
> +	char *out_real = kmalloc(q_real, GFP_KERNEL);
> +	int i, p = 0, q_test = 0;
> +
> +	if (!in || !out_test || !out_real)
> +		goto out;
>  
>  	for (i = 0; i < ARRAY_SIZE(strings); i++) {
>  		const char *s = strings[i].in;
> @@ -100,6 +105,10 @@ static void __init test_string_unescape(
>  
>  	test_string_check_buf(name, flags, in, p - 1, out_real, q_real,
>  			      out_test, q_test);
> +out:
> +	kfree(out_real);
> +	kfree(out_test);
> +	kfree(in);
>  }
>  
>  struct test_string_1 {
> @@ -255,10 +264,15 @@ static __init void test_string_escape(co
>  				      const struct test_string_2 *s2,
>  				      unsigned int flags, const char *esc)
>  {
> -	char in[256];
> -	char out_test[512];
> -	char out_real[512], *buf = out_real;
> -	int p = 0, q_test = 0, q_real = sizeof(out_real);
> +	int q_real = 512;
> +	char *out_test = kmalloc(q_real, GFP_KERNEL);
> +	char *out_real = kmalloc(q_real, GFP_KERNEL);
> +	char *in = kmalloc(256, GFP_KERNEL);
> +	char *buf = out_real;
> +	int p = 0, q_test = 0;
> +
> +	if (!out_test || !out_real || !in)
> +		goto out;
>  
>  	for (; s2->in; s2++) {
>  		const char *out;
> @@ -289,7 +303,12 @@ static __init void test_string_escape(co
>  
>  	q_real = string_escape_mem(in, p, &buf, q_real, flags, esc);
>  
> -	test_string_check_buf(name, flags, in, p, out_real, q_real, out_test, q_test);
> +	test_string_check_buf(name, flags, in, p, out_real, q_real, out_test,
> +			      q_test);
> +out:
> +	kfree(in);
> +	kfree(out_real);
> +	kfree(out_test);
>  }
>  
>  static __init void test_string_escape_nomem(void)
> _
> 


-- 
Andy Shevchenko <andriy.shevchenko@intel.com>
Intel Finland Oy

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2014-09-04  9:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-29 23:28 [mmotm:master 251/287] lib/test-string_helpers.c:293:1: warning: the frame size of 1316 bytes is larger than 1024 bytes kbuild test robot
2014-09-03 22:26 ` Andrew Morton
2014-09-04  9:19   ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).