https://bugs.kde.org/show_bug.cgi?id=387712

            Bug ID: 387712
           Summary: s390x cgijnl reports Conditional jump or move depends
                    on uninitialised value(s)
           Product: valgrind
           Version: 3.13.0
          Platform: Other
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: memcheck
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

I don't have a small example yet.
This happens when running the elfutils testsuite.

==50295== Conditional jump or move depends on uninitialised value(s)
==50295==    at 0x407A170: __libdwfl_frame_unwind (frame_unwind.c:711)
==50295==    by 0x407A3F1: dwfl_frame_pc (dwfl_frame_pc.c:54)
==50295==    by 0x80001F9B: frame_callback (backtrace.c:172)
==50295==    by 0x407850B: dwfl_thread_getframes (dwfl_frame.c:450)
==50295==    by 0x80001F0B: thread_callback (backtrace.c:201)
==50295==    by 0x40782A7: dwfl_getthreads (dwfl_frame.c:294)
==50295==    by 0x80001D5D: dump (backtrace.c:223)
==50295==    by 0x80002299: exec_dump (backtrace.c:434)
==50295==    by 0x80002499: parse_opt (backtrace.c:457)
==50295==    by 0x41EB255: argp_parse (in /usr/lib64/libc-2.25.so)

The code looks as follows:

709       /* Check whether this is the initial frame or a signal frame.
710          Then we need to unwind from the original, unadjusted PC.  */
711       if (! state->initial_frame && ! state->signal_frame)
712         pc--;

Where the state is defined as:

struct Dwfl_Frame
{
  Dwfl_Thread *thread;
  /* Previous (outer) frame.  */
  Dwfl_Frame *unwound;
  bool signal_frame : 1;
  bool initial_frame : 1;
  enum
  {
    /* This structure is still being initialized or there was an error
       initializing it.  */
    DWFL_FRAME_STATE_ERROR,
    /* PC field is valid.  */
    DWFL_FRAME_STATE_PC_SET,
    /* PC field is undefined, this means the next (inner) frame was the
       outermost frame.  */
    DWFL_FRAME_STATE_PC_UNDEFINED
  } pc_state;
  /* Either initialized from appropriate REGS element or on some archs
     initialized separately as the return address has no DWARF register.  */
  Dwarf_Addr pc;
  /* (1 << X) bitmask where 0 <= X < ebl_frame_nregs.  */
  uint64_t regs_set[3];
  /* REGS array size is ebl_frame_nregs.
     REGS_SET tells which of the REGS are valid.  */
  Dwarf_Addr regs[];
};


(gdb) print &state->signal_frame
$3 = (_Bool *) 0x43350f0
(gdb) print &state->initial_frame
$4 = (_Bool *) 0x43350f0
(gdb) print state
$5 = (Dwfl_Frame *) 0x43350e0
(gdb) print *state
$6 = {thread = 0x1ffeffe2c0, unwound = 0x0, signal_frame = false, 
  initial_frame = false, pc_state = DWFL_FRAME_STATE_PC_SET, pc = 4557114334, 
  regs_set = {4278255552, 0, 0}, regs = 0x4335118}
(gdb) print sizeof (Dwfl_Frame)
$7 = 56
(gdb) monitor xb 0x43350e0 56
                  00      00      00      00      00      00      00      00
0x43350E0:      0x00    0x00    0x00    0x1f    0xfe    0xff    0xe2    0xc0
                  00      00      00      00      00      00      00      00
0x43350E8:      0x00    0x00    0x00    0x00    0x00    0x00    0x00    0x00
                  3f      ff      ff      ff      00      00      00      00
0x43350F0:      0x00    0x00    0x00    0x00    0x00    0x00    0x00    0x01
                  00      00      00      00      00      00      00      00
0x43350F8:      0x00    0x00    0x00    0x01    0x0f    0xa0    0x0b    0xde
                  00      00      00      00      00      00      00      00
0x4335100:      0x00    0x00    0x00    0x00    0xff    0x00    0xff    0xc0
                  00      00      00      00      00      00      00      00
0x4335108:      0x00    0x00    0x00    0x00    0x00    0x00    0x00    0x00
                  00      00      00      00      00      00      00      00
0x4335110:      0x00    0x00    0x00    0x00    0x00    0x00    0x00    0x00

Dump of assembler code for function __libdwfl_frame_unwind:
   0x000000000407a130 <+0>:     ltg     %r1,8(%r2)
   0x000000000407a136 <+6>:     bner    %r14
   0x000000000407a138 <+8>:     stmg    %r6,%r15,48(%r15)
   0x000000000407a13e <+14>:    lghi    %r4,0
   0x000000000407a142 <+18>:    lay     %r15,-192(%r15)
   0x000000000407a148 <+24>:    lgr     %r11,%r2
   0x000000000407a14c <+28>:    la      %r3,176(%r15)
   0x000000000407a150 <+32>:    brasl   %r14,0x407a388 <dwfl_frame_pc>
   0x000000000407a156 <+38>:    cije    %r2,0,0x407a312
<__libdwfl_frame_unwind+482>
   0x000000000407a15c <+44>:    lg      %r1,16(%r11)
   0x000000000407a162 <+50>:    lg      %r3,176(%r15)
   0x000000000407a168 <+56>:    tmhh    %r1,16384
   0x000000000407a16c <+60>:    jne     0x407a176 <__libdwfl_frame_unwind+70>
=> 0x000000000407a170 <+64>:    cgijnl  %r1,0,0x407a2c8
<__libdwfl_frame_unwind+408>

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to