Project

General

Profile

Actions

Bug #14230

closed

badseg test leaves coreadm in maintenance

Added by Robert Mustacchi 7 months ago. Updated 6 months ago.

Status:
Closed
Priority:
Normal
Category:
tests
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

The badseg test manipulates the coreadm global settings. In particular, it tries to snapshot the original settings; however, when there is no setting to begin with, it ends up leaving coreadm with an escaped path of "\"\"" which causes us to fail and enter maintenance. While the coreadm service needs to be better about this, the badseg test shouldn't end up causing this.

Actions #1

Updated by Robert Mustacchi 6 months ago

The fundamental problem here is that the svcprop empty string when a property is present, is "". This is then being passed in the script basically as "$var", leaving us actually passing "" as an actual string to coreadm. The simple fix here is to double check this as a special case in the script.

Actions #2

Updated by Electric Monk 6 months ago

  • Gerrit CR set to 1800
Actions #3

Updated by Robert Mustacchi 6 months ago

To test this, I first set the coreadm settings ti have an empty path, e.g. coreadm -g ''. This results in coreadm settings of:

     global core file pattern: 
     global core file content: default
       init core file pattern: core
       init core file content: default
            global core dumps: enabled
       per-process core dumps: enabled
      global setid core dumps: disabled
 per-process setid core dumps: disabled
     global core dump logging: disabled

With this in place, I ran the full test suite which would often leave coreadm in a bad spot and it all ran well with the exception of #14229, which I have in my queue:

Test: /opt/os-tests/tests/clock_gettime.32 (run as root)          [00:00] [PASS]
Test: /opt/os-tests/tests/clock_gettime.64 (run as root)          [00:00] [PASS]
Test: /opt/os-tests/tests/eventfd.32 (run as root)                [00:00] [PASS]
Test: /opt/os-tests/tests/eventfd.64 (run as root)                [00:00] [PASS]
Test: /opt/os-tests/tests/imc_test (run as root)                  [00:00] [PASS]
Test: /opt/os-tests/tests/odirectory.32 (run as root)             [00:00] [PASS]
Test: /opt/os-tests/tests/odirectory.64 (run as root)             [00:00] [PASS]
Test: /opt/os-tests/tests/writev.32 (run as root)                 [00:00] [PASS]
Test: /opt/os-tests/tests/writev.64 (run as root)                 [00:00] [PASS]
Test: /opt/os-tests/tests/cores/core_prereqs (run as root)        [00:00] [PASS]
Test: /opt/os-tests/tests/cores/coretests (run as root)           [00:06] [PASS]
Test: /opt/os-tests/tests/ddi_ufm/ufm-test-setup (run as root)    [00:00] [PASS]
Test: /opt/os-tests/tests/ddi_ufm/ufm-test (run as root)          [00:00] [PASS]
Test: /opt/os-tests/tests/ddi_ufm/ufm-test-cleanup (run as root)  [00:00] [PASS]
Test: /opt/os-tests/tests/file-locking/runtests.32 (run as root)  [00:21] [PASS]
Test: /opt/os-tests/tests/file-locking/runtests.64 (run as root)  [00:21] [PASS]
Test: /opt/os-tests/tests/i386/ldt (run as root)                  [00:06] [PASS]
Test: /opt/os-tests/tests/i386/badseg (run as root)               [00:09] [PASS]
Test: /opt/os-tests/tests/ksensor/ksensor_init (run as root)      [00:00] [PASS]
Test: /opt/os-tests/tests/ksensor/ksensor_basic.32 (run as root)  [00:00] [PASS]
Test: /opt/os-tests/tests/ksensor/ksensor_basic.64 (run as root)  [00:00] [PASS]
Test: /opt/os-tests/tests/ksensor/ksensor_err.32 (run as root)    [00:00] [PASS]
Test: /opt/os-tests/tests/ksensor/ksensor_err.64 (run as root)    [00:00] [PASS]
Test: /opt/os-tests/tests/ksensor/ksensor_fini (run as root)      [00:00] [PASS]
Test: /opt/os-tests/tests/libtopo/digraph-test (run as root)      [00:00] [PASS]
Test: /opt/os-tests/tests/pf_key/acquire-compare (run as root)    [00:43] [PASS]
Test: /opt/os-tests/tests/pf_key/kmc-update (run as root)         [00:00] [PASS]
Test: /opt/os-tests/tests/sdevfs/sdevfs_eisdir (run as root)      [00:00] [PASS]
Test: /opt/os-tests/tests/secflags/secflags_aslr (run as root)    [00:04] [PASS]
Test: /opt/os-tests/tests/secflags/secflags_core (run as root)    [00:01] [PASS]
Test: /opt/os-tests/tests/secflags/secflags_dts (run as root)     [00:03] [FAIL]
Test: /opt/os-tests/tests/secflags/secflags_elfdump (run as root) [00:01] [PASS]
Test: /opt/os-tests/tests/secflags/secflags_forbidnullmap (run as root) [00:00] [PASS]
Test: /opt/os-tests/tests/secflags/secflags_limits (run as root)  [00:00] [PASS]
Test: /opt/os-tests/tests/secflags/secflags_noexecstack (run as root) [00:00] [PASS]
Test: /opt/os-tests/tests/secflags/secflags_proc (run as root)    [00:01] [PASS]
Test: /opt/os-tests/tests/secflags/secflags_psecflags (run as root) [00:11] [PASS]
Test: /opt/os-tests/tests/secflags/secflags_syscall (run as root) [00:00] [PASS]
Test: /opt/os-tests/tests/secflags/secflags_truss (run as root)   [00:00] [PASS]
Test: /opt/os-tests/tests/secflags/secflags_zonecfg (run as root) [00:00] [PASS]
Test: /opt/os-tests/tests/sigqueue/sigqueue_queue_size (run as root) [00:00] [PASS]
Test: /opt/os-tests/tests/sockfs/conn (run as root)               [00:05] [PASS]
Test: /opt/os-tests/tests/sockfs/dgram (run as root)              [00:05] [PASS]
Test: /opt/os-tests/tests/sockfs/drop_priv (run as root)          [00:07] [PASS]
Test: /opt/os-tests/tests/sockfs/nosignal (run as root)           [00:02] [PASS]
Test: /opt/os-tests/tests/sockfs/rights.32 (run as root)          [00:00] [PASS]
Test: /opt/os-tests/tests/sockfs/rights.64 (run as root)          [00:00] [PASS]
Test: /opt/os-tests/tests/sockfs/sockpair (run as root)           [00:10] [PASS]
Test: /opt/os-tests/tests/sockfs/recvmsg.32 (run as root)         [00:00] [PASS]
Test: /opt/os-tests/tests/sockfs/recvmsg.64 (run as root)         [00:00] [PASS]
Test: /opt/os-tests/tests/stackalign/stackalign.32 (run as root)  [00:00] [PASS]
Test: /opt/os-tests/tests/stackalign/stackalign.64 (run as root)  [00:00] [PASS]
Test: /opt/os-tests/tests/stress/dladm-kstat (run as root)        [00:20] [PASS]
Test: /opt/os-tests/tests/syscall/open.32 (run as root)           [00:00] [PASS]
Test: /opt/os-tests/tests/syscall/open.64 (run as root)           [00:00] [PASS]
Test: /opt/os-tests/tests/timer/timer_limit (run as root)         [00:00] [PASS]
Test: /opt/os-tests/tests/uccid/atrparse (run as root)            [00:00] [PASS]

Results Summary
PASS      56
FAIL       1

Running Time:   00:03:05
Percent passed: 98.2%

I also went and manually set the coreadm path to a real location and verified that it came back:

rm@iliad:~$ coreadm -g /var/tmp/%f.core
rm@iliad:~$ coreadm 
     global core file pattern: /var/tmp/%f.core
     global core file content: default
       init core file pattern: core
       init core file content: default
            global core dumps: enabled
       per-process core dumps: enabled
      global setid core dumps: disabled
 per-process setid core dumps: disabled
     global core dump logging: disabled
rm@iliad:~$ /opt/os-tests/tests/i386/badseg
++ /usr/bin/svcprop -p config_params/global_enabled coreadm
+ old_enabled=true
++ /usr/bin/svcprop -p config_params/global_pattern coreadm
+ old_pattern=/var/tmp/%f.core
++ /usr/bin/svcprop -p config_params/global_log_enabled coreadm
+ old_log=false
+ mkfile 1m /var/cores/badseg_exec
Could not open /var/cores/badseg_exec: Permission denied
rm@iliad:~$ //opt/oopt/os-t^Cts/tests/i386/badseg
rm@iliad:~$ pfexec /opt/os-tests/tests/i386/badseg
++ /usr/bin/svcprop -p config_params/global_enabled coreadm
+ old_enabled=true
++ /usr/bin/svcprop -p config_params/global_pattern coreadm
+ old_pattern=/var/tmp/%f.core
++ /usr/bin/svcprop -p config_params/global_log_enabled coreadm
+ old_log=false
+ mkfile 1m /var/cores/badseg_exec
+ coreadm -e global -d log -g /var/cores/%f/%p
+ sleep 3
++ dirname /opt/os-tests/tests/i386/badseg
+ /opt/os-tests/tests/i386/badseg_exec
+ [[ /var/tmp/%f.core = \"\" ]]
+ coreadm -g /var/tmp/%f.core
+ [[ true = \t\r\u\e ]]
+ coreadm -e global
+ [[ false = \t\r\u\e ]]
+ rm -f /var/cores/badseg_exec
rm@iliad:~$ coreadm 
     global core file pattern: /var/tmp/%f.core
     global core file content: default
       init core file pattern: core
       init core file content: default
            global core dumps: enabled
       per-process core dumps: enabled
      global setid core dumps: disabled
 per-process setid core dumps: disabled
     global core dump logging: disabled
Actions #4

Updated by Electric Monk 6 months ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit e43afc9605f99023dbdb4a7b5309de87e6016db6

commit  e43afc9605f99023dbdb4a7b5309de87e6016db6
Author: Robert Mustacchi <rm@fingolfin.org>
Date:   2021-11-18T23:33:38.000Z

    14230 badseg test leaves coreadm in maintenance
    Reviewed by: Yuri Pankov <ypankov@tintri.com>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Rich Lowe <richlowe@richlowe.net>

Actions

Also available in: Atom PDF