public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug translator/18115] New: probe-condition mistranslated for array expressions
@ 2015-03-11 15:29 fche at redhat dot com
  2015-03-11 15:36 ` [Bug translator/18115] " brchrisman at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: fche at redhat dot com @ 2015-03-11 15:29 UTC (permalink / raw)
  To: systemtap

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

            Bug ID: 18115
           Summary: probe-condition mistranslated for array expressions
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
          Assignee: systemtap at sourceware dot org
          Reporter: fche at redhat dot com

% stap -p4 -e 'global foo  probe begin if (foo == 0) { foo = 1-foo }'
[ok]
% stap -p4 -e 'global foo  probe begin if (foo[0] == 0) { foo[0] = 1-foo[0] }'
/var/tmp/stapFHa0zZ/stap_b95e9e5526bc50657e775ced0c7f4234_925_src.c: In
function ‘probe_6330’:
/var/tmp/stapFHa0zZ/stap_b95e9e5526bc50657e775ced0c7f4234_925_src.c:169:6:
error: ‘struct probe_6330_locals’ has no member named ‘__tmp9’
     l->__tmp9 = _stp_map_get_ii (global(s_foo), ((int64_t)0LL));
      ^
/var/tmp/stapFHa0zZ/stap_b95e9e5526bc50657e775ced0c7f4234_925_src.c:170:6:
error: ‘struct probe_6330_locals’ has no member named ‘__tmp9’
     l->__tmp9;
      ^
etc.

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

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

* [Bug translator/18115] probe-condition mistranslated for array expressions
  2015-03-11 15:29 [Bug translator/18115] New: probe-condition mistranslated for array expressions fche at redhat dot com
@ 2015-03-11 15:36 ` brchrisman at gmail dot com
  2015-03-14 19:59 ` jlebon at redhat dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: brchrisman at gmail dot com @ 2015-03-11 15:36 UTC (permalink / raw)
  To: systemtap

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

Brian Chrisman <brchrisman at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |brchrisman at gmail dot com

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

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

* [Bug translator/18115] probe-condition mistranslated for array expressions
  2015-03-11 15:29 [Bug translator/18115] New: probe-condition mistranslated for array expressions fche at redhat dot com
  2015-03-11 15:36 ` [Bug translator/18115] " brchrisman at gmail dot com
@ 2015-03-14 19:59 ` jlebon at redhat dot com
  2015-03-14 23:05 ` fche at redhat dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jlebon at redhat dot com @ 2015-03-14 19:59 UTC (permalink / raw)
  To: systemtap

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

Jonathan Lebon <jlebon at redhat dot com> changed:

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

--- Comment #1 from Jonathan Lebon <jlebon at redhat dot com> ---
Created attachment 8188
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8188&action=edit
patch for PR18115

These issues are due to the on-the-fly code, which doesn't account for
condition variables being map values, which require the creation of tmpvars to
get. More specifically, there were two problems:

(1) c_tmpcounter was not visiting the conditions, causing a mismatch between
c_tmpcounter and c_unparser.

(2) The emit_probe_condition_initialize() function would cause this type of
code to be emitted right in the middle of systemtap_module_init():

  stap_probes[0].cond_enabled = !!(((
  ({
    l->__tmp11 = _stp_map_get_ii (global(s_foo), ((int64_t)0LL));
    l->__tmp11;
  })) == (((int64_t)0LL))));

which will fail to compile since we are not within any probe body and thus
there is no 'l'.

The patch above changes the initialization mechanism so that a begin probe is
used rather than evaluating the conditions in systemtap_module_init(). The
begin probe is registered as artificially affecting every other probes with
conditions and thus will directly serve to initialize cond_enabled fields
through the regular emit_probe_condition_update(). This also allows us to get
rid of emit_probe_condition_initialize().

Making sure right now that the patch doesn't cause any regressions.

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

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

* [Bug translator/18115] probe-condition mistranslated for array expressions
  2015-03-11 15:29 [Bug translator/18115] New: probe-condition mistranslated for array expressions fche at redhat dot com
  2015-03-11 15:36 ` [Bug translator/18115] " brchrisman at gmail dot com
  2015-03-14 19:59 ` jlebon at redhat dot com
@ 2015-03-14 23:05 ` fche at redhat dot com
  2015-03-16 15:43 ` jlebon at redhat dot com
  2015-03-16 16:45 ` jlebon at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: fche at redhat dot com @ 2015-03-14 23:05 UTC (permalink / raw)
  To: systemtap

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

--- Comment #2 from Frank Ch. Eigler <fche at redhat dot com> ---
(Please note that this problem was originally reported with a conditional
uprobe, not a begin probe, so the fix should not be specific to the latter
type.)

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

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

* [Bug translator/18115] probe-condition mistranslated for array expressions
  2015-03-11 15:29 [Bug translator/18115] New: probe-condition mistranslated for array expressions fche at redhat dot com
                   ` (2 preceding siblings ...)
  2015-03-14 23:05 ` fche at redhat dot com
@ 2015-03-16 15:43 ` jlebon at redhat dot com
  2015-03-16 16:45 ` jlebon at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: jlebon at redhat dot com @ 2015-03-16 15:43 UTC (permalink / raw)
  To: systemtap

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

--- Comment #3 from Jonathan Lebon <jlebon at redhat dot com> ---
(In reply to Frank Ch. Eigler from comment #2)
> (Please note that this problem was originally reported with a conditional
> uprobe, not a begin probe, so the fix should not be specific to the latter
> type.)

Yes, the patch is independent of probe type. The only difference the patch
makes is moving initialization code from systemtap_module_init() to the body of
a begin probe. Since begin probes are run prior to any other probe types
initializing, they are equivalent in effect. (We also don't need to worry about
making the synthetic probe run first among other begin probes since begin
probes themselves don't (and will never) support on-the-fly toggling).

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

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

* [Bug translator/18115] probe-condition mistranslated for array expressions
  2015-03-11 15:29 [Bug translator/18115] New: probe-condition mistranslated for array expressions fche at redhat dot com
                   ` (3 preceding siblings ...)
  2015-03-16 15:43 ` jlebon at redhat dot com
@ 2015-03-16 16:45 ` jlebon at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: jlebon at redhat dot com @ 2015-03-16 16:45 UTC (permalink / raw)
  To: systemtap

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

Jonathan Lebon <jlebon at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Jonathan Lebon <jlebon at redhat dot com> ---
Fixed in commit e6add4f and parents.

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

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

end of thread, other threads:[~2015-03-16 16:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-11 15:29 [Bug translator/18115] New: probe-condition mistranslated for array expressions fche at redhat dot com
2015-03-11 15:36 ` [Bug translator/18115] " brchrisman at gmail dot com
2015-03-14 19:59 ` jlebon at redhat dot com
2015-03-14 23:05 ` fche at redhat dot com
2015-03-16 15:43 ` jlebon at redhat dot com
2015-03-16 16:45 ` jlebon 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).