From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com
Subject: lib/tests/stacktrace_kunit.c:13:16: error: variable 'trace' has initializer but incomplete type
Date: Tue, 25 Aug 2026 17:15:40 +0800 [thread overview]
Message-ID: <202608251703.x4npy956-lkp@intel.com> (raw)
::::::
:::::: Manual check reason: "bisect to a FBC not belonging to original linux-review patches: branch: linux-review/Bill-Wendling/stacktrace-Add-__counted_by_ptr-attribute-to-struct-stack_trace/20260823-123532, commit: 2f587ab333d26b331b33c137ec41b057e470e4e6"
::::::
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Bill Wendling <morbo@google.com>
CC: 0day robot <lkp@intel.com>
tree: https://github.com/intel-lab-lkp/linux/commits/Bill-Wendling/stacktrace-Add-__counted_by_ptr-attribute-to-struct-stack_trace/20260823-123532
head: 2f587ab333d26b331b33c137ec41b057e470e4e6
commit: 2f587ab333d26b331b33c137ec41b057e470e4e6 lib/tests: Add KUnit test for struct stack_trace __counted_by_ptr attribute
date: 23 hours ago
:::::: branch date: 23 hours ago
:::::: commit date: 23 hours ago
config: nios2-allmodconfig (https://download.01.org/0day-ci/archive/20260825/202608251703.x4npy956-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 11.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260825/202608251703.x4npy956-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202608251703.x4npy956-lkp@intel.com/
All error/warnings (new ones prefixed by >>):
lib/tests/stacktrace_kunit.c: In function 'test_stack_trace_counted_by':
>> lib/tests/stacktrace_kunit.c:13:16: error: variable 'trace' has initializer but incomplete type
13 | struct stack_trace trace = {
| ^~~~~~~~~~~
>> lib/tests/stacktrace_kunit.c:14:18: error: 'struct stack_trace' has no member named 'entries'
14 | .entries = entries_buf,
| ^~~~~~~
>> lib/tests/stacktrace_kunit.c:14:28: warning: excess elements in struct initializer
14 | .entries = entries_buf,
| ^~~~~~~~~~~
lib/tests/stacktrace_kunit.c:14:28: note: (near initialization for 'trace')
>> lib/tests/stacktrace_kunit.c:15:18: error: 'struct stack_trace' has no member named 'max_entries'
15 | .max_entries = 4,
| ^~~~~~~~~~~
lib/tests/stacktrace_kunit.c:15:32: warning: excess elements in struct initializer
15 | .max_entries = 4,
| ^
lib/tests/stacktrace_kunit.c:15:32: note: (near initialization for 'trace')
>> lib/tests/stacktrace_kunit.c:13:28: error: storage size of 'trace' isn't known
13 | struct stack_trace trace = {
| ^~~~~
In file included from include/linux/err.h:5,
from include/kunit/assert.h:12,
from include/kunit/test.h:12,
from lib/tests/stacktrace_kunit.c:6:
>> include/kunit/test.h:1060:42: warning: comparison between pointer and integer
1060 | left, ==, right, \
| ^~
include/linux/compiler.h:76:45: note: in definition of macro 'likely'
76 | # define likely(x) __builtin_expect(!!(x), 1)
| ^
include/kunit/test.h:885:9: note: in expansion of macro 'KUNIT_BASE_BINARY_ASSERTION'
885 | KUNIT_BASE_BINARY_ASSERTION(test, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:1058:9: note: in expansion of macro 'KUNIT_BINARY_PTR_ASSERTION'
1058 | KUNIT_BINARY_PTR_ASSERTION(test, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:1055:9: note: in expansion of macro 'KUNIT_EXPECT_PTR_EQ_MSG'
1055 | KUNIT_EXPECT_PTR_EQ_MSG(test, left, right, NULL)
| ^~~~~~~~~~~~~~~~~~~~~~~
lib/tests/stacktrace_kunit.c:19:9: note: in expansion of macro 'KUNIT_EXPECT_PTR_EQ'
19 | KUNIT_EXPECT_PTR_EQ(test, trace.entries, (unsigned long *)entries_buf);
| ^~~~~~~~~~~~~~~~~~~
In file included from lib/tests/stacktrace_kunit.c:6:
>> include/kunit/test.h:857:55: warning: initialization of 'const void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
857 | .left_value = __left, \
| ^~~~~~
include/kunit/test.h:735:49: note: in definition of macro '_KUNIT_FAILED'
735 | const struct assert_class __assertion = INITIALIZER; \
| ^~~~~~~~~~~
include/kunit/test.h:856:23: note: in expansion of macro 'KUNIT_INIT_ASSERT'
856 | KUNIT_INIT_ASSERT(.text = &__text, \
| ^~~~~~~~~~~~~~~~~
include/kunit/test.h:885:9: note: in expansion of macro 'KUNIT_BASE_BINARY_ASSERTION'
885 | KUNIT_BASE_BINARY_ASSERTION(test, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:1058:9: note: in expansion of macro 'KUNIT_BINARY_PTR_ASSERTION'
1058 | KUNIT_BINARY_PTR_ASSERTION(test, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:1055:9: note: in expansion of macro 'KUNIT_EXPECT_PTR_EQ_MSG'
1055 | KUNIT_EXPECT_PTR_EQ_MSG(test, left, right, NULL)
| ^~~~~~~~~~~~~~~~~~~~~~~
lib/tests/stacktrace_kunit.c:19:9: note: in expansion of macro 'KUNIT_EXPECT_PTR_EQ'
19 | KUNIT_EXPECT_PTR_EQ(test, trace.entries, (unsigned long *)entries_buf);
| ^~~~~~~~~~~~~~~~~~~
include/kunit/test.h:857:55: note: (near initialization for '__assertion.left_value')
857 | .left_value = __left, \
| ^~~~~~
include/kunit/test.h:735:49: note: in definition of macro '_KUNIT_FAILED'
735 | const struct assert_class __assertion = INITIALIZER; \
| ^~~~~~~~~~~
include/kunit/test.h:856:23: note: in expansion of macro 'KUNIT_INIT_ASSERT'
856 | KUNIT_INIT_ASSERT(.text = &__text, \
| ^~~~~~~~~~~~~~~~~
include/kunit/test.h:885:9: note: in expansion of macro 'KUNIT_BASE_BINARY_ASSERTION'
885 | KUNIT_BASE_BINARY_ASSERTION(test, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:1058:9: note: in expansion of macro 'KUNIT_BINARY_PTR_ASSERTION'
1058 | KUNIT_BINARY_PTR_ASSERTION(test, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:1055:9: note: in expansion of macro 'KUNIT_EXPECT_PTR_EQ_MSG'
1055 | KUNIT_EXPECT_PTR_EQ_MSG(test, left, right, NULL)
| ^~~~~~~~~~~~~~~~~~~~~~~
lib/tests/stacktrace_kunit.c:19:9: note: in expansion of macro 'KUNIT_EXPECT_PTR_EQ'
19 | KUNIT_EXPECT_PTR_EQ(test, trace.entries, (unsigned long *)entries_buf);
| ^~~~~~~~~~~~~~~~~~~
>> lib/tests/stacktrace_kunit.c:13:28: warning: unused variable 'trace' [-Wunused-variable]
13 | struct stack_trace trace = {
| ^~~~~
--
stacktrace_kunit.c: In function 'test_stack_trace_counted_by':
stacktrace_kunit.c:13:16: error: variable 'trace' has initializer but incomplete type
13 | struct stack_trace trace = {
| ^~~~~~~~~~~
stacktrace_kunit.c:14:18: error: 'struct stack_trace' has no member named 'entries'
14 | .entries = entries_buf,
| ^~~~~~~
stacktrace_kunit.c:14:28: warning: excess elements in struct initializer
14 | .entries = entries_buf,
| ^~~~~~~~~~~
stacktrace_kunit.c:14:28: note: (near initialization for 'trace')
stacktrace_kunit.c:15:18: error: 'struct stack_trace' has no member named 'max_entries'
15 | .max_entries = 4,
| ^~~~~~~~~~~
stacktrace_kunit.c:15:32: warning: excess elements in struct initializer
15 | .max_entries = 4,
| ^
stacktrace_kunit.c:15:32: note: (near initialization for 'trace')
stacktrace_kunit.c:13:28: error: storage size of 'trace' isn't known
13 | struct stack_trace trace = {
| ^~~~~
In file included from include/linux/err.h:5,
from include/kunit/assert.h:12,
from include/kunit/test.h:12,
from stacktrace_kunit.c:6:
>> include/kunit/test.h:1060:42: warning: comparison between pointer and integer
1060 | left, ==, right, \
| ^~
include/linux/compiler.h:76:45: note: in definition of macro 'likely'
76 | # define likely(x) __builtin_expect(!!(x), 1)
| ^
include/kunit/test.h:885:9: note: in expansion of macro 'KUNIT_BASE_BINARY_ASSERTION'
885 | KUNIT_BASE_BINARY_ASSERTION(test, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:1058:9: note: in expansion of macro 'KUNIT_BINARY_PTR_ASSERTION'
1058 | KUNIT_BINARY_PTR_ASSERTION(test, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:1055:9: note: in expansion of macro 'KUNIT_EXPECT_PTR_EQ_MSG'
1055 | KUNIT_EXPECT_PTR_EQ_MSG(test, left, right, NULL)
| ^~~~~~~~~~~~~~~~~~~~~~~
stacktrace_kunit.c:19:9: note: in expansion of macro 'KUNIT_EXPECT_PTR_EQ'
19 | KUNIT_EXPECT_PTR_EQ(test, trace.entries, (unsigned long *)entries_buf);
| ^~~~~~~~~~~~~~~~~~~
In file included from stacktrace_kunit.c:6:
>> include/kunit/test.h:857:55: warning: initialization of 'const void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
857 | .left_value = __left, \
| ^~~~~~
include/kunit/test.h:735:49: note: in definition of macro '_KUNIT_FAILED'
735 | const struct assert_class __assertion = INITIALIZER; \
| ^~~~~~~~~~~
include/kunit/test.h:856:23: note: in expansion of macro 'KUNIT_INIT_ASSERT'
856 | KUNIT_INIT_ASSERT(.text = &__text, \
| ^~~~~~~~~~~~~~~~~
include/kunit/test.h:885:9: note: in expansion of macro 'KUNIT_BASE_BINARY_ASSERTION'
885 | KUNIT_BASE_BINARY_ASSERTION(test, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:1058:9: note: in expansion of macro 'KUNIT_BINARY_PTR_ASSERTION'
1058 | KUNIT_BINARY_PTR_ASSERTION(test, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:1055:9: note: in expansion of macro 'KUNIT_EXPECT_PTR_EQ_MSG'
1055 | KUNIT_EXPECT_PTR_EQ_MSG(test, left, right, NULL)
| ^~~~~~~~~~~~~~~~~~~~~~~
stacktrace_kunit.c:19:9: note: in expansion of macro 'KUNIT_EXPECT_PTR_EQ'
19 | KUNIT_EXPECT_PTR_EQ(test, trace.entries, (unsigned long *)entries_buf);
| ^~~~~~~~~~~~~~~~~~~
include/kunit/test.h:857:55: note: (near initialization for '__assertion.left_value')
857 | .left_value = __left, \
| ^~~~~~
include/kunit/test.h:735:49: note: in definition of macro '_KUNIT_FAILED'
735 | const struct assert_class __assertion = INITIALIZER; \
| ^~~~~~~~~~~
include/kunit/test.h:856:23: note: in expansion of macro 'KUNIT_INIT_ASSERT'
856 | KUNIT_INIT_ASSERT(.text = &__text, \
| ^~~~~~~~~~~~~~~~~
include/kunit/test.h:885:9: note: in expansion of macro 'KUNIT_BASE_BINARY_ASSERTION'
885 | KUNIT_BASE_BINARY_ASSERTION(test, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:1058:9: note: in expansion of macro 'KUNIT_BINARY_PTR_ASSERTION'
1058 | KUNIT_BINARY_PTR_ASSERTION(test, \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
include/kunit/test.h:1055:9: note: in expansion of macro 'KUNIT_EXPECT_PTR_EQ_MSG'
1055 | KUNIT_EXPECT_PTR_EQ_MSG(test, left, right, NULL)
| ^~~~~~~~~~~~~~~~~~~~~~~
stacktrace_kunit.c:19:9: note: in expansion of macro 'KUNIT_EXPECT_PTR_EQ'
19 | KUNIT_EXPECT_PTR_EQ(test, trace.entries, (unsigned long *)entries_buf);
| ^~~~~~~~~~~~~~~~~~~
stacktrace_kunit.c:13:28: warning: unused variable 'trace' [-Wunused-variable]
13 | struct stack_trace trace = {
| ^~~~~
vim +/trace +13 lib/tests/stacktrace_kunit.c
2f587ab333d26b Bill Wendling 2026-08-23 8
2f587ab333d26b Bill Wendling 2026-08-23 9 #ifndef CONFIG_ARCH_STACKWALK
2f587ab333d26b Bill Wendling 2026-08-23 10 static void test_stack_trace_counted_by(struct kunit *test)
2f587ab333d26b Bill Wendling 2026-08-23 11 {
2f587ab333d26b Bill Wendling 2026-08-23 12 unsigned long entries_buf[4];
2f587ab333d26b Bill Wendling 2026-08-23 @13 struct stack_trace trace = {
2f587ab333d26b Bill Wendling 2026-08-23 @14 .entries = entries_buf,
2f587ab333d26b Bill Wendling 2026-08-23 @15 .max_entries = 4,
2f587ab333d26b Bill Wendling 2026-08-23 16 };
2f587ab333d26b Bill Wendling 2026-08-23 17
2f587ab333d26b Bill Wendling 2026-08-23 18 KUNIT_EXPECT_EQ(test, trace.max_entries, 4U);
2f587ab333d26b Bill Wendling 2026-08-23 @19 KUNIT_EXPECT_PTR_EQ(test, trace.entries, (unsigned long *)entries_buf);
2f587ab333d26b Bill Wendling 2026-08-23 20
2f587ab333d26b Bill Wendling 2026-08-23 21 /* Write to the allocated elements to verify access */
2f587ab333d26b Bill Wendling 2026-08-23 22 trace.entries[0] = 0xdeadbeef;
2f587ab333d26b Bill Wendling 2026-08-23 23 trace.entries[1] = 0xbeefcafe;
2f587ab333d26b Bill Wendling 2026-08-23 24 trace.entries[2] = 0xcafebabe;
2f587ab333d26b Bill Wendling 2026-08-23 25 trace.entries[3] = 0x12345678;
2f587ab333d26b Bill Wendling 2026-08-23 26
2f587ab333d26b Bill Wendling 2026-08-23 27 KUNIT_EXPECT_EQ(test, trace.entries[0], 0xdeadbeefUL);
2f587ab333d26b Bill Wendling 2026-08-23 28 KUNIT_EXPECT_EQ(test, trace.entries[1], 0xbeefcafeUL);
2f587ab333d26b Bill Wendling 2026-08-23 29 KUNIT_EXPECT_EQ(test, trace.entries[2], 0xcafebabeUL);
2f587ab333d26b Bill Wendling 2026-08-23 30 KUNIT_EXPECT_EQ(test, trace.entries[3], 0x12345678UL);
2f587ab333d26b Bill Wendling 2026-08-23 31 }
2f587ab333d26b Bill Wendling 2026-08-23 32 #else
2f587ab333d26b Bill Wendling 2026-08-23 33 static void test_stack_trace_counted_by(struct kunit *test)
2f587ab333d26b Bill Wendling 2026-08-23 34 {
2f587ab333d26b Bill Wendling 2026-08-23 35 kunit_skip(test, "CONFIG_ARCH_STACKWALK is enabled, struct stack_trace is not defined");
2f587ab333d26b Bill Wendling 2026-08-23 36 }
2f587ab333d26b Bill Wendling 2026-08-23 37 #endif
2f587ab333d26b Bill Wendling 2026-08-23 38
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-08-25 9:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202608251703.x4npy956-lkp@intel.com \
--to=lkp@intel.com \
--cc=oe-kbuild@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.