Re: randconfig broken on choice

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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! :-)

Alexander Kriegisch

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.


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 */
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at

[Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Free Online Dating]     [Linux Kernel]     [Linux SCSI]     [XFree86]

Add to Google Powered by Linux