* [PATCH] kbuild: fix segmentation fault in recursive dependency check
@ 2010-08-23 16:02 Arnaud Lacombe
2010-08-23 16:51 ` Sam Ravnborg
0 siblings, 1 reply; 3+ messages in thread
From: Arnaud Lacombe @ 2010-08-23 16:02 UTC (permalink / raw)
To: Michal Marek; +Cc: linux-kbuild, Arnaud Lacombe
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 2272 bytes --]
#0 sym_check_deps (sym=0xbb904c90) at scripts/kconfig/symbol.c:950
950 fprintf(stderr, "%s:%d:error: recursive dependency detected!\n",
(gdb) bt
#0 sym_check_deps (sym=0xbb904c90) at scripts/kconfig/symbol.c:950
#1 0x0804b4c2 in sym_check_expr_deps (e=0xbb5ec8e0) at scripts/kconfig/symbol.c:1007
#2 0x0804b549 in sym_check_sym_deps (sym=0xbb904c90) at scripts/kconfig/symbol.c:1032
#3 0x0804b950 in sym_check_deps (sym=0xbb904c90) at scripts/kconfig/symbol.c:1111
#4 0x0804b4c2 in sym_check_expr_deps (e=0xbb5e99a0) at scripts/kconfig/symbol.c:1007
#5 0x0804b50f in sym_check_sym_deps (sym=0xbb904d30) at scripts/kconfig/symbol.c:1024
#6 0x0804b950 in sym_check_deps (sym=0xbb904d30) at scripts/kconfig/symbol.c:1111
#7 0x0804b4c2 in sym_check_expr_deps (e=0xbb5f1840) at scripts/kconfig/symbol.c:1007
#8 0x0804b4a8 in sym_check_expr_deps (e=0xbb5f1830) at scripts/kconfig/symbol.c:994
#9 0x0804b549 in sym_check_sym_deps (sym=0xbb970240) at scripts/kconfig/symbol.c:1032
#10 0x0804b950 in sym_check_deps (sym=0xbb970240) at scripts/kconfig/symbol.c:1111
#11 0x08052e37 in conf_parse (name=0x804a09a "\203Ä\020¡\004z\005\b\205À\017\205É") at scripts/kconfig/zconf.tab.c:2244
#12 0x0804a09a in main (ac=3, av=0xbfbfe004) at scripts/kconfig/conf.c:505
In this case, `stack->prop' is NULL, but it may also end-up being NULL at the
end of the loop just before. Places the check before using `prop' to catch both
cases.
This fix `scripts/kconfig/conf' segmentation fault on SH as of v2.6.36-rc2 and
allow to fix the underlying issue.
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
---
scripts/kconfig/symbol.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index e95718f..0968f15 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -946,6 +946,13 @@ static void sym_check_print_recursive(struct symbol *last_sym)
break;
}
}
+
+ if (!prop) {
+ fprintf(stderr,
+ "unexpected recursive dependency error\n");
+ return;
+ }
+
if (stack->sym == last_sym)
fprintf(stderr, "%s:%d:error: recursive dependency detected!\n",
prop->file->name, prop->lineno);
--
1.7.2.30.gc37d7.dirty
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] kbuild: fix segmentation fault in recursive dependency check
2010-08-23 16:02 [PATCH] kbuild: fix segmentation fault in recursive dependency check Arnaud Lacombe
@ 2010-08-23 16:51 ` Sam Ravnborg
2010-08-23 17:02 ` Arnaud Lacombe
0 siblings, 1 reply; 3+ messages in thread
From: Sam Ravnborg @ 2010-08-23 16:51 UTC (permalink / raw)
To: Arnaud Lacombe; +Cc: Michal Marek, linux-kbuild
On Mon, Aug 23, 2010 at 12:02:55PM -0400, Arnaud Lacombe wrote:
> #0 sym_check_deps (sym=0xbb904c90) at scripts/kconfig/symbol.c:950
> 950 fprintf(stderr, "%s:%d:error: recursive dependency detected!\n",
> (gdb) bt
> #0 sym_check_deps (sym=0xbb904c90) at scripts/kconfig/symbol.c:950
> #1 0x0804b4c2 in sym_check_expr_deps (e=0xbb5ec8e0) at scripts/kconfig/symbol.c:1007
> #2 0x0804b549 in sym_check_sym_deps (sym=0xbb904c90) at scripts/kconfig/symbol.c:1032
> #3 0x0804b950 in sym_check_deps (sym=0xbb904c90) at scripts/kconfig/symbol.c:1111
> #4 0x0804b4c2 in sym_check_expr_deps (e=0xbb5e99a0) at scripts/kconfig/symbol.c:1007
> #5 0x0804b50f in sym_check_sym_deps (sym=0xbb904d30) at scripts/kconfig/symbol.c:1024
> #6 0x0804b950 in sym_check_deps (sym=0xbb904d30) at scripts/kconfig/symbol.c:1111
> #7 0x0804b4c2 in sym_check_expr_deps (e=0xbb5f1840) at scripts/kconfig/symbol.c:1007
> #8 0x0804b4a8 in sym_check_expr_deps (e=0xbb5f1830) at scripts/kconfig/symbol.c:994
> #9 0x0804b549 in sym_check_sym_deps (sym=0xbb970240) at scripts/kconfig/symbol.c:1032
> #10 0x0804b950 in sym_check_deps (sym=0xbb970240) at scripts/kconfig/symbol.c:1111
> #11 0x08052e37 in conf_parse (name=0x804a09a "\203?\020?\004z\005\b\205?\017\205?") at scripts/kconfig/zconf.tab.c:2244
> #12 0x0804a09a in main (ac=3, av=0xbfbfe004) at scripts/kconfig/conf.c:505
>
> In this case, `stack->prop' is NULL, but it may also end-up being NULL at the
> end of the loop just before. Places the check before using `prop' to catch both
> cases.
>
> This fix `scripts/kconfig/conf' segmentation fault on SH as of v2.6.36-rc2 and
> allow to fix the underlying issue.
Looks like the bug I fixed in another way:
See: http://git.kernel.org/?p=linux/kernel/git/mmarek/kbuild-2.6.git;a=commit;h=3643f849d7da5c12da589beb03c12303fe79b841
Or did you hit another bug so your patch is needed too?
Sam
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] kbuild: fix segmentation fault in recursive dependency check
2010-08-23 16:51 ` Sam Ravnborg
@ 2010-08-23 17:02 ` Arnaud Lacombe
0 siblings, 0 replies; 3+ messages in thread
From: Arnaud Lacombe @ 2010-08-23 17:02 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: Michal Marek, linux-kbuild
Hi,
On Mon, Aug 23, 2010 at 12:51 PM, Sam Ravnborg <sam@ravnborg.org> wrote:
> On Mon, Aug 23, 2010 at 12:02:55PM -0400, Arnaud Lacombe wrote:
>> #0 sym_check_deps (sym=0xbb904c90) at scripts/kconfig/symbol.c:950
>> 950 fprintf(stderr, "%s:%d:error: recursive dependency detected!\n",
>> (gdb) bt
>> #0 sym_check_deps (sym=0xbb904c90) at scripts/kconfig/symbol.c:950
>> #1 0x0804b4c2 in sym_check_expr_deps (e=0xbb5ec8e0) at scripts/kconfig/symbol.c:1007
>> #2 0x0804b549 in sym_check_sym_deps (sym=0xbb904c90) at scripts/kconfig/symbol.c:1032
>> #3 0x0804b950 in sym_check_deps (sym=0xbb904c90) at scripts/kconfig/symbol.c:1111
>> #4 0x0804b4c2 in sym_check_expr_deps (e=0xbb5e99a0) at scripts/kconfig/symbol.c:1007
>> #5 0x0804b50f in sym_check_sym_deps (sym=0xbb904d30) at scripts/kconfig/symbol.c:1024
>> #6 0x0804b950 in sym_check_deps (sym=0xbb904d30) at scripts/kconfig/symbol.c:1111
>> #7 0x0804b4c2 in sym_check_expr_deps (e=0xbb5f1840) at scripts/kconfig/symbol.c:1007
>> #8 0x0804b4a8 in sym_check_expr_deps (e=0xbb5f1830) at scripts/kconfig/symbol.c:994
>> #9 0x0804b549 in sym_check_sym_deps (sym=0xbb970240) at scripts/kconfig/symbol.c:1032
>> #10 0x0804b950 in sym_check_deps (sym=0xbb970240) at scripts/kconfig/symbol.c:1111
>> #11 0x08052e37 in conf_parse (name=0x804a09a "\203?\020?\004z\005\b\205?\017\205?") at scripts/kconfig/zconf.tab.c:2244
>> #12 0x0804a09a in main (ac=3, av=0xbfbfe004) at scripts/kconfig/conf.c:505
>>
>> In this case, `stack->prop' is NULL, but it may also end-up being NULL at the
>> end of the loop just before. Places the check before using `prop' to catch both
>> cases.
>>
>> This fix `scripts/kconfig/conf' segmentation fault on SH as of v2.6.36-rc2 and
>> allow to fix the underlying issue.
>
> Looks like the bug I fixed in another way:
> See: http://git.kernel.org/?p=linux/kernel/git/mmarek/kbuild-2.6.git;a=commit;h=3643f849d7da5c12da589beb03c12303fe79b841
>
> Or did you hit another bug so your patch is needed too?
>
definitively the same, sorry for the duplicate.
- Arnaud
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-08-23 17:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-23 16:02 [PATCH] kbuild: fix segmentation fault in recursive dependency check Arnaud Lacombe
2010-08-23 16:51 ` Sam Ravnborg
2010-08-23 17:02 ` Arnaud Lacombe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox