linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* randconfig broken on choice
@ 2011-09-06  8:52 Matthieu CASTET
  2011-09-06 15:04 ` Arnaud Lacombe
  0 siblings, 1 reply; 7+ messages in thread
From: Matthieu CASTET @ 2011-09-06  8:52 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org, linux-kbuild

[-- Attachment #1: Type: text/plain, Size: 394 bytes --]

Hi,

I am using v3.1-rc4 and make randconfig look broken for choice.
The choice config is always the same or choice entry can have more than one entry.


After some debugging, it seems in randomize_choice_values, we don't clean
SYMBOL_VALID for choice entry.
And we don't take "sym->def[S_DEF_USER].tri" but the "default sym->cur.tri".

The following patch seems to fix the problem.


Matthieu

[-- Attachment #2: randconfig.diff --]
[-- Type: text/x-diff, Size: 492 bytes --]

diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 59b667c..08331f8 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -1045,6 +1045,10 @@ static void randomize_choice_values(struct symbol *csym)
 		else {
 			sym->def[S_DEF_USER].tri = no;
 		}
+		sym->flags |= SYMBOL_DEF_USER;
+		/* clear VALID to get value calculated */
+		sym->flags &= ~(SYMBOL_VALID);
+
 	}
 	csym->flags |= SYMBOL_DEF_USER;
 	/* clear VALID to get value calculated */

^ permalink raw reply related	[flat|nested] 7+ messages in thread
* Re: randconfig broken on choice
@ 2011-10-20  9:25 Alexander Kriegisch
  0 siblings, 0 replies; 7+ messages in thread
From: Alexander Kriegisch @ 2011-10-20  9:25 UTC (permalink / raw)
  To: linux kbuild list; +Cc: Freetz Developers

Matthieu, Arnaud,

I wrote a shell script [1] which creates thousands or random configs in 
order to find and eliminate warnings in our configuration (missing 
dependencies etc.). We use this as a way of fuzzing, i.e. to perform 
heuristic tests because it is impossible to cover all combinations.

We use kconfig 3.1-rc9 in our project. First we had the problem Matthieu 
described for rc4, because the randconfigs only covered a small subset 
of possibilities due to its buggy handling of "choice" entries.

The good news is that Mattheiu's patch [2] effectively eliminated the 
problems, and we could successfully remove all inconsistencies in our 
configuration.

So I would like to push this patch. We would be happy to see it 
integrated upstream. Thanks! :-)

[1] http://freetz.org/browser/trunk/tools/developer/create-kconfig-warnings
[2] 
http://freetz.org/browser/trunk/tools/make/patches/340-fix_randconfig_choice.kconfig.patch
-- 
Alexander Kriegisch
http://freetz.org


> I am using v3.1-rc4 and make randconfig look broken for choice.
> The choice config is always the same or choice entry can have more than one entry.
>
> After some debugging, it seems in randomize_choice_values, we don't clean
> SYMBOL_VALID for choice entry.
> And we don't take "sym->def[S_DEF_USER].tri" but the "default sym->cur.tri".
>
> The following patch seems to fix the problem.
>
> Matthieu
>
>
> diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
> index 59b667c..08331f8 100644
> --- a/scripts/kconfig/confdata.c
> +++ b/scripts/kconfig/confdata.c
> @@ -1045,6 +1045,10 @@ static void randomize_choice_values(struct symbol *csym)
>  		else {
>  			sym->def[S_DEF_USER].tri = no;
>  		}
> +		sym->flags |= SYMBOL_DEF_USER;
> +		/* clear VALID to get value calculated */
> +		sym->flags &= ~(SYMBOL_VALID);
> +
>  	}
>  	csym->flags |= SYMBOL_DEF_USER;
>  	/* clear VALID to get value calculated */

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

end of thread, other threads:[~2011-10-20  9:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-06  8:52 randconfig broken on choice Matthieu CASTET
2011-09-06 15:04 ` Arnaud Lacombe
2011-09-06 15:13   ` Matthieu CASTET
2011-09-06 15:32     ` Arnaud Lacombe
2011-09-06 18:55       ` Arnaud Lacombe
2011-09-09  9:04         ` Matthieu CASTET
  -- strict thread matches above, loose matches on Subject: below --
2011-10-20  9:25 Alexander Kriegisch

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).