public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug translator/27933] New: Use of unitialized functioncall synthetic field in
@ 2021-05-31 12:21 mark at klomp dot org
  2021-05-31 12:22 ` [Bug translator/27933] " mcermak at redhat dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: mark at klomp dot org @ 2021-05-31 12:21 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=27933

            Bug ID: 27933
           Summary: Use of unitialized functioncall synthetic field in
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
          Assignee: systemtap at sourceware dot org
          Reporter: mark at klomp dot org
  Target Milestone: ---

Running the helloworld.stp example under valgrind gives:

 ==113473== Conditional jump or move depends on uninitialised value(s)
 ==113473==    at 0x1EE356:
functioncall_security_check::visit_embeddedcode(embeddedcode*)
(elaborate.cxx:3140)
 ==113473==    by 0x1EAC50: UnknownInlinedFun (elaborate.cxx:3110)
 ==113473==    by 0x1EAC50: symresolution_info::find_functions(functioncall*,
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >
const&, unsigned int, token const*) (elaborate.cxx:3268)
 ==113473==    by 0x1ED93B:
symresolution_info::visit_functioncall(functioncall*) (elaborate.cxx:2946)
 ==113473==    by 0x1E93BB: symresolution_info::visit_block(block*)
(elaborate.cxx:2610)
 ==113473==    by 0x1E93BB: symresolution_info::visit_block(block*)
(elaborate.cxx:2610)
 ==113473==    by 0x1E83E4: semantic_pass_symbols(systemtap_session&) [clone
.lto_priv.0] (elaborate.cxx:1977)
 ==113473==    by 0x19BCCE: UnknownInlinedFun (elaborate.cxx:2540)
 ==113473==    by 0x19BCCE: passes_0_4(systemtap_session&) (main.cxx:1049)
 ==113473==    by 0x18FB73: main (main.cxx:1534)
 ==113473==  Uninitialised value was created by a heap allocation
 ==113473==    at 0x4840FF5: operator new(unsigned long)
(vg_replace_malloc.c:417) 
 ==113473==    by 0x1C4E22: UnknownInlinedFun (parse.cxx:4044)
 ==113473==    by 0x1C4E22: parser::parse_value() (parse.cxx:3795)
 ==113473==    by 0x1C59E9: parser::parse_dwarf_value() (parse.cxx:3732)
 ==113473==    by 0x1C6C0D: UnknownInlinedFun (parse.cxx:3690)
 ==113473==    by 0x1C6C0D: parser::parse_unary() (parse.cxx:3664)
 ==113473==    by 0x1C6ECF: parser::parse_multiplicative() (parse.cxx:3625)
 ==113473==    by 0x1C7023: parser::parse_additive() (parse.cxx:3602)
 ==113473==    by 0x1BB25F: parser::parse_concatenation() (parse.cxx:3578)
 ==113473==    by 0x1BB39F: parser::parse_shift() (parse.cxx:3555)
 ==113473==    by 0x1BBCDB: UnknownInlinedFun (parse.cxx:3513)
 ==113473==    by 0x1BBCDB: parser::parse_array_in() (parse.cxx:3465)
 ==113473==    by 0x1BC2CF: parser::parse_boolean_and() (parse.cxx:3421)
 ==113473==    by 0x1BC40F: parser::parse_boolean_xor() (parse.cxx:3399)
 ==113473==    by 0x1BC54F: parser::parse_boolean_or() (parse.cxx:3377)

valgrind seems right, functioncall_security_check::visit_embeddedcode does:

  // Don't allow /* guru */ functions unless caller is privileged.
  if (!call->synthetic && !call->tok->location.file->privileged &&
      s->tagged_p ("/* guru */"))
    throw SEMANTIC_ERROR (_("function may not be used unless -g is specified"),
                          call->tok);

Checking the functioncall synthetic field.
But that seems never have been initialized at parse.cxx:4044 we see:

          struct functioncall* f = new functioncall;
          f->tok = t;
          f->function = name;

There are some code paths that set functioncall synthetic to true. Maybe the
default initialization should be false for this field?

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

* [Bug translator/27933] Use of unitialized functioncall synthetic field in
  2021-05-31 12:21 [Bug translator/27933] New: Use of unitialized functioncall synthetic field in mark at klomp dot org
@ 2021-05-31 12:22 ` mcermak at redhat dot com
  2021-06-02 14:07 ` ahajkova at redhat dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: mcermak at redhat dot com @ 2021-05-31 12:22 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=27933

Martin Cermak <mcermak at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mcermak at redhat dot com

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

* [Bug translator/27933] Use of unitialized functioncall synthetic field in
  2021-05-31 12:21 [Bug translator/27933] New: Use of unitialized functioncall synthetic field in mark at klomp dot org
  2021-05-31 12:22 ` [Bug translator/27933] " mcermak at redhat dot com
@ 2021-06-02 14:07 ` ahajkova at redhat dot com
  2021-06-02 14:19 ` ahajkova at redhat dot com
  2021-06-02 17:02 ` fche at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: ahajkova at redhat dot com @ 2021-06-02 14:07 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=27933

Alexandra Hájková <ahajkova at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ahajkova at redhat dot com

--- Comment #1 from Alexandra Hájková <ahajkova at redhat dot com> ---
Created attachment 13481
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13481&action=edit
patch

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

* [Bug translator/27933] Use of unitialized functioncall synthetic field in
  2021-05-31 12:21 [Bug translator/27933] New: Use of unitialized functioncall synthetic field in mark at klomp dot org
  2021-05-31 12:22 ` [Bug translator/27933] " mcermak at redhat dot com
  2021-06-02 14:07 ` ahajkova at redhat dot com
@ 2021-06-02 14:19 ` ahajkova at redhat dot com
  2021-06-02 17:02 ` fche at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: ahajkova at redhat dot com @ 2021-06-02 14:19 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=27933

--- Comment #2 from Alexandra Hájková <ahajkova at redhat dot com> ---
valgrind does not complain with the patch anymore

valgrind -q --track-origins=yes stap -v --example helloworld.stp
Pass 1: parsed user script and 501 library scripts using
1382740virt/1108832res/15060shr/1132228data kb, in 95850usr/1340sys/100161real
ms.
Pass 2: analyzed script: 1 probe, 1 function, 0 embeds, 0 globals using
1419292virt/1151492res/15508shr/1168780data kb, in 3060usr/40sys/3116real ms.
Pass 3: translated to C into
"/tmp/stapeR0YmE/stap_404a498339680118b7367fba73a554f3_1083_src.c" using
1419528virt/1155652res/15828shr/1169016data kb, in 290usr/0sys/305real ms.
Pass 4: compiled C into "stap_404a498339680118b7367fba73a554f3_1083.ko" in
30110usr/6930sys/12054real ms.
Pass 5: starting run.
hello world
Pass 5: run completed in 40usr/150sys/507real ms.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

* [Bug translator/27933] Use of unitialized functioncall synthetic field in
  2021-05-31 12:21 [Bug translator/27933] New: Use of unitialized functioncall synthetic field in mark at klomp dot org
                   ` (2 preceding siblings ...)
  2021-06-02 14:19 ` ahajkova at redhat dot com
@ 2021-06-02 17:02 ` fche at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: fche at redhat dot com @ 2021-06-02 17:02 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=27933

Frank Ch. Eigler <fche at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
                 CC|                            |fche at redhat dot com
             Status|NEW                         |RESOLVED

--- Comment #3 from Frank Ch. Eigler <fche at redhat dot com> ---
commit bccf5123f916

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

end of thread, other threads:[~2021-06-02 17:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-31 12:21 [Bug translator/27933] New: Use of unitialized functioncall synthetic field in mark at klomp dot org
2021-05-31 12:22 ` [Bug translator/27933] " mcermak at redhat dot com
2021-06-02 14:07 ` ahajkova at redhat dot com
2021-06-02 14:19 ` ahajkova at redhat dot com
2021-06-02 17:02 ` fche at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).