Project

General

Profile

Actions

Bug #7789

closed

test_setsid fails for OpenBSD

Added by kernigh (George Koehler) almost 12 years ago. Updated almost 12 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 2.0.0dev (2013-02-06 trunk 39081) [x86_64-openbsd5.2]
Backport:
[ruby-core:51889]

Description

=begin
TestProcess#test_setsid always fails because OpenBSD doesn't allow Process::getsid(pid) when the pid is in a different session. Quoting man getsid, "[EPERM] The current process and the process pid are not in the same session."

How to reproduce:

$ make test-all TESTS='ruby/test_process.rb -n test_setsid'
CC = gcc
LD = ld
LDSHARED = gcc -shared
CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=implicit-function-declaration -ansi -std=iso9899:199409
XCFLAGS = -include ruby/config.h -include ruby/missing.h -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT -fPIE
CPPFLAGS = -I/usr/local/include -I. -I.ext/include/x86_64-openbsd5.2 -I../include -I..
DLDFLAGS = -fstack-protector -pie
SOLIBS =
./miniruby -I../lib -I. -I.ext/common ../tool/runruby.rb --extout=.ext -- --disable-gems "../test/runner.rb" --ruby="./miniruby -I../lib -I. -I.ext/common ../tool/runruby.rb --extout=.ext -- --disable-gems" ruby/test_process.rb -n test_setsid
Run options: "--ruby=./miniruby -I../lib -I. -I.ext/common ../tool/runruby.rb --extout=.ext -- --disable-gems" -n test_setsid

Running tests:

[1/1] TestProcess#test_setsid = 3.04 s

  1. Error:
    test_setsid(TestProcess):
    Errno::EPERM: Operation not permitted
    /home/kernigh/park/ruby/test/ruby/test_process.rb:1589:in getsid' /home/kernigh/park/ruby/test/ruby/test_process.rb:1589:in block in test_setsid'
    /home/kernigh/park/ruby/test/ruby/test_process.rb:1578:in popen' /home/kernigh/park/ruby/test/ruby/test_process.rb:1578:in test_setsid'

Finished tests in 3.050209s, 0.3278 tests/s, 0.3278 assertions/s.
1 tests, 1 assertions, 0 failures, 1 errors, 0 skips

ruby -v: ruby 2.0.0dev (2013-02-06 trunk 39081) [x86_64-openbsd5.2]
*** Error code 1

Stop in /home/kernigh/park/ruby/build (line 977 of Makefile).

The only fix is to skip the Process::getsid(pid) in the test. I wrote a patch for this. My patch does not call the skip method, because I was not sure how to call it. I don't want to skip the whole test.

While I am looking at this test, I see that it calls (({Process.kill(:KILL, io.pid)})) but never reaps the zombie process. Shouldn't it call (({Process.wait(io.pid)})) after that?

=end


Files

setsid-openbsd.diff (815 Bytes) setsid-openbsd.diff skip the Process::getsid(pid) in the test kernigh (George Koehler), 02/06/2013 08:31 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0