This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug dyninst/15486] New: stapdyn get hung when printing debug messages


http://sourceware.org/bugzilla/show_bug.cgi?id=15486

             Bug #: 15486
           Summary: stapdyn get hung when printing debug messages
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: dyninst
        AssignedTo: systemtap@sourceware.org
        ReportedBy: dsmith@redhat.com
    Classification: Unclassified


In dyninst mode, stapdyn can get hung when printing multiple debug messages.
Here's the test script:

====
probe begin
{
    %{ { _stp_dbug(__FUNCTION__, __LINE__, "debug line 1\n"); 0; } %}
    %{ { _stp_dbug(__FUNCTION__, __LINE__, "debug line 2\n"); 0; } %}
    %{ { _stp_dbug(__FUNCTION__, __LINE__, "debug line 3\n"); 0; } %}
    %{ { _stp_dbug(__FUNCTION__, __LINE__, "debug line 4\n"); 0; } %}
    %{ { _stp_dbug(__FUNCTION__, __LINE__, "debug line 5\n"); 0; } %}
    %{ { _stp_dbug(__FUNCTION__, __LINE__, "debug line 6\n"); 0; } %}
    %{ { _stp_dbug(__FUNCTION__, __LINE__, "debug line 7\n"); 0; } %}
    %{ { _stp_dbug(__FUNCTION__, __LINE__, "debug line 8\n"); 0; } %}
    %{ { _stp_dbug(__FUNCTION__, __LINE__, "debug line 9\n"); 0; } %}
    %{ { _stp_dbug(__FUNCTION__, __LINE__, "debug line 10\n"); 0; } %}
    %{ { _stp_dbug(__FUNCTION__, __LINE__, "debug line 11\n"); 0; } %}
    %{ { _stp_dbug(__FUNCTION__, __LINE__, "debug line 12\n"); 0; } %}
    %{ { _stp_dbug(__FUNCTION__, __LINE__, "debug line 13\n"); 0; } %}
    %{ { _stp_dbug(__FUNCTION__, __LINE__, "debug line 14\n"); 0; } %}
    %{ { _stp_dbug(__FUNCTION__, __LINE__, "debug line 15\n"); 0; } %}
    %{ { _stp_dbug(__FUNCTION__, __LINE__, "debug line 16\n"); 0; } %}
    %{ { _stp_dbug(__FUNCTION__, __LINE__, "debug line 17\n"); 0; } %}
    warn("finished\n")    
    exit()
}
====

When run, stapdyn hangs after printing the 16th debug message until
interrupted.

=====
# stap --dyninst -g ../dbug_test.stp 
probe_32:131: debug line 1
probe_32:133: debug line 2
probe_32:135: debug line 3
probe_32:137: debug line 4
probe_32:139: debug line 5
probe_32:141: debug line 6
probe_32:143: debug line 7
probe_32:145: debug line 8
probe_32:147: debug line 9
probe_32:149: debug line 10
probe_32:157: debug line 11
probe_32:159: debug line 12
probe_32:161: debug line 13
probe_32:163: debug line 14
probe_32:165: debug line 15
probe_32:167: debug line 16
^Cstapdyn: WARNING: Multiple interrupts received, exiting...
=====

_stp_dbug() ends up calling _stp_vlog() (in runtime/dyninst/io.c). _stp_vlog()
allocates a log buffer, but in the DBUG case just uses the allocated buffer for
temporary storage. The log buffer is never sent through the transport, which
means it can never get reused. (The default _STP_LOG_BUF_ENTRIES is 16, which
is why the above output never gets to the 17th debug message or the final
warning in the test script.)

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]