Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running kextract: kextract file couldn't be generated #243

Open
Yujie-Liu opened this issue Mar 22, 2024 · 3 comments
Open

Error running kextract: kextract file couldn't be generated #243

Yujie-Liu opened this issue Mar 22, 2024 · 3 comments

Comments

@Yujie-Liu
Copy link
Contributor

$ git clone https://github.com/intel/linux-intel-lts.git --branch 5.15/rpl/dev/linux --single-branch
$ cd linux-intel-lts
$ git checkout a140193717ce0fcf25eaa5a3d1b9ea874b9e5114
$ kismet -a powerpc
INFO: Computing the build system id for the Linux source..
INFO: Build system id: 0d5649df2bde
INFO: Kismet will analyze the select constructs of the architecture "powerpc" for unmet direct dependency.
INFO: All times reported are measured using Python's time.perf_counter() utility.
INFO: Prefetching the architecture kclause formulas.
ERROR:Arch(powerpc): Error running kextract: kextract file couldn't be generated.
Traceback (most recent call last):
  File "/env_kmax/bin/kismet", line 4, in <module>
    __import__('pkg_resources').run_script('kmax==4.5.2', 'kismet')
  File "/env_kmax/lib/python3.11/site-packages/pkg_resources/__init__.py", line 651, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/env_kmax/lib/python3.11/site-packages/pkg_resources/__init__.py", line 1448, in run_script
    exec(code, namespace, namespace)
  File "/env_kmax/lib/python3.11/site-packages/kmax-4.5.2-py3.11-linux-x86_64.egg/EGG-INFO/scripts/kismet", line 1086, in <module>
    main()
  File "/env_kmax/lib/python3.11/site-packages/kmax-4.5.2-py3.11-linux-x86_64.egg/EGG-INFO/scripts/kismet", line 426, in main
    if sample_models: arch.get_kextract() # for sampling
                      ^^^^^^^^^^^^^^^^^^^
  File "/env_kmax/lib/python3.11/site-packages/kmax-4.5.2-py3.11-linux-x86_64.egg/kmax/arch.py", line 582, in get_kextract
    self.__ensure_formulas(self.__kextract, self.__kextract_file_delayed_load, self.load_kextract, self.generate_kextract)
  File "/env_kmax/lib/python3.11/site-packages/kmax-4.5.2-py3.11-linux-x86_64.egg/kmax/arch.py", line 497, in __ensure_formulas
    formula_generation_method()
  File "/env_kmax/lib/python3.11/site-packages/kmax-4.5.2-py3.11-linux-x86_64.egg/kmax/arch.py", line 816, in generate_kextract
    raise Arch.KextractFormulaGenerationError()
kmax.arch.Arch.KextractFormulaGenerationError: kextract formulas couldn't be generated.
@paulgazz paulgazz self-assigned this Mar 22, 2024
@paulgazz paulgazz added the bug label Mar 22, 2024
@paulgazz
Copy link
Owner

paulgazz commented Mar 25, 2024

Hi @Yujie-Liu, thanks for reporting!

I believe this is not a bug in kismet itself, but an invalid Kconfig file that prevents it from being parsed. It seems that a powerpc Kconfig file at arch/powerpc/platforms/embedded6xx/Kconfig has a recursive dependency, which is prohibited by Kconfig. This prevents even configuring the kernel, e.g.,

git checkout a140193717ce0fcf25eaa5a3d1b9ea874b9e5114
make ARCH=powerpc defconfig

gives the following error:

*** Default configuration is based on 'ppc64_defconfig'
arch/powerpc/platforms/embedded6xx/Kconfig:2:error: recursive dependency detected!
arch/powerpc/platforms/embedded6xx/Kconfig:2:	symbol EMBEDDED6xx depends on BROKEN_ON_SMP
init/Kconfig:122:	symbol BROKEN_ON_SMP depends on BROKEN
init/Kconfig:119:	symbol BROKEN is selected by DRM_I915_DEBUG
drivers/gpu/drm/i915/Kconfig.debug:19:	symbol DRM_I915_DEBUG depends on DRM_I915
drivers/gpu/drm/i915/Kconfig:2:	symbol DRM_I915 depends on DRM
drivers/gpu/drm/Kconfig:8:	symbol DRM depends on AGP
drivers/char/agp/Kconfig:2:	symbol AGP depends on PCI
drivers/pci/Kconfig:16:	symbol PCI depends on HAVE_PCI
drivers/pci/Kconfig:7:	symbol HAVE_PCI is selected by FORCE_PCI
drivers/pci/Kconfig:11:	symbol FORCE_PCI is selected by MVME5100
arch/powerpc/platforms/embedded6xx/Kconfig:51:	symbol MVME5100 depends on EMBEDDED6xx
For a resolution refer to Documentation/kbuild/kconfig-language.rst
subsection "Kconfig recursive dependency limitations"

make[1]: *** [scripts/kconfig/Makefile:87: defconfig] Error 1
make: *** [Makefile:627: defconfig] Error 2

Note the "recursive dependency detected!" at the beginning. In contrast, running make ARCH=x86_64 defconfig seems to work fine.

Interestingly, this commit (a140193717ce0fcf25eaa5a3d1b9ea874b9e5114) reverts a previous commit (cea35f5ad5ffac06ea29e0d7a7f748683e1f1b7d) that fixed the recursive dependency error by removing the "select BROKEN" which caused the error.

There's nothing much kismet can do, since it uses Linux's own Kconfig parser, which won't process Kconfig files with recursive dependencies. Detecting it is pretty straightforward, since Linux's Kconfig tools will detect it whenever creating a configuration file, as in make ARCH=powerpc defconfig above.

Would it helpful for kismet to passthrough the Kconfig error?

@Yujie-Liu
Copy link
Contributor Author

@paulgazz Thanks for the detailed analysis!
Sometimes we get this "kextract file couldn't be generated" error in our CI but we are not sure about the root cause. It would be nice and helpful to passthrough the Kconfig error, so that we can detect such error in kismet output and make the kernel test robot skip the problematic commit which has an invalid Kconfig file.

@paulgazz
Copy link
Owner

Hi @Yujie-Liu. Got it! I'll improve this error reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants