RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1109084 - systemtap script name with "-" not compile while using systemtap-initscript
Summary: systemtap script name with "-" not compile while using systemtap-initscript
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: systemtap
Version: 6.5
Hardware: All
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: Frank Ch. Eigler
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-13 08:27 UTC by masanari iida
Modified: 2014-10-14 06:32 UTC (History)
5 users (show)

Fixed In Version: systemtap-2.5-5.el6
Doc Type: Bug Fix
Doc Text:
Cause: SystemTap initscripts names are limited to limited to using alphanumeric characters and underscores ('_'). The first character in the name must not be a number. Consequence: SystemTap initscripts with hyphens ('-') or other non alphanumeric characters will not compile. Fix: Use names that follow the allow naming scheme mentioned in "man systemtap" Result:
Clone Of:
Environment:
Last Closed: 2014-10-14 06:32:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1449 0 normal SHIPPED_LIVE systemtap bug fix and enhancement update 2014-10-14 01:11:01 UTC

Description masanari iida 2014-06-13 08:27:57 UTC
Description of problem:
configure systemtap-initscript with script name hello-world.stp.
But if the script file name contain "-", it failed to start.

Version-Release number of selected component (if applicable):
systemtap-initscript-2.3-4.el6_5.i686


How reproducible:
Always

Steps to Reproduce:
1. Install systemtap related RPMS.

systemtap-runtime-2.3-4.el6_5.i686
systemtap-devel-2.3-4.el6_5.i686
systemtap-client-2.3-4.el6_5.i686
systemtap-2.3-4.el6_5.i686
systemtap-initscript-2.3-4.el6_5.i686

2. Create a script file in /etc/systemtap/script.d.
The file name is  "hello-world.stp"

3. service systemtap start

Actual results:
# service systemtap start
systemtap : Error: no script file(/etc/systemtap/script.d/hBworld_REQ_REQ.stp).

Expected results:
systemtap :  Compiling hello ... done
 Starting hello ... done

Workaround
Remove "-" from script file name.

Additional info:
No business impact.

Comment 2 Jonathan Lebon 2014-06-13 17:49:59 UTC
(In reply to masanari iida from comment #0)
> Description of problem:
> configure systemtap-initscript with script name hello-world.stp.
> But if the script file name contain "-", it failed to start.

Hello Masanari,

Thanks for the report. This occurs because of the following in the systemtap initscript:

   eval reqs=\$${s}_REQ

This is done when trying to determine if any script dependencies are specified in the config file (e.g. the variable for the dependencies of myscript would be myscript_REQ).

However, if $s is not a valid Bash variable name, e.g. hello-world, then the eval above becomes:

   reqs=$hello-world_REQ

which evaluates as

   reqs=-world_REQ

since '$hello' is an empty variable. The script then thinks that the 'hello-world' script requires the '-world_REQ' script. It gets worse and worse from there...

Regardless, had it been allowed, the script would not have compiled properly:

Jun 13 12:11:02: Exec: /usr/bin/stap -m hello-world -p4 -r 2.6.32-431.17.1.el6.i686 -w -- /etc/systemtap/script.d/hello-world.stp
ERROR: Safety pattern mismatch for -m parameter ('hello-world' vs. '^[a-z0-9_]+$') rc=1
Jun 13 12:11:02: Failed to compile script(hello-world).
Jun 13 12:11:02: error

In commit 4715f85, I've added checks which ensure that script names are valid so that we fail more gracefully. You would now see something like this in the logs:

Jun 13 12:11:22: hello-world is not a valid script name (must match [a-zA-Z_][a-zA-Z0-9_]*)

I've also updated the systemtap(8) man page in commit fbcde98 to clarify this issue:

       Scripts must be placed  in  the  ${prefix}/etc/systemtap/script.d
       directory  and must have a .stp extension. When referring to them
       on the command-line however, there in no need to include the .stp
       extension.  Script names can only contain alphanumeric characters
       and must not start with a number. The scripts  directory  may  be
       changed by setting the SCRIPT_PATH parameter in the configuration
       file.


Jonathan

Comment 8 errata-xmlrpc 2014-10-14 06:32:15 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-1449.html


Note You need to log in before you can comment on or make changes to this bug.