Re: randconfig broken on choice

From: Matthieu CASTET
Date: Fri Sep 09 2011 - 05:04:29 EST


Hi Arnaud,

Arnaud Lacombe a écrit :
> Hi,
>
> On Tue, Sep 6, 2011 at 11:32 AM, Arnaud Lacombe <lacombar@xxxxxxxxx> wrote:
>> Hi,
>>
>> On Tue, Sep 6, 2011 at 11:13 AM, Matthieu CASTET
>> <matthieu.castet@xxxxxxxxxx> wrote:
>>> Hi,
>>>
>>> Arnaud Lacombe a écrit :
>>>> Hi,
>>>>
>> ok, I reproduced it with:
>>
>> while true; do
>> make randconfig
>> CONFIG_SLAB=; CONFIG_SLOB=; CONFIG_SLUB=
>> source .config
>> if [ "${CONFIG_SLAB}${CONFIG_SLOB}${CONFIG_SLUB}" != "y" ]; then
>> break
>> fi
>> sleep 1
>> done
>>
>> I wonder what set the flags originally...
>>
> This is interesting; I'm always getting the following:
>
> CONFIG_SLUB=y
> CONFIG_SLOB=y
>
> never CONFIG_SLAB and another one. Actually, the default of the choice
> ends up being selected along with the random one. Is this what you
> mean by "we don't take "sym->def[S_DEF_USER].tri" but the "default
> sym->cur.tri"" ?
Yes, what I mean is that we don't take the value set by randomize_choice_values,
but some default values.
I wonder why the other one is random (I don't search who set cur value).

You can see the problem with the attached patch

and do make randconfig | grep -e "SL[UAO]B,"


However, I do not see this behavior with the
> following reduced testcase:
>
>
Yes that's weird.

> Btw, you say that "we don't clean SYMBOL_VALID for choice entry", but
> AFAIU the code, we explicitly set the not-randomly-chosen choice value
> to 'no', so it's value should be valid.
>
I don't understand what you mean.

What I saw is that randomize_choice_values modify sym->def[S_DEF_USER],
but because it is already marked valid, we never use sym->def[S_DEF_USER] in the
code writing the .config.


Matthieu


diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index b633bdb..eecb7af 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -147,6 +147,9 @@ struct property *sym_get_env_prop(struct symbol *sym);

static inline tristate sym_get_tristate_value(struct symbol *sym)
{
+ printf("name %s, cur=%d(%s) user=%d(%s)\n", sym->name,
+ sym->curr.tri, sym->flags & SYMBOL_VALID?"valid":"invalid",
+ sym->def[S_DEF_USER].tri, sym->flags & SYMBOL_DEF_USER?"valid":"invalid");
return sym->curr.tri;
}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/