[Bug 216090] New: GCC12: printk.h:446:44: error: using a dangling pointer to '__str'

bugzilla-daemon at kernel.org bugzilla-daemon at kernel.org
Tue Jun 7 12:26:24 AEST 2022


https://bugzilla.kernel.org/show_bug.cgi?id=216090

            Bug ID: 216090
           Summary: GCC12: printk.h:446:44: error: using a dangling
                    pointer to '__str'
           Product: Platform Specific/Hardware
           Version: 2.5
    Kernel Version: 5.17.13
          Hardware: All
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: PPC-64
          Assignee: platform_ppc-64 at kernel-bugs.osdl.org
          Reporter: vt at altlinux.org
        Regression: Yes

There is build error on GCC 12:


  [00:00:26]   CC      arch/powerpc/kernel/trace/ftrace.o
  [00:00:26] In file included from ./include/asm-generic/bug.h:22,
  [00:00:26]                  from ./arch/powerpc/include/asm/bug.h:149,
  [00:00:26]                  from ./include/linux/bug.h:5,
  [00:00:26]                  from ./include/linux/thread_info.h:13,
  [00:00:26]                  from ./include/asm-generic/preempt.h:5,
  [00:00:26]                  from
./arch/powerpc/include/generated/asm/preempt.h:1,
  [00:00:26]                  from ./include/linux/preempt.h:78,
  [00:00:26]                  from ./include/linux/spinlock.h:55,
  [00:00:26]                  from arch/powerpc/kernel/trace/ftrace.c:16:
  [00:00:26] arch/powerpc/kernel/trace/ftrace.c: In function
'ftrace_modify_code':
  [00:00:26] ./include/linux/printk.h:446:44: error: using a dangling pointer
to '__str' [-Werror=dangling-pointer=]
  [00:00:26]   446 | #define printk(fmt, ...) printk_index_wrap(_printk, fmt,
##__VA_ARGS__)
  [00:00:26]       |                                            ^
  [00:00:26] ./include/linux/printk.h:418:17: note: in definition of macro
'printk_index_wrap'
  [00:00:26]   418 |                 _p_func(_fmt, ##__VA_ARGS__);             
             \
  [00:00:26]       |                 ^~~~~~~
  [00:00:26] ./include/linux/printk.h:489:9: note: in expansion of macro
'printk'
  [00:00:26]   489 |         printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
  [00:00:26]       |         ^~~~~~
  [00:00:26] arch/powerpc/kernel/trace/ftrace.c:76:17: note: in expansion of
macro 'pr_err'
  [00:00:26]    76 |                 pr_err("%p: replaced (%s) != old (%s)",
  [00:00:26]       |                 ^~~~~~
  [00:00:26] In file included from
./arch/powerpc/include/asm/code-patching.h:14,
  [00:00:26]                  from arch/powerpc/kernel/trace/ftrace.c:27:
  [00:00:26] ./arch/powerpc/include/asm/inst.h:156:14: note: '__str' declared
here
  [00:00:26]   156 |         char __str[PPC_INST_STR_LEN];   \
  [00:00:26]       |              ^~~~~
  [00:00:26] ./include/linux/printk.h:418:33: note: in expansion of macro
'ppc_inst_as_str'
  [00:00:26]   418 |                 _p_func(_fmt, ##__VA_ARGS__);             
             \
  [00:00:26]       |                                 ^~~~~~~~~~~
  [00:00:26] ./include/linux/printk.h:446:26: note: in expansion of macro
'printk_index_wrap'
  [00:00:26]   446 | #define printk(fmt, ...) printk_index_wrap(_printk, fmt,
##__VA_ARGS__)


This may be related discussion:
https://lore.kernel.org/all/20220601162023.GW25951@gate.crashing.org/T/

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.


More information about the Linuxppc-dev mailing list