<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/scripts/kconfig/tests/err_recursive_dep, branch v6.12.80</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-07-20T07:33:45+00:00</updated>
<entry>
<title>kconfig: recursive checks drop file/lineno</title>
<updated>2024-07-20T07:33:45+00:00</updated>
<author>
<name>HONG Yifan</name>
<email>elsk@google.com</email>
</author>
<published>2024-07-17T01:50:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9d0d266046571f4b3e733c7eb9cf7c959f37fbdd'/>
<id>urn:sha1:9d0d266046571f4b3e733c7eb9cf7c959f37fbdd</id>
<content type='text'>
This prevents segfault when getting filename and lineno in recursive
checks.

If the following snippet is found in Kconfig:

[Test code 1]

config FOO
        bool
        depends on BAR
        select BAR

... without BAR defined; then there is a segfault.

  Kconfig:34:error: recursive dependency detected!
  Kconfig:34:	symbol FOO depends on BAR
  make[4]: *** [scripts/kconfig/Makefile:85: allnoconfig] Segmentation fault

This is because of the following. BAR is a fake entry created by
sym_lookup() with prop being NULL. In the recursive check, there is a
NULL check for prop to fall back to stack-&gt;sym-&gt;prop if stack-&gt;prop is
NULL. However, in this case, stack-&gt;sym points to the fake BAR entry
created by sym_lookup(), so prop is still NULL. prop was then referenced
without additional NULL checks, causing segfault.

As the previous email thread suggests, the file and lineno for select is
also wrong:

[Test code 2]

config FOO
       bool

config BAR
       bool

config FOO
       bool "FOO"
       depends on BAR
       select BAR

  $ make defconfig
  *** Default configuration is based on 'x86_64_defconfig'
  Kconfig:1:error: recursive dependency detected!
  Kconfig:1: symbol FOO depends on BAR
  Kconfig:4: symbol BAR is selected by FOO
  [...]

Kconfig:4 should be Kconfig:10.

This patch deletes the wrong and segfault-prone filename/lineno
inference completely. With this patch, Test code 1 yields:

error: recursive dependency detected!
	symbol FOO depends on BAR
	symbol BAR is selected by FOO

Signed-off-by: HONG Yifan &lt;elsk@google.com&gt;
Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</content>
</entry>
<entry>
<title>kconfig: print recursive dependency errors in the parsed order</title>
<updated>2024-02-20T11:47:45+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2024-02-11T12:41:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cc25cfc563adc48c84f1eec6432b369bcab73ca6'/>
<id>urn:sha1:cc25cfc563adc48c84f1eec6432b369bcab73ca6</id>
<content type='text'>
for_all_symbols() iterates in the symbol hash table. The order of
iteration depends on the hash table implementation.

If you use it for printing errors, they are shown in random order.

For example, the order of following test input and the corresponding
error do not match:
 - scripts/kconfig/tests/err_recursive_dep/Kconfig
 - scripts/kconfig/tests/err_recursive_dep/expected_stderr

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</content>
</entry>
<entry>
<title>docs: kbuild: convert docs to ReST and rename to *.rst</title>
<updated>2019-06-14T20:21:21+00:00</updated>
<author>
<name>Mauro Carvalho Chehab</name>
<email>mchehab+samsung@kernel.org</email>
</author>
<published>2019-06-12T17:52:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cd238effefa28fac177e51dcf5e9d1a8b59c3c6b'/>
<id>urn:sha1:cd238effefa28fac177e51dcf5e9d1a8b59c3c6b</id>
<content type='text'>
The kbuild documentation clearly shows that the documents
there are written at different times: some use markdown,
some use their own peculiar logic to split sections.

Convert everything to ReST without affecting too much
the author's style and avoiding adding uneeded markups.

The conversion is actually:
  - add blank lines and identation in order to identify paragraphs;
  - fix tables markups;
  - add some lists markups;
  - mark literal blocks;
  - adjust title markups.

At its new index.rst, let's add a :orphan: while this is not linked to
the main index.rst file, in order to avoid build warnings.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab+samsung@kernel.org&gt;
Signed-off-by: Jonathan Corbet &lt;corbet@lwn.net&gt;
</content>
</entry>
<entry>
<title>kconfig: improve the recursive dependency report</title>
<updated>2018-08-22T14:21:39+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2018-08-15T05:59:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f498926c47aa7d4f1b6d08af2ba16f3cf8fcb151'/>
<id>urn:sha1:f498926c47aa7d4f1b6d08af2ba16f3cf8fcb151</id>
<content type='text'>
This commit improves the messages of the recursive dependency.
Currently, sym-&gt;dir_dep.expr is not checked.  Hence, any dependency
in property visibility is regarded as the dependency of the symbol.

[Test Code 1]

  config A
          bool "a"
          depends on B

  config B
          bool "b"
          depends on A

[Test Code 2]

  config A
          bool "a" if B

  config B
          bool "b"
          depends on A

For both cases above, the same message is displayed:

        symbol B depends on A
        symbol A depends on B

This commit changes the message for the latter, like this:

        symbol B depends on A
        symbol A prompt is visible depending on B

Also, 'select' and 'imply' are distinguished.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Tested-by: Dirk Gouders &lt;dirk@gouders.net&gt;
</content>
</entry>
<entry>
<title>kconfig: report recursive dependency involving 'imply'</title>
<updated>2018-08-22T14:21:39+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2018-08-15T05:59:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5e8c5299d31519e0327be1020f309fa62dc53036'/>
<id>urn:sha1:5e8c5299d31519e0327be1020f309fa62dc53036</id>
<content type='text'>
Currently, Kconfig does not complain about the recursive dependency
where 'imply' keywords are involved.

[Test Code]

  config A
          bool "a"

  config B
          bool "b"
          imply A
          depends on A

In the code above, Kconfig cannot calculate the symbol values correctly
due to the circular dependency.  For example, allyesconfig followed by
syncconfig results in an odd behavior because CONFIG_B becomes visible
in syncconfig.

  $ make allyesconfig
  scripts/kconfig/conf  --allyesconfig Kconfig
  #
  # configuration written to .config
  #
  $ cat .config
  #
  # Automatically generated file; DO NOT EDIT.
  # Main menu
  #
  CONFIG_A=y
  $ make syncconfig
  scripts/kconfig/conf  --syncconfig Kconfig
  *
  * Restart config...
  *
  *
  * Main menu
  *
  a (A) [Y/n/?] y
    b (B) [N/y/?] (NEW)

To detect this correctly, sym_check_expr_deps() should recurse to
not only sym-&gt;rev_dep.expr but also sym-&gt;implied.expr .

At this moment, sym_check_print_recursive() cannot distinguish
'select' and 'imply' since it does not know the precise context
where the recursive dependency has been hit.  This will be solved
by the next commit.

In fact, even the document and the unit-test are confused.  Using
'imply' does not solve recursive dependency since 'imply' addresses
the unmet direct dependency, which 'select' could cause.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Tested-by: Dirk Gouders &lt;dirk@gouders.net&gt;
</content>
</entry>
<entry>
<title>kconfig: error out when seeing recursive dependency</title>
<updated>2018-08-22T14:21:38+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2018-08-15T05:59:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f1575595d15657bd78c139978107deabec5a3959'/>
<id>urn:sha1:f1575595d15657bd78c139978107deabec5a3959</id>
<content type='text'>
Originally, recursive dependency was a fatal error for Kconfig
because Kconfig cannot compute symbol values in such a situation.

Commit d595cea62403 ("kconfig: print more info when we see a recursive
dependency") changed it to a warning, which I guess was not intentional.

Get it back to an error again.

Also, rename the unit test directory "warn_recursive_dep" to
"err_recursive_dep" so that it matches to the behavior.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Tested-by: Dirk Gouders &lt;dirk@gouders.net&gt;
</content>
</entry>
</feed>
