public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug runtime/18999] New: error("") stall (causing similar assert() stall)
@ 2015-09-24  8:40 mcermak at redhat dot com
  2015-09-24 18:42 ` [Bug runtime/18999] " dsmith at redhat dot com
  2015-09-24 21:04 ` dsmith at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: mcermak at redhat dot com @ 2015-09-24  8:40 UTC (permalink / raw)
  To: systemtap

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

            Bug ID: 18999
           Summary: error("") stall (causing similar assert() stall)
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: runtime
          Assignee: systemtap at sourceware dot org
          Reporter: mcermak at redhat dot com
  Target Milestone: ---

When error() is called with an empty string as an arg, it stalls:

=======
 7.2 S x86_64 # stap -ve 'probe begin {error("")}'
Pass 1: parsed user script and 110 library script(s) using
214612virt/32028res/3132shr/29360data kb, in 230usr/10sys/235real ms.
Pass 2: analyzed script: 1 probe(s), 1 function(s), 0 embed(s), 0 global(s)
using 215404virt/33084res/3252shr/30152data kb, in 10usr/0sys/3real ms.
Pass 3: using cached
/root/.systemtap/cache/b4/stap_b44a1d1ed391a09b0b891376db66bfb3_1328.c
Pass 4: using cached
/root/.systemtap/cache/b4/stap_b44a1d1ed391a09b0b891376db66bfb3_1328.ko
Pass 5: starting run.
^CPass 5: run completed in 0usr/20sys/2879real ms.
 7.2 S x86_64 # stap -ve 'probe begin {error(" ")}' # notice the space
Pass 1: parsed user script and 110 library script(s) using
214612virt/32024res/3132shr/29360data kb, in 230usr/10sys/235real ms.
Pass 2: analyzed script: 1 probe(s), 1 function(s), 0 embed(s), 0 global(s)
using 215404virt/33080res/3252shr/30152data kb, in 10usr/0sys/3real ms.
Pass 3: using cached
/root/.systemtap/cache/b3/stap_b3b0ce1313330597aaa8518b9ca8a71e_1329.c
Pass 4: using cached
/root/.systemtap/cache/b3/stap_b3b0ce1313330597aaa8518b9ca8a71e_1329.ko
Pass 5: starting run.
ERROR:  
WARNING: Number of errors: 1, skipped probes: 0
WARNING: /root/mcermak-systemtap/systemtap-build/bin/staprun exited with
status: 1
Pass 5: run completed in 0usr/20sys/517real ms.
Pass 5: run failed.  [man error::pass5]
 7.2 S x86_64 #
=======

In result, public tapset function assert() relying on error() behaves similarly
when called with empty string as the second arg:

=======
 7.2 S x86_64 # stap -ve 'probe oneshot {assert(0,"")}'
Pass 1: parsed user script and 110 library script(s) using
214612virt/32028res/3132shr/29360data kb, in 230usr/0sys/232real ms.
Pass 2: analyzed script: 1 probe(s), 3 function(s), 0 embed(s), 0 global(s)
using 215404virt/33084res/3252shr/30152data kb, in 10usr/0sys/3real ms.
Pass 3: using cached
/root/.systemtap/cache/94/stap_946fc82b93670c11c0208a9b02d67054_1557.c
Pass 4: using cached
/root/.systemtap/cache/94/stap_946fc82b93670c11c0208a9b02d67054_1557.ko
Pass 5: starting run.
=======

Error is defined like this:

=======
function error (msg:string) %{ /* unprivileged */ /* unmodified-fnargs */       
  /* NB: we used to reuse msg[]  for an assignment to last_error; this          
   is clearer & safer. */                                                       
  strlcpy (CONTEXT->error_buffer, STAP_ARG_msg, MAXSTRINGLEN);                  
  CONTEXT->last_error = CONTEXT->error_buffer;                                  
  CONTEXT->last_stmt = NULL;                                                    
%} 
=======

If error("") gets called, it provably finishes, but the session doesn't
terminate probably because of CONTEXT->last_error or CONTEXT->error_buffer
being empty.

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

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

* [Bug runtime/18999] error("") stall (causing similar assert() stall)
  2015-09-24  8:40 [Bug runtime/18999] New: error("") stall (causing similar assert() stall) mcermak at redhat dot com
@ 2015-09-24 18:42 ` dsmith at redhat dot com
  2015-09-24 21:04 ` dsmith at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: dsmith at redhat dot com @ 2015-09-24 18:42 UTC (permalink / raw)
  To: systemtap

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

David Smith <dsmith at redhat dot com> changed:

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

--- Comment #1 from David Smith <dsmith at redhat dot com> ---
Fixed in commit 11f10a9.

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

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

* [Bug runtime/18999] error("") stall (causing similar assert() stall)
  2015-09-24  8:40 [Bug runtime/18999] New: error("") stall (causing similar assert() stall) mcermak at redhat dot com
  2015-09-24 18:42 ` [Bug runtime/18999] " dsmith at redhat dot com
@ 2015-09-24 21:04 ` dsmith at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: dsmith at redhat dot com @ 2015-09-24 21:04 UTC (permalink / raw)
  To: systemtap

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

--- Comment #2 from David Smith <dsmith at redhat dot com> ---
I refixed this in commit 1511b60. Instead of providing a default error message,
I changed the code generation to just check if the context's 'last_error' field
is not NULL, not if it has length.

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

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

end of thread, other threads:[~2015-09-24 21:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-24  8:40 [Bug runtime/18999] New: error("") stall (causing similar assert() stall) mcermak at redhat dot com
2015-09-24 18:42 ` [Bug runtime/18999] " dsmith at redhat dot com
2015-09-24 21:04 ` dsmith 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).