Skip to contentSkip to conversation

Kconfig bug (optional choice deselected by following option)

U-Boot Mateusz Kulikowski 2 participants 4 messages Jan 17, 2016 Kbuild

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi all,

I have found weird feature of Kconfig.
If I misused something, please let me know - I found at least one place where the same error occurs.

Let's consider the following Kconfig (you can put it anywhere in the source tree):
<-------------- copy ----------------->
menu "Testmenu"
choice
prompt "Problem to solve"
optional
default n
help
Solve one of great world problems

config SOLVE_HUNGER
bool "Hunger"

config SOLVE_WARS
bool "Wars"

config CURE_CANCER
bool "Cancer"

endchoice

config TREES
default n
bool "Plant trees in garden"
endmenu

config BLAH
default n
bool "Totally unrelated option"

<------------- paste ------------------->

Now, select HUNGER important problem to solve; Warning - select it with space, _not_ enter + selection from list; Then select either TREES or BLAH.

Weird thing is - SOLVE_HUNGER is unselected.

It doesn't happen when you select (anything) by entering selection menu (i.e. enter). Even if you deselect option and then select it with space.

It happens both in menuconfig and nconfig.

It happens both in recent U-Boot b57843e6 and Linux kernel ece62678.

Unfortunately my knowledge of Kconfig is very limited so your help would be appreciated.

Best Regards,
Mateusz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJWm31YAAoJELvtohmVtQzB7dEH/0/9BMe6+Oq38UVSUcjmNzaH GqUdkK9MN9tYD6euHTcynlT0HZRkDTYCOFmQjG68Lj1Ejx0/Si2KYe6NKexvkysB HAshC0+rGkbOgW0fkBByL2HY8PGAxtNbSbcwzC7xnhRMCkiPp2xiMy1pwRSOI7tN dDzXEuuTvGxsGHUm8dSuxGE9Wd96MY71BDzO+vQrP+CiCV7IeKYMfiYhngN6FEBz Sq5YCljVsSIvsZuBIaJlPuU7vnS64x2RnxkPskln9k4M9gv6GQOAcRb+YZ0PKLOs qSdzBTvQsEMBdsJBk2nGgBIXUcFSPbAAQwl1FyepFlgm4d6152Wf9BQxFJBNij4= =zry6
-----END PGP SIGNATURE-----

#1 lore raw

Hi Mateusz,
(CCing linux-kbuild, which I think the best place to discuss this topic)

I think "default n" in the choice entry is weird
because the choice is not boolean.

Without it, the weird thing you saw did not happen on my box.

Anyway, I'd like Kconfig to say something if it is really a syntax error.

I hope comments from Kconfig experts.

2016-01-17 20:39 GMT+09:00 Mateusz Kulikowski <[email protected]>:

Quoted 72 lines

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi all,

I have found weird feature of Kconfig.
If I misused something, please let me know - I found at least one place where the same error occurs.

Let's consider the following Kconfig (you can put it anywhere in the source tree):
<-------------- copy ----------------->
menu "Testmenu"
choice
prompt "Problem to solve"
optional
default n
help
Solve one of great world problems

config SOLVE_HUNGER
bool "Hunger"

config SOLVE_WARS
bool "Wars"

config CURE_CANCER
bool "Cancer"

endchoice

config TREES
default n
bool "Plant trees in garden"
endmenu

config BLAH
default n
bool "Totally unrelated option"

<------------- paste ------------------->

Now, select HUNGER important problem to solve; Warning - select it with space, _not_ enter + selection from list; Then select either TREES or BLAH.

Weird thing is - SOLVE_HUNGER is unselected.

It doesn't happen when you select (anything) by entering selection menu (i.e. enter). Even if you deselect option and then select it with space.

It happens both in menuconfig and nconfig.

It happens both in recent U-Boot b57843e6 and Linux kernel ece62678.

Unfortunately my knowledge of Kconfig is very limited so your help would be appreciated.

Best Regards,
Mateusz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJWm31YAAoJELvtohmVtQzB7dEH/0/9BMe6+Oq38UVSUcjmNzaH GqUdkK9MN9tYD6euHTcynlT0HZRkDTYCOFmQjG68Lj1Ejx0/Si2KYe6NKexvkysB HAshC0+rGkbOgW0fkBByL2HY8PGAxtNbSbcwzC7xnhRMCkiPp2xiMy1pwRSOI7tN dDzXEuuTvGxsGHUm8dSuxGE9Wd96MY71BDzO+vQrP+CiCV7IeKYMfiYhngN6FEBz Sq5YCljVsSIvsZuBIaJlPuU7vnS64x2RnxkPskln9k4M9gv6GQOAcRb+YZ0PKLOs qSdzBTvQsEMBdsJBk2nGgBIXUcFSPbAAQwl1FyepFlgm4d6152Wf9BQxFJBNij4= =zry6
-----END PGP SIGNATURE-----
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Signature · 2 lines
Best Regards
Masahiro Yamada
#2 lore raw

I retract my previous replay.

With/without the "default n" in the choice menu,
I confirmed the problem happened (in the latest Linux as well as U-Boot).

I hope somebody follows up...

2016-01-18 5:29 GMT+09:00 Masahiro Yamada <[email protected]>:

Quoted 97 lines

Hi Mateusz,
(CCing linux-kbuild, which I think the best place to discuss this topic)

I think "default n" in the choice entry is weird
because the choice is not boolean.

Without it, the weird thing you saw did not happen on my box.

Anyway, I'd like Kconfig to say something if it is really a syntax error.

I hope comments from Kconfig experts.

2016-01-17 20:39 GMT+09:00 Mateusz Kulikowski <[email protected]>:

Quoted 60 lines

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi all,

I have found weird feature of Kconfig.
If I misused something, please let me know - I found at least one place where the same error occurs.

Let's consider the following Kconfig (you can put it anywhere in the source tree):
<-------------- copy ----------------->
menu "Testmenu"
choice
prompt "Problem to solve"
optional
default n
help
Solve one of great world problems

config SOLVE_HUNGER
bool "Hunger"

config SOLVE_WARS
bool "Wars"

config CURE_CANCER
bool "Cancer"

endchoice

config TREES
default n
bool "Plant trees in garden"
endmenu

config BLAH
default n
bool "Totally unrelated option"

<------------- paste ------------------->

Now, select HUNGER important problem to solve; Warning - select it with space, _not_ enter + selection from list; Then select either TREES or BLAH.

Weird thing is - SOLVE_HUNGER is unselected.

It doesn't happen when you select (anything) by entering selection menu (i.e. enter). Even if you deselect option and then select it with space.

It happens both in menuconfig and nconfig.

It happens both in recent U-Boot b57843e6 and Linux kernel ece62678.

Unfortunately my knowledge of Kconfig is very limited so your help would be appreciated.

Best Regards,
Mateusz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

Quoted 12 lines

iQEcBAEBCAAGBQJWm31YAAoJELvtohmVtQzB7dEH/0/9BMe6+Oq38UVSUcjmNzaH GqUdkK9MN9tYD6euHTcynlT0HZRkDTYCOFmQjG68Lj1Ejx0/Si2KYe6NKexvkysB HAshC0+rGkbOgW0fkBByL2HY8PGAxtNbSbcwzC7xnhRMCkiPp2xiMy1pwRSOI7tN dDzXEuuTvGxsGHUm8dSuxGE9Wd96MY71BDzO+vQrP+CiCV7IeKYMfiYhngN6FEBz Sq5YCljVsSIvsZuBIaJlPuU7vnS64x2RnxkPskln9k4M9gv6GQOAcRb+YZ0PKLOs qSdzBTvQsEMBdsJBk2nGgBIXUcFSPbAAQwl1FyepFlgm4d6152Wf9BQxFJBNij4= =zry6
-----END PGP SIGNATURE-----
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

--
Best Regards
Masahiro Yamada

Signature · 2 lines
Best Regards
Masahiro Yamada
#3 lore raw
In reply to Masahiro Yamada

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi All,

Just a small update from my side;

I used bisect-foo and offending commit (@Linux) seems to be:

commit 5d09598d488f081e3be23f885ed65cbbe2d073b5

Author: Arnaud Lacombe <[email protected]>
Date:   Mon Jan 23 17:29:05 2012 -0500

kconfig: fix new choices being skipped upon config update

Best Regards,
Mateusz

Quoted 65 lines · Masahiro Yamada

Hi Mateusz,
(CCing linux-kbuild, which I think the best place to discuss this topic)

I think "default n" in the choice entry is weird
because the choice is not boolean.

Without it, the weird thing you saw did not happen on my box.

Anyway, I'd like Kconfig to say something if it is really a syntax error.

I hope comments from Kconfig experts.

2016-01-17 20:39 GMT+09:00 Mateusz Kulikowski <[email protected]>:
Hi all,

I have found weird feature of Kconfig.
If I misused something, please let me know - I found at least one place where the same error occurs.

Let's consider the following Kconfig (you can put it anywhere in the source tree):
<-------------- copy ----------------->
menu "Testmenu"
choice
prompt "Problem to solve"
optional
default n
help
Solve one of great world problems

config SOLVE_HUNGER
bool "Hunger"

config SOLVE_WARS
bool "Wars"

config CURE_CANCER
bool "Cancer"

endchoice

config TREES
default n
bool "Plant trees in garden"
endmenu

config BLAH
default n
bool "Totally unrelated option"

<------------- paste ------------------->

Now, select HUNGER important problem to solve; Warning - select it with space, _not_ enter + selection from list; Then select either TREES or BLAH.

Weird thing is - SOLVE_HUNGER is unselected.

It doesn't happen when you select (anything) by entering selection menu (i.e. enter). Even if you deselect option and then select it with space.

Quoted 15 lines

It happens both in menuconfig and nconfig.

It happens both in recent U-Boot b57843e6 and Linux kernel ece62678.

Unfortunately my knowledge of Kconfig is very limited so your help would be appreciated.

Best Regards,
Mateusz

Quoted 4 lines

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJWnAQpAAoJELvtohmVtQzBqrwH/1joRyZ2wuuTEtaJG9due3IM Wf0sHphYkTWdfi4kxRPZRwH57bvdLjtb3BWxDKtze+luoYB6M5dFUFk5SUzcDREI /+bddYKcLwkSDc73t/HiA/4U3hqma9jXIo1bLoP9vtlvcIQpaITcqnOxB4tS2kBm 7qOOuLOoa3qQhh5ZhBH3eE4sx+C2sFnYnHKzkTrMO0CkE3YfEt0ZQXJYrIPyaWea UDtK6W7rRoq/7RXGw2Xw8gblk2P60wGK1lBOrEWGY46zufHfyUP4MUzYe2vbwW2i mThLtcySF5+ty6NGBs/gIatrSGfgdomBgm6MzJlgQ4EabaGj4ugsY8yFtNJKFPI= =idim
-----END PGP SIGNATURE-----