Error during Make in Ubuntu 5.3.0-28

15 views
Skip to first unread message

Choon Gay Lee

unread,
Feb 4, 2020, 11:23:57 PM2/4/20
to kedr-discuss
Hi, Eugene.

My system is "Linux ubuntu 5.3.0-28-generic #30~18.04.1-Ubuntu SMP Fri Jan 17 06:14:09 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux".

And below is the error log when running make.

Thank you.

ubuntu@ubuntu:/tmp/kedr-build$ make
Scanning dependencies of target kedr
[  1%] Generating kedr_module.c
[  1%] Generating kedr_base.c
[  2%] Generating kedr_instrumentor.c
[  2%] Generating kedr_functions_support.c
[  3%] Generating kedr_target_detector.c
[  4%] Generating arch/x86/lib/inat.c
[  4%] Generating arch/x86/lib/insn.c
[  5%] Generating arch/x86/lib/inat-tables.h
[  5%] Building kernel module kedr
In file included from /tmp/kedr-build/core/arch/x86/lib/inat.c:24:0:
/tmp/kedr-build/core/arch/x86/lib/inat-tables.h:989:19: warning: duplicate ‘const’ declaration specifier [-Wduplicate-decl-specifier]
 const insn_attr_t const *inat_escape_tables[INAT_ESC_MAX + 1][INAT_LSTPFX_MAX + 1] = {
                   ^~~~~
/tmp/kedr-build/core/arch/x86/lib/inat-tables.h:1002:19: warning: duplicate ‘const’ declaration specifier [-Wduplicate-decl-specifier]
 const insn_attr_t const *inat_group_tables[INAT_GRP_MAX + 1][INAT_LSTPFX_MAX + 1] = {
                   ^~~~~
/tmp/kedr-build/core/arch/x86/lib/inat-tables.h:1023:19: warning: duplicate ‘const’ declaration specifier [-Wduplicate-decl-specifier]
 const insn_attr_t const *inat_avx_tables[X86_VEX_M_MAX + 1][INAT_LSTPFX_MAX + 1] = {
                   ^~~~~
[  5%] Built target kedr
Scanning dependencies of target kedr_fault_simulation
[  6%] Generating fault_simulation_module.c
[  6%] Generating control_file.c
[  6%] Building kernel module kedr_fault_simulation
[  6%] Built target kedr_fault_simulation
Scanning dependencies of target kedr_fsim_cmm
[  6%] Generating alloc_pages_exact_impl.data
[  7%] Generating header_impl.data
[  8%] Generating __kmalloc_impl.data
[  8%] Generating krealloc_impl.data
[  9%] Generating __krealloc_impl.data
[  9%] Generating kmem_cache_alloc_impl.data
[ 10%] Generating kmem_cache_alloc_trace_impl.data
[ 11%] Generating __kmalloc_node_impl.data
[ 11%] Generating kmem_cache_alloc_node_impl.data
[ 12%] Generating kmem_cache_alloc_node_trace_impl.data
[ 12%] Generating kmalloc_order_trace_impl.data
[ 13%] Generating __get_free_pages_impl.data
[ 13%] Generating get_zeroed_page_impl.data
[ 14%] Generating __alloc_pages_nodemask_impl.data
[ 15%] Generating alloc_pages_current_impl.data
[ 15%] Generating payload.data
[ 16%] Generating payload_with_caller_address.data
[ 17%] Generating payload.c
[ 17%] Generating functions_support.c
[ 17%] Building kernel module kedr_fsim_cmm
[ 17%] Built target kedr_fsim_cmm
Scanning dependencies of target kedr_fsim_uaccess
[ 17%] Generating memdup_user_impl.data
[ 18%] Generating header_impl.data
[ 18%] Generating _copy_to_user_impl.data
[ 19%] Generating _copy_from_user_impl.data
[ 20%] Generating strndup_user_impl.data
[ 20%] Generating payload.data
[ 21%] Generating payload_with_caller_address.data
[ 22%] Generating payload.c
[ 22%] Generating functions_support.c
[ 23%] Building kernel module kedr_fsim_uaccess
[ 23%] Built target kedr_fsim_uaccess
Scanning dependencies of target kedr_fsim_capable
[ 24%] Generating capable_impl.data
[ 25%] Generating header_impl.data
[ 25%] Generating payload.data
[ 26%] Generating payload_with_caller_address.data
[ 27%] Generating payload.c
[ 27%] Generating functions_support.c
[ 28%] Building kernel module kedr_fsim_capable
[ 28%] Built target kedr_fsim_capable
Scanning dependencies of target kedr_fsim_mem_util
[ 28%] Generating __posix_acl_chmod_impl.data
[ 28%] Generating header_impl.data
[ 29%] Generating kstrdup_impl.data
[ 29%] Generating kstrndup_impl.data
[ 30%] Generating kmemdup_impl.data
[ 30%] Generating posix_acl_alloc_impl.data
[ 31%] Generating posix_acl_from_mode_impl.data
[ 32%] Generating posix_acl_from_xattr_impl.data
[ 32%] Generating match_strdup_impl.data
[ 33%] Generating __posix_acl_create_impl.data
[ 34%] Generating payload.data
[ 35%] Generating payload_with_caller_address.data
[ 36%] Generating payload.c
[ 36%] Generating functions_support.c
[ 36%] Building kernel module kedr_fsim_mem_util
[ 36%] Built target kedr_fsim_mem_util
Scanning dependencies of target kedr_fsim_vmm
[ 36%] Generating vzalloc_node_impl.data
[ 37%] Generating header_impl.data
[ 37%] Generating vmalloc_impl.data
[ 38%] Generating __vmalloc_impl.data
[ 38%] Generating vmalloc_user_impl.data
[ 39%] Generating vmalloc_node_impl.data
[ 40%] Generating vmalloc_32_impl.data
[ 40%] Generating vmalloc_32_user_impl.data
[ 41%] Generating vzalloc_impl.data
[ 41%] Generating payload.data
[ 42%] Generating payload_with_caller_address.data
[ 42%] Generating payload.c
[ 43%] Generating functions_support.c
[ 44%] Building kernel module kedr_fsim_vmm
[ 44%] Built target kedr_fsim_vmm
Scanning dependencies of target kedr_fsim_indicator_kmalloc
[ 45%] Generating indicator_with_caller_address.data
[ 46%] Generating indicator_internal.data
[ 46%] Generating indicator.c
[ 47%] Generating calculator.c
[ 47%] Generating control_file.c
[ 48%] Building kernel module kedr_fsim_indicator_kmalloc
[ 48%] Built target kedr_fsim_indicator_kmalloc
Scanning dependencies of target kedr_fsim_indicator_capable
[ 49%] Generating indicator_with_caller_address.data
[ 49%] Generating indicator_internal.data
[ 49%] Generating indicator.c
[ 50%] Generating calculator.c
[ 51%] Generating control_file.c
[ 52%] Building kernel module kedr_fsim_indicator_capable
[ 52%] Built target kedr_fsim_indicator_capable
Scanning dependencies of target kedr_fsim_indicator_common
[ 52%] Generating indicator_with_caller_address.data
[ 53%] Generating indicator_internal.data
[ 54%] Generating indicator.c
[ 54%] Generating calculator.c
[ 55%] Generating control_file.c
[ 55%] Building kernel module kedr_fsim_indicator_common
[ 55%] Built target kedr_fsim_indicator_common
Scanning dependencies of target kedr_leak_check
[ 55%] Generating leak_check.c
[ 56%] Generating klc_output.c
[ 56%] Generating stack_trace.c
[ 57%] Building kernel module kedr_leak_check
/tmp/kedr-build/leak_check/core/stack_trace.c: In function ‘kedr_save_stack_trace’:
/tmp/kedr-build/leak_check/core/stack_trace.c:99:2: error: variable ‘trace’ has initializer but incomplete type
  stack_trace_impl_t trace = {
  ^~~~~~~~~~~~~~~~~~
/tmp/kedr-build/leak_check/core/stack_trace.c:100:4: error: ‘stack_trace_impl_t {aka struct stack_trace}’ has no member named ‘nr_entries’
   .nr_entries = 0,
    ^~~~~~~~~~
/tmp/kedr-build/leak_check/core/stack_trace.c:100:17: warning: excess elements in struct initializer
   .nr_entries = 0,
                 ^
/tmp/kedr-build/leak_check/core/stack_trace.c:100:17: note: (near initialization for ‘trace’)
/tmp/kedr-build/leak_check/core/stack_trace.c:101:4: error: ‘stack_trace_impl_t {aka struct stack_trace}’ has no member named ‘entries’
   .entries = &stack_entries[0],
    ^~~~~~~
/tmp/kedr-build/leak_check/core/stack_trace.c:101:14: warning: excess elements in struct initializer
   .entries = &stack_entries[0],
              ^
/tmp/kedr-build/leak_check/core/stack_trace.c:101:14: note: (near initialization for ‘trace’)
/tmp/kedr-build/leak_check/core/stack_trace.c:104:4: error: ‘stack_trace_impl_t {aka struct stack_trace}’ has no member named ‘max_entries’
   .max_entries = KEDR_NUM_FRAMES_INTERNAL,
    ^~~~~~~~~~~
In file included from /tmp/kedr-build/leak_check/core/stack_trace.c:20:0:
/tmp/kedr-src/sources/include/kedr/util/stack_trace.h:27:5: warning: excess elements in struct initializer
     ((KEDR_MAX_FRAMES + KEDR_LOWER_FRAMES + 15) & ~15)
     ^
/tmp/kedr-build/leak_check/core/stack_trace.c:104:18: note: in expansion of macro ‘KEDR_NUM_FRAMES_INTERNAL’
   .max_entries = KEDR_NUM_FRAMES_INTERNAL,
                  ^~~~~~~~~~~~~~~~~~~~~~~~
/tmp/kedr-src/sources/include/kedr/util/stack_trace.h:27:5: note: (near initialization for ‘trace’)
     ((KEDR_MAX_FRAMES + KEDR_LOWER_FRAMES + 15) & ~15)
     ^
/tmp/kedr-build/leak_check/core/stack_trace.c:104:18: note: in expansion of macro ‘KEDR_NUM_FRAMES_INTERNAL’
   .max_entries = KEDR_NUM_FRAMES_INTERNAL,
                  ^~~~~~~~~~~~~~~~~~~~~~~~
/tmp/kedr-build/leak_check/core/stack_trace.c:107:4: error: ‘stack_trace_impl_t {aka struct stack_trace}’ has no member named ‘skip’
   .skip = 0
    ^~~~
/tmp/kedr-build/leak_check/core/stack_trace.c:107:11: warning: excess elements in struct initializer
   .skip = 0
           ^
/tmp/kedr-build/leak_check/core/stack_trace.c:107:11: note: (near initialization for ‘trace’)
/tmp/kedr-build/leak_check/core/stack_trace.c:99:21: error: storage size of ‘trace’ isn’t known
  stack_trace_impl_t trace = {
                     ^~~~~
/tmp/kedr-build/leak_check/core/stack_trace.c:31:31: error: implicit declaration of function ‘save_stack_trace’; did you mean ‘kedr_save_stack_trace’? [-Werror=implicit-function-declaration]
 #define save_stack_trace_impl save_stack_trace
                               ^
/tmp/kedr-build/leak_check/core/stack_trace.c:119:2: note: in expansion of macro ‘save_stack_trace_impl’
  save_stack_trace_impl(&trace);
  ^~~~~~~~~~~~~~~~~~~~~
/tmp/kedr-build/leak_check/core/stack_trace.c:99:21: warning: unused variable ‘trace’ [-Wunused-variable]
  stack_trace_impl_t trace = {
                     ^~~~~
cc1: some warnings being treated as errors
scripts/Makefile.build:288: recipe for target '/tmp/kedr-build/leak_check/core/stack_trace.o' failed
make[4]: *** [/tmp/kedr-build/leak_check/core/stack_trace.o] Error 1
Makefile:1655: recipe for target '_module_/tmp/kedr-build/leak_check/core' failed
make[3]: *** [_module_/tmp/kedr-build/leak_check/core] Error 2
leak_check/core/CMakeFiles/kedr_leak_check.dir/build.make:67: recipe for target 'leak_check/core/kedr_leak_check.ko' failed
make[2]: *** [leak_check/core/kedr_leak_check.ko] Error 2
CMakeFiles/Makefile2:1076: recipe for target 'leak_check/core/CMakeFiles/kedr_leak_check.dir/all' failed
make[1]: *** [leak_check/core/CMakeFiles/kedr_leak_check.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2

Evgenii Shatokhin

unread,
Feb 5, 2020, 5:49:45 AM2/5/20
to Choon Gay Lee, kedr-d...@googlegroups.com
Hi,

On 05.02.2020 7:23, Choon Gay Lee wrote:
> Hi, Eugene.
>
> My system is "Linux ubuntu 5.3.0-28-generic #30~18.04.1-Ubuntu SMP Fri
> Jan 17 06:14:09 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux".
>
> And below is the error log when running make.

The error might be due to the changes made to stack trace API in the
kernel 5.2.x, if I am not mistaken.

I'll take a closer look.
Regards,
Evgenii
Message has been deleted

Choon Gay Lee

unread,
Feb 6, 2020, 4:27:37 AM2/6/20
to kedr-discuss
Hi, Eugene.

Thank you very much.

Evgenii Shatokhin

unread,
Feb 10, 2020, 4:04:54 AM2/10/20
to Choon Gay Lee, kedr-d...@googlegroups.com
Hi,

I pushed the fix to the git repo:
https://github.com/euspectre/kedr/commit/31e086a38f29505f94cde214a61186b31e1581e7
along with prerequisites and a few other changes. It seems to work in
Ubuntu with the kernel 5.3.0-28-generic.

Please check if KEDR sources from git
(https://github.com/euspectre/kedr.git) build and work in your setup as
well.
---------------

An unrelated note.

Although KEDR tools may still be useful if you need to analyze a
particular module rather than the whole kernel, their niche seems rather
small now.

A number of other tools and technologies have been developed/enhanced in
the recent years, which might be superior:

* Ftrace, perf and BPF-based tools for monitoring and tracing;
* Kmemleak for memory leaks;
* KASan to detect incorrect memory accesses;
* KCSan to detect concurrency issues.

As for fault injection, the in-kernel implementation is still limited.
But if someone enhances it with, say, BPF to manage when and how to
inject failures in the kernel, it will become on par with KEDR's fault
simulation, at least.

Hope this helps.

Regards,
Evgenii

Choon Gay Lee

unread,
Feb 10, 2020, 6:07:08 AM2/10/20
to kedr-discuss

Hi, Eugene.

The problem is solved now.
And I will take a look on your recommendation.

Thank you very much.
Reply all
Reply to author
Forward
0 new messages