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 tapsets/18263] New: In tty tapset, driver_name can be null, causing a script to fail when probing tty.write or tty.read


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

            Bug ID: 18263
           Summary: In tty tapset, driver_name can be null, causing a
                    script to fail when probing tty.write or tty.read
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: tapsets
          Assignee: systemtap at sourceware dot org
          Reporter: maxvt at bu dot edu

Seeing this error from my script:

ERROR: kernel string copy fault at 0x  (null) [man error::fault] near
identifier 'kernel_string' at
/usr/share/systemtap/tapset/linux/conversions.stp:18:10

Narrowed down to a tty.write tap. Investigating the parameters by patching the
tapset like this: 

probe tty.write = kernel.function("n_tty_write") !,
          kernel.function("write_chan")
{
        // [mt]
        printf("buf=%p tty=%p\n", $buf, $tty)
        printf("ttydr=%p ttydrn=%p\n", $tty->driver, $tty->driver->driver_name)

I saw this:
buf=0xcf36c800 tty=0xcd358200
ttydr=0xcf952b80 ttydrn=0x0

I'm not sure which driver(s) may be causing this, and if this might be Debian
specific.

Script-termination-causing line:
        driver_name = kernel_string($tty->driver->driver_name)

Suggested fix:
    if ($tty->driver->driver_name)
        driver_name = kernel_string($tty->driver->driver_name)
    else
        driver_name = "(none)"

System details:
> uname -a
Linux woot 3.16.0-4-686-pae #1 SMP Debian 3.16.7-ckt7-1 (2015-03-01) i686
GNU/Linux
> stap -V
Systemtap translator/driver (version 2.6/0.159, Debian version 2.6-0.2)

-- 
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]