<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>14136</bug_id>
          
          <creation_ts>2020-11-27 02:48:09 +0000</creation_ts>
          <short_desc>If u-boot defconfig is incomplete, &apos;bitbake u-boot -c configure&apos; hangs and eats all memory</short_desc>
          <delta_ts>2026-05-11 08:26:38 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>oe-core other</component>
          <version>3.3</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>IN PROGRESS DESIGN</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>6.1 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Vasyl">vvavrychuk</reporter>
          <assigned_to name="Unassigned">unassigned</assigned_to>
          <cc>akuster808</cc>
    
    <cc>akuster</cc>
    
    <cc>ccasciato</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>yoann.congal</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>88684</commentid>
    <comment_count>0</comment_count>
    <who name="Vasyl">vvavrychuk</who>
    <bug_when>2020-11-27 02:48:09 +0000</bug_when>
    <thetext>Steps to reproduce:

1. bitbake u-boot -c patch

2. In build/tmp/work/qemux86_64-poky-linux/u-boot/1_2020.10-r0/git/configs/qemu-x86_64_defconfig set CONFIG_DEBUG_UART_BASE to empty value:

     CONFIG_DEBUG_UART_BASE=

3. &apos;bitbake u-boot -c configure -f -v&apos; results in

+ make CROSS_COMPILE=x86_64-poky-linux- &apos;CC=x86_64-poky-linux-gcc  --sysroot=.../build/tmp/work/qemux86_64-poky-linux/u-boot/1_2020.10-r0/recipe-sysroot&apos; V=1 &apos;HOSTCC=gcc  -isystem.../build/tmp/work/qemux86_64-poky-linux/u-boot/1_2020.10-r0/recipe-sysroot-native/usr/include -O2 -pipe -L.../build/tmp/work/qemux86_64-poky-linux/u-boot/1_2020.10-r0/recipe-sysroot-native/usr/lib                         -L.../build/tmp/work/qemux86_64-poky-linux/u-boot/1_2020.10-r0/recipe-sysroot-native/lib                         -Wl,--enable-new-dtags                         -Wl,-rpath-link,.../build/tmp/work/qemux86_64-poky-linux/u-boot/1_2020.10-r0/recipe-sysroot-native/usr/lib                         -Wl,-rpath-link,.../build/tmp/work/qemux86_64-poky-linux/u-boot/1_2020.10-r0/recipe-sysroot-native/lib                         -Wl,-rpath,.../build/tmp/work/qemux86_64-poky-linux/u-boot/1_2020.10-r0/recipe-sysroot-native/usr/lib                         -Wl,-rpath,.../build/tmp/work/qemux86_64-poky-linux/u-boot/1_2020.10-r0/recipe-sysroot-native/lib                         -Wl,-O1 -Wl,--allow-shlib-undefined -Wl,--dynamic-linker=.../build/tmp/sysroots-uninative/x86_64-linux/lib/ld-linux-x86-64.so.2&apos; STAGING_INCDIR=.../build/tmp/work/qemux86_64-poky-linux/u-boot/1_2020.10-r0/recipe-sysroot-native/usr/include STAGING_LIBDIR=.../build/tmp/work/qemux86_64-poky-linux/u-boot/1_2020.10-r0/recipe-sysroot-native/usr/lib oldconfig

...

make -f .../build/tmp/work/qemux86_64-poky-linux/u-boot/1_2020.10-r0/git/scripts/Makefile.build obj=scripts/kconfig oldconfig

scripts/kconfig/conf  --oldconfig Kconfig

.config:49:warning: symbol value &apos;&apos; invalid for DEBUG_UART_BASE

*
* Restart config...
*
*
* Serial drivers
*
Default baudrate (BAUDRATE) [115200] 115200
Require a serial port for console (REQUIRE_SERIAL_CONSOLE) [Y/n/?] y
Specify the port number used for console (SPECIFY_CONSOLE_INDEX) [N/y/?] n
Provide a serial driver (SERIAL_PRESENT) [Y/n/?] y
Provide a serial driver in SPL (SPL_SERIAL_PRESENT) [Y/n/?] y
Enable Driver Model for serial drivers (DM_SERIAL) [Y/n/?] y
  Enable RX buffer for serial input (SERIAL_RX_BUFFER) [N/y/?] n
  Search for serial devices after default one failed (SERIAL_SEARCH_ALL) [N/y/?] n
  Enable Driver Model for serial drivers in SPL (SPL_DM_SERIAL) [Y/n/?] y
Enable an early debug UART for debugging (DEBUG_UART) [Y/n/?] y
  Select which UART will provide the debug UART
  &gt; 1. ns16550 (DEBUG_UART_NS16550)
  choice[1]: 1
  Base address of UART (DEBUG_UART_BASE) [] (NEW) 
  Base address of UART (DEBUG_UART_BASE) [] (NEW) 
  Base address of UART (DEBUG_UART_BASE) [] (NEW) 
  Base address of UART (DEBUG_UART_BASE) [] (NEW) 
...

Last line repeats forever until BitBake consumes all available memory.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88722</commentid>
    <comment_count>1</comment_count>
    <who name="Armin Kuster">akuster</who>
    <bug_when>2020-12-03 18:14:22 +0000</bug_when>
    <thetext>able to reproduce.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88724</commentid>
    <comment_count>2</comment_count>
    <who name="akuster">akuster808</who>
    <bug_when>2020-12-03 21:11:11 +0000</bug_when>
    <thetext>The issue is with make oldconfig. It is waiting for input to correct the missing information:

scripts/kconfig/conf  --oldconfig Kconfig
.config:49:warning: symbol value &apos;&apos; invalid for DEBUG_UART_BASE
*
* Restart config...
*
*
* Serial drivers
*
Default baudrate (BAUDRATE) [115200] 115200
Require a serial port for console (REQUIRE_SERIAL_CONSOLE) [Y/n/?] y
Specify the port number used for console (SPECIFY_CONSOLE_INDEX) [N/y/?] n
Provide a serial driver (SERIAL_PRESENT) [Y/n/?] y
Provide a serial driver in SPL (SPL_SERIAL_PRESENT) [Y/n/?] y
Enable Driver Model for serial drivers (DM_SERIAL) [Y/n/?] y
  Enable RX buffer for serial input (SERIAL_RX_BUFFER) [N/y/?] n
  Search for serial devices after default one failed (SERIAL_SEARCH_ALL) [N/y/?] n
  Enable Driver Model for serial drivers in SPL (SPL_DM_SERIAL) [Y/n/?] y
Enable an early debug UART for debugging (DEBUG_UART) [Y/n/?] y
  Select which UART will provide the debug UART
  &gt; 1. ns16550 (DEBUG_UART_NS16550)
  choice[1]: 1
  Base address of UART (DEBUG_UART_BASE) [] (NEW) 


and then the cycle of death starts.

I do see a warrning before we get to running the make oldconfig via &quot;cml1_do_configure&quot;

We need to parse the return from &quot;make qemu-x86_64_defconfig&quot; for &quot;symbol value &apos;&apos; invalid for&quot; and error out.

The kernel handles this situation so maybe they have ideas on how to do that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88727</commentid>
    <comment_count>3</comment_count>
    <who name="Vasyl">vvavrychuk</who>
    <bug_when>2020-12-07 08:18:54 +0000</bug_when>
    <thetext>In case of kernel there is a error print

Console input/output is redirected. Run &apos;make oldconfig&apos; to update configuration.

So probably fix can be on U-Boot Kconfig side.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90050</commentid>
    <comment_count>4</comment_count>
    <who name="akuster">akuster808</who>
    <bug_when>2021-04-22 14:30:12 +0000</bug_when>
    <thetext>not sure where to go from punting it back to unassigned.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96036</commentid>
    <comment_count>5</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2023-07-26 16:31:47 +0000</bug_when>
    <thetext>I&apos;ll look into this.

I can reproduce on poky master with the steps provided by the reporter.

I can also reproduce on u-boot master :

vim configs/qemu-x86_64_defconfig
# =&gt; CONFIG_DEBUG_UART_BASE=
cp configs/qemu-x86_64_defconfig .config
echo -n | make oldconfig
# loop forever

u-boot kconfig scripts come from Linux 4.20

Can&apos;t reproduce on Linux master (kconfig scripts have changed since 4.20)

It may be a case of updating kconfig in upstream u-boot. I&apos;ll poke around.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96115</commentid>
    <comment_count>6</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2023-07-27 09:09:26 +0000</bug_when>
    <thetext>I can reproduce it on Linux master! You only need a config entry of type hex that has no default value (Since i did not find such entry, I&apos;ve added it) :

config TEST_KCONFIG
	hex &quot;Test kconfig&quot;
	# No default value

* CONFIG_DEBUG_UART_BASE defined here https://github.com/u-boot/u-boot/blob/master/drivers/serial/Kconfig#L482
* default values are conditional (my guess is for qemux86_64, no condition match and we have no default value)
* If I understood correctly, in kconfig, the global default is the empty string which is not a valid value for the hex type
* during make oldconfig, the new value for CONFIG_DEBUG_UART_BASE is ask to the user via stdin
* stdin is closed and the default (empty string) is chosen, this value is not valid and the value of CONFIG_DEBUG_UART_BASE is asked again (hence the loop we see)

While a config of hex type without default value is not illegal in the kconfig language. It is not recommended :
** https://docs.zephyrproject.org/1.14.0/guides/kconfig/index.html#redundant-defaults : Defaults should always be given for int and hex symbols, however, as they implicitly default to the empty string. This is partly for compatibility with the C Kconfig tools, though an implicit 0 default might be less likely to be what was intended compared to other symbol types as well.

Ideas for a fix :
* Patching upstream kconfig scripts to fail when a value is asked on a closed stdin instead of looping (It looks like it was the case at some point, see Comment 3)
* Changing our u-boot:do_configure task to use make olddefconfig instead of oldconfig : Since we do not intend to interactively choose values for these config, explicitly choosing default values seem fair (?). By using olddefconfig, the default (and invalid) &quot;&quot; is used for the hex config and error will be most likely be caught at compile time.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96116</commentid>
    <comment_count>7</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2023-07-27 09:15:04 +0000</bug_when>
    <thetext>Note: kernel uses olddefconfig : https://git.yoctoproject.org/poky/tree/meta/classes-recipe/kernel.bbclass#n628</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96121</commentid>
    <comment_count>8</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2023-07-27 13:10:56 +0000</bug_when>
    <thetext>Even after searching for it in kernel tree, I could not find a hex config without default hex value. I guess that his is an untold rule (?).

As for U-boot, even if we don&apos;t use oldconfig, it uses syncconfig (really close to oldconfig) internally during compilation. So the loop still happens but later.

Where to go from here:
* Patch upstream kconfig script to abort on closed stdin instead of looping (in kernel tree which would be sync&apos;ed in u-boot some day)
* Patch upstream u-boot to give a default hex value to all hex config (This might be controversial)
* Switch all oldconfig usage in oe-core to olddefconfig : There are some in cml1.bbclass and u-boot recipe.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96130</commentid>
    <comment_count>9</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2023-07-27 15:51:31 +0000</bug_when>
    <thetext>From bug triage meeting 2023-07-27 :
* Contact upstream about this
* Start moving from oldconfig to olddefconfig. Let a way to override and keep the oldnoconfig for old kconfig (eg busybox). Note: use a function that the busybox can override/redefine after the &quot;inherit cml1&quot; (?)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96142</commentid>
    <comment_count>10</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2023-07-28 15:25:02 +0000</bug_when>
    <thetext>Upstream contacted : https://lore.kernel.org/linux-kbuild/387d7f82-aa8e-759f-7e12-08dfc329c47f@smile.fr/T/#u</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96345</commentid>
    <comment_count>11</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2023-09-05 16:41:56 +0000</bug_when>
    <thetext>Maybe related patch : https://lore.kernel.org/lkml/20230824004747.GC3913@google.com/T/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96401</commentid>
    <comment_count>12</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2023-09-12 15:54:10 +0000</bug_when>
    <thetext>Patch v3 sent to upstream kconfig maintainer (linux-kbuild)
https://lore.kernel.org/linux-kbuild/20230912154811.1338390-1-yoann.congal@smile.fr/T/#u</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96755</commentid>
    <comment_count>13</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2023-10-20 08:17:22 +0000</bug_when>
    <thetext>This bug was triggered by a coworker recently : He was playing with U-boot versions and defconfigs. The bug resulted in 28GB do_configure.log files -_-
I may need to find a proper workaround in Yocto before having the upstream trickle down to Yocto.

The proper path of the fix would be :
* fix it in Linux kbuild subsystem
* Port the fix in the kbuild in u-boot tree (either by updating it fully of backporting the patch)
* Update/backport the u-boot fix to the Yocto/u-boot recipe</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97201</commentid>
    <comment_count>14</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2023-11-04 22:31:15 +0000</bug_when>
    <thetext>Linux kbuild v5 patch sent : https://lore.kernel.org/linux-kbuild/20231104222715.3967791-1-yoann.congal@smile.fr/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97335</commentid>
    <comment_count>15</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2023-11-25 23:12:58 +0000</bug_when>
    <thetext>Patch from kbuild maintainer (more likely to be merged -_-&apos;)
https://lore.kernel.org/all/20231125163559.824210-2-masahiroy@kernel.org/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97619</commentid>
    <comment_count>16</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2023-12-19 07:00:58 +0000</bug_when>
    <thetext>Bumping target milestone to 5.0 M2</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97929</commentid>
    <comment_count>17</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2024-01-22 09:10:50 +0000</bug_when>
    <thetext>Upstream kbuild maintainer patch merged upstream https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6262afa10ef7cc8fdf39b81a36f9546b68810431 (in Linux v6.8-rc1)

He chose to have &quot;0&quot; as default value for int and &quot;0x0&quot; as default value for hex.

Next steps :
* Let&apos;s port this to u-boot and other kconfig users. This time having &quot;Submitted&quot; patches in OE-Core may be acceptable
* Start moving from oldconfig to olddefconfig. Let a way to override and keep the oldnoconfig for old kconfig (eg busybox). Note: use a function that the busybox can override/redefine after the &quot;inherit cml1&quot; (?)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97953</commentid>
    <comment_count>18</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2024-01-23 14:39:29 +0000</bug_when>
    <thetext>Bulk move to Milestone 5.0 M3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98270</commentid>
    <comment_count>19</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2024-02-22 16:23:32 +0000</bug_when>
    <thetext>Bulk move to 5.0 M4</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99002</commentid>
    <comment_count>20</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2024-05-13 08:10:29 +0000</bug_when>
    <thetext>U-boot maintainer rejected[0] the patch setting &quot;0x0&quot; as hex default (understandably, he&apos;d rather have a stuck build instead of a hard-to-debug runtime failure).

So we have Upstream(u-boot) disagreeing with Upstream&apos;s Upstream (Linux kconfig) :(

Maybe I need to go back to my initial Linux kconfig patch [1]: Make the config process exit on error instead of going into an infinite loop? (Beware, there was some valid reviews on this patch)

[0]: https://lists.denx.de/pipermail/u-boot/2024-May/553066.html
[1]: https://lore.kernel.org/all/20231031111647.111093-1-yoann.congal@smile.fr/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99708</commentid>
    <comment_count>21</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2024-09-24 14:48:46 +0000</bug_when>
    <thetext>Other idea is to add a config check step somewhere. Based on a tool like https://pypi.org/project/kconfiglib/?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100729</commentid>
    <comment_count>22</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2025-01-23 16:29:45 +0000</bug_when>
    <thetext>Discussed at bug triage today:
- Get Bruce&apos;s input on config handling
- Get back upstream with more ammunition to see if we can get a clean error exit on invalid config.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103193</commentid>
    <comment_count>23</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2025-11-06 10:57:03 +0000</bug_when>
    <thetext>Bulk move to 6.0 M1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104956</commentid>
    <comment_count>24</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2026-04-03 09:25:41 +0000</bug_when>
    <thetext>(Unassigning myself since a do not realistically have the time to work on this)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105397</commentid>
    <comment_count>25</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2026-05-11 08:26:38 +0000</bug_when>
    <thetext>[RFC v2 0/2] add kconfirm - Julian Braha
https://lore.kernel.org/rust-for-linux/20260509203808.1142311-1-julianbraha@gmail.com/

looks interesting to fix this issue</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>