All of lore.kernel.org
 help / color / mirror / Atom feed
* kbuild: Ctrl-C of parallel kernel build sometimes corrupts .o.cmd files permanently
@ 2021-06-02 15:50 Ingo Molnar
  2021-06-02 18:20 ` Masahiro Yamada
  0 siblings, 1 reply; 7+ messages in thread
From: Ingo Molnar @ 2021-06-02 15:50 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek; +Cc: linux-kernel


There's a sporadic kbuild bug that's been happening for years, maybe you 
guys can think of where it comes from.

Sometimes when I Ctrl-C a kernel build job, the .o.cmd file becomes 
corrupted and this breaks the build:


   kernel/.panic.o.cmd:5: *** unterminated call to function 'wildcard': missing ')'.  Stop.

   ...

   drivers/gpu/drm/.drm_blend.o.cmd:5: *** unterminated call to function 'wildcard': missing ')'.  Stop.

The file was just partially created and didn't get cleaned up:

  kepler:~/tip> ls -l drivers/gpu/drm/.drm_blend.o.cmd.corrupted drivers/gpu/drm/.drm_blend.o.cmd.good
  -rw-rw-r-- 1 mingo mingo 28672 Jun  2 17:46 drivers/gpu/drm/.drm_blend.o.cmd.corrupted
  -rw-rw-r-- 1 mingo mingo 51331 Jun  2 17:46 drivers/gpu/drm/.drm_blend.o.cmd.good

The file just got cut in half due to the Ctrl-C:

 --- drivers/gpu/drm/.drm_blend.o.cmd.corrupted  2021-06-02 17:46:16.951428326 +0200
 +++ drivers/gpu/drm/.drm_blend.o.cmd.good       2021-06-02 17:46:34.391111668 +0200
 @@ -646,4 +646,578 @@ deps_drivers/gpu/drm/drm_blend.o := \
      $(wildcard include/config/OF_OVERLAY) \
    include/linux/kobject.h \
      $(wildcard include/config/UEVENT_HELPER) \
 -    $(wildcard include
 \ No newline at end of file
 +    $(wildcard include/config/DEBUG_KOBJECT_RELEASE) \
 +  include/linux/sysfs.h \
 +  include/linux/kernfs.h \
 +    $(wildcard include/config/KERNFS) \


... but once in this state it can only be fixed by 'make clean' (which 
loses all build progress), or by removing the stale file manually.

It happens more frequently on systems with a lot of CPUs.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-06-12 13:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-02 15:50 kbuild: Ctrl-C of parallel kernel build sometimes corrupts .o.cmd files permanently Ingo Molnar
2021-06-02 18:20 ` Masahiro Yamada
2021-06-03 12:39   ` Ingo Molnar
2021-06-03 12:43     ` Ingo Molnar
2021-06-04  3:22       ` Masahiro Yamada
2021-06-09 13:59         ` Masahiro Yamada
2021-06-12 13:25           ` Ingo Molnar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.