public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug testsuite/13977] New: rlimit tests fail as-root portions
@ 2012-04-12 20:54 jistone at redhat dot com
  2012-12-14 10:36 ` [Bug testsuite/13977] " mjw at redhat dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: jistone at redhat dot com @ 2012-04-12 20:54 UTC (permalink / raw)
  To: systemtap

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

             Bug #: 13977
           Summary: rlimit tests fail as-root portions
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: testsuite
        AssignedTo: systemtap@sourceware.org
        ReportedBy: jistone@redhat.com
    Classification: Unclassified


For the portions of rlimit.exp which try increasing limits as root, I get
failures like this:

> as_root sudo stap --rlimit-as=1 --rlimit-as=999999999999 -p4 /home/jistone/systemtap/testsuite/systemtap.base/rlimit.stp
> OUT stap: unrecognized option '--rlimit-as=1'
> RC 1
> FAIL: rlimit AS increase (as root)

The problem is that sudo picks up a different stap than the one being tested.

$ which stap
/usr/local/bin/stap
$ sudo which stap
/usr/bin/stap
$ sudo sh -c 'echo $PATH'
/sbin:/bin:/usr/sbin:/usr/bin

My installed /usr/bin/stap is still version 1.7, which doesn't have the various
rlimit options.  But even if it had them, it's the wrong executable to test.

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

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

* [Bug testsuite/13977] rlimit tests fail as-root portions
  2012-04-12 20:54 [Bug testsuite/13977] New: rlimit tests fail as-root portions jistone at redhat dot com
@ 2012-12-14 10:36 ` mjw at redhat dot com
  2013-06-20 17:30 ` fche at redhat dot com
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: mjw at redhat dot com @ 2012-12-14 10:36 UTC (permalink / raw)
  To: systemtap

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

Mark Wielaard <mjw at redhat dot com> changed:

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

--- Comment #1 from Mark Wielaard <mjw at redhat dot com> 2012-12-14 10:36:08 UTC ---
Interestingly I have the reverse problem.
When I am running with sudo make installcheck I get:

FAIL: rlimit CPU small
FAIL: rlimit STACK small

Since apparently these limits don't count against root.
Shouldn't these two tests use as_non_root?

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

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

* [Bug testsuite/13977] rlimit tests fail as-root portions
  2012-04-12 20:54 [Bug testsuite/13977] New: rlimit tests fail as-root portions jistone at redhat dot com
  2012-12-14 10:36 ` [Bug testsuite/13977] " mjw at redhat dot com
@ 2013-06-20 17:30 ` fche at redhat dot com
  2013-06-20 21:35   ` Hien Nguyen
  2013-06-21 17:20 ` dsmith at redhat dot com
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 11+ messages in thread
From: fche at redhat dot com @ 2013-06-20 17:30 UTC (permalink / raw)
  To: systemtap

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

Frank Ch. Eigler <fche at redhat dot com> changed:

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

--- Comment #2 from Frank Ch. Eigler <fche at redhat dot com> ---
Perhaps we should simply disable the as-root variants of the tests, given that
some of the rlimits are not enforced against root by the kernel.

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

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

* Re: [Bug testsuite/13977] rlimit tests fail as-root portions
  2013-06-20 17:30 ` fche at redhat dot com
@ 2013-06-20 21:35   ` Hien Nguyen
  0 siblings, 0 replies; 11+ messages in thread
From: Hien Nguyen @ 2013-06-20 21:35 UTC (permalink / raw)
  To: systemtap

I modified the test case to run the rlimit-stack=1 as non-root - and got 
the correct behavior.

--- systemtap.base/rlimit.exp.orig    2013-06-20 20:15:26.641001019 -0400
+++ systemtap.base/rlimit.exp    2013-06-20 20:12:36.795000227 -0400
@@ -127,7 +127,7 @@

  # Small STACK limit
  set test "rlimit STACK small"
-if {[catch { exec stap --rlimit-stack=1 -p4 $srcdir/$subdir/rlimit.stp} 
res ]} {
+if {[as_non_root "stap --rlimit-stack=1 -p4 $srcdir/$subdir/rlimit.stp" 
]} {
       pass $test
  } else {
       fail $test





On 06/20/2013 10:30 AM, fche at redhat dot com wrote:
> http://sourceware.org/bugzilla/show_bug.cgi?id=13977
>
> Frank Ch. Eigler <fche at redhat dot com> changed:
>
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                   CC|                            |fche at redhat dot com
>
> --- Comment #2 from Frank Ch. Eigler <fche at redhat dot com> ---
> Perhaps we should simply disable the as-root variants of the tests, given that
> some of the rlimits are not enforced against root by the kernel.
>

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

* [Bug testsuite/13977] rlimit tests fail as-root portions
  2012-04-12 20:54 [Bug testsuite/13977] New: rlimit tests fail as-root portions jistone at redhat dot com
  2012-12-14 10:36 ` [Bug testsuite/13977] " mjw at redhat dot com
  2013-06-20 17:30 ` fche at redhat dot com
@ 2013-06-21 17:20 ` dsmith at redhat dot com
  2013-06-21 18:14 ` mjw at redhat dot com
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: dsmith at redhat dot com @ 2013-06-21 17:20 UTC (permalink / raw)
  To: systemtap

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

David Smith <dsmith at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING
                 CC|                            |dsmith at redhat dot com

--- Comment #3 from David Smith <dsmith at redhat dot com> ---
When fixing some tcl errors I saw in the testsuite, I made some changes to this
test case in the following commit:

====
commit 2b70fd7894ed74c39e69d7d3a73f25984107f6f2
Author: David Smith <dsmith@redhat.com>
Date:   Tue Jun 18 14:18:47 2013 -0500

    Fix tcl and logic errors in rlimit.exp.

    * testsuite/systemtap.base/rlimit.exp: To make sure "sudo stap" works
      correctly, use the full path.
    * testsuite/lib/systemtap.exp (as_non_root): If we're running as root, use
      user "nobody" to run commands.
====

Then Josh pointed out that my 'as_non_root' fix wasn't quite correct, so I made
another change:

====
commit edb7542edea73adeb3e15e8a36af18acff4f517a
Author: David Smith <dsmith@redhat.com>
Date:   Tue Jun 18 15:46:48 2013 -0500

    Another 'as_non_root' improvement.
====

I believe those commits should fix all the problems with rlimit.exp.

Josh's original problem was that it was picking the wrong stap. The change to
rlimit.exp to use the full path of the test executable should fix that problem.

I'm not 100% sure, but I'll bet Mark's problem of those two tests failing were
because of the 2nd fix above. If you were logged in as root, 'as_non_root'
still ran the command as root. Now, if you are logged in as root, 'as_non_root'
runs the command as the user 'nobody'.

Josh and Mark, could you test and see if the above commits fix things for you?

On rawhide, this test now passes for me when run by root, run by my login, or
run with sudo.

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

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

* [Bug testsuite/13977] rlimit tests fail as-root portions
  2012-04-12 20:54 [Bug testsuite/13977] New: rlimit tests fail as-root portions jistone at redhat dot com
                   ` (2 preceding siblings ...)
  2013-06-21 17:20 ` dsmith at redhat dot com
@ 2013-06-21 18:14 ` mjw at redhat dot com
  2013-06-21 18:15 ` jistone at redhat dot com
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: mjw at redhat dot com @ 2013-06-21 18:14 UTC (permalink / raw)
  To: systemtap

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

--- Comment #4 from Mark Wielaard <mjw at redhat dot com> ---
I am still failures with:

$ sudo make installcheck RUNTESTFLAGS=rlimit.exp

Host: Linux bordewijk.wildebeest.org 2.6.32-358.11.1.el6.x86_64 #1 SMP Wed May
15 10:48:38 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux
Snapshot: version 2.3/0.152, commit release-2.2.1-167-ge7e3c2f
GCC: 4.4.7 [gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3)]
Distro: Red Hat Enterprise Linux Workstation release 6.4 (Santiago)
SElinux: Enforcing


Running /home/mark/src/systemtap/testsuite/systemtap.base/rlimit.exp ...
FAIL: rlimit CPU small
FAIL: rlimit STACK small

        === systemtap Summary ===

# of expected passes        17
# of unexpected failures    2

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

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

* [Bug testsuite/13977] rlimit tests fail as-root portions
  2012-04-12 20:54 [Bug testsuite/13977] New: rlimit tests fail as-root portions jistone at redhat dot com
                   ` (3 preceding siblings ...)
  2013-06-21 18:14 ` mjw at redhat dot com
@ 2013-06-21 18:15 ` jistone at redhat dot com
  2013-06-21 18:29 ` jistone at redhat dot com
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: jistone at redhat dot com @ 2013-06-21 18:15 UTC (permalink / raw)
  To: systemtap

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

--- Comment #5 from Josh Stone <jistone at redhat dot com> ---
(In reply to David Smith from comment #3)
> Josh and Mark, could you test and see if the above commits fix things for
> you?
> 
> On rawhide, this test now passes for me when run by root, run by my login,
> or run with sudo.

The problem of picking up the wrong stap is fixed, thanks.

I still fail "CPU small" and "STACK small" though, for all invocations: as
myself, via sudo, and as native root.  I'm testing in RHEL6, if that matters.

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

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

* [Bug testsuite/13977] rlimit tests fail as-root portions
  2012-04-12 20:54 [Bug testsuite/13977] New: rlimit tests fail as-root portions jistone at redhat dot com
                   ` (4 preceding siblings ...)
  2013-06-21 18:15 ` jistone at redhat dot com
@ 2013-06-21 18:29 ` jistone at redhat dot com
  2013-06-21 21:57 ` dsmith at redhat dot com
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: jistone at redhat dot com @ 2013-06-21 18:29 UTC (permalink / raw)
  To: systemtap

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

--- Comment #6 from Josh Stone <jistone at redhat dot com> ---
For "CPU small", I think it's squeaking under the limit by using the cache. 
When I add --disable-cache to that line, it fails properly for me.

The same tweak doesn't appear to change "STACK small" though.  I notice that on
my native F19 machine "stap --rlimit-stack=1 /dev/null" segfaults immediately,
but the same in my RHEL6 VM runs normally (complaining of empty input).

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

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

* [Bug testsuite/13977] rlimit tests fail as-root portions
  2012-04-12 20:54 [Bug testsuite/13977] New: rlimit tests fail as-root portions jistone at redhat dot com
                   ` (5 preceding siblings ...)
  2013-06-21 18:29 ` jistone at redhat dot com
@ 2013-06-21 21:57 ` dsmith at redhat dot com
  2013-06-24 16:04 ` dsmith at redhat dot com
  2013-06-24 16:10 ` dsmith at redhat dot com
  8 siblings, 0 replies; 11+ messages in thread
From: dsmith at redhat dot com @ 2013-06-21 21:57 UTC (permalink / raw)
  To: systemtap

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

--- Comment #7 from David Smith <dsmith at redhat dot com> ---
On rhel6, 'STACK small' fails for me too. What really odd is that strace and a
stap script I wrote agree that the new stack size is getting set correctly.

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

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

* [Bug testsuite/13977] rlimit tests fail as-root portions
  2012-04-12 20:54 [Bug testsuite/13977] New: rlimit tests fail as-root portions jistone at redhat dot com
                   ` (6 preceding siblings ...)
  2013-06-21 21:57 ` dsmith at redhat dot com
@ 2013-06-24 16:04 ` dsmith at redhat dot com
  2013-06-24 16:10 ` dsmith at redhat dot com
  8 siblings, 0 replies; 11+ messages in thread
From: dsmith at redhat dot com @ 2013-06-24 16:04 UTC (permalink / raw)
  To: systemtap

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

--- Comment #8 from David Smith <dsmith at redhat dot com> ---
Created attachment 7091
  --> http://sourceware.org/bugzilla/attachment.cgi?id=7091&action=edit
rlimit test script

Here's the stap script I used to prove that the rlimit is getting set
correctly.

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

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

* [Bug testsuite/13977] rlimit tests fail as-root portions
  2012-04-12 20:54 [Bug testsuite/13977] New: rlimit tests fail as-root portions jistone at redhat dot com
                   ` (7 preceding siblings ...)
  2013-06-24 16:04 ` dsmith at redhat dot com
@ 2013-06-24 16:10 ` dsmith at redhat dot com
  8 siblings, 0 replies; 11+ messages in thread
From: dsmith at redhat dot com @ 2013-06-24 16:10 UTC (permalink / raw)
  To: systemtap

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

David Smith <dsmith at redhat dot com> changed:

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

--- Comment #9 from David Smith <dsmith at redhat dot com> ---
Fixed in commit aa157c1.

- Added '--disable-cache' to the "CPU small" test as mentioned in comment #6.

- Removed the 'STACK small' test, since some kernels (like RHEL6's) ignore the
small stack limit.

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

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

end of thread, other threads:[~2013-06-24 16:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-12 20:54 [Bug testsuite/13977] New: rlimit tests fail as-root portions jistone at redhat dot com
2012-12-14 10:36 ` [Bug testsuite/13977] " mjw at redhat dot com
2013-06-20 17:30 ` fche at redhat dot com
2013-06-20 21:35   ` Hien Nguyen
2013-06-21 17:20 ` dsmith at redhat dot com
2013-06-21 18:14 ` mjw at redhat dot com
2013-06-21 18:15 ` jistone at redhat dot com
2013-06-21 18:29 ` jistone at redhat dot com
2013-06-21 21:57 ` dsmith at redhat dot com
2013-06-24 16:04 ` dsmith at redhat dot com
2013-06-24 16:10 ` 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).