test/hotspot/jtreg/runtime/signal/README
author phh
Sat, 30 Nov 2019 14:33:05 -0800
changeset 59330 5b96c12f909d
parent 49662 3614cbddd005
permissions -rw-r--r--
8234541: C1 emits an empty message when it inlines successfully Summary: Use "inline" as the message when successfull Reviewed-by: thartmann, mdoerr Contributed-by: navy.xliu@gmail.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
49662
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
     1
Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
     2
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
     3
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
     4
This code is free software; you can redistribute it and/or modify it
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
     5
under the terms of the GNU General Public License version 2 only, as
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
     6
published by the Free Software Foundation.
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
     7
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
     8
This code is distributed in the hope that it will be useful, but WITHOUT
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
     9
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    10
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    11
version 2 for more details (a copy is included in the LICENSE file that
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    12
accompanied this code).
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    13
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    14
You should have received a copy of the GNU General Public License version
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    15
2 along with this work; if not, write to the Free Software Foundation,
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    16
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    17
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    18
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    19
or visit www.oracle.com if you need additional information or have any
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    20
questions.
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    21
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    22
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    23
Briefly, the tests cover the following scenarios:
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    24
1. prepre
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    25
   set signal handlers -> create JVM -> send signals -> destroy JVM -> check signal handlers were called
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    26
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    27
2. prepost
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    28
   set signal handlers -> create JVM -> destroy JVM -> send signals  -> check signal handlers were called
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    29
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    30
3. postpre
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    31
   create JVM ->set signal handlers -> send signals -> destroy JVM -> check signal handlers were called
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    32
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    33
4. postpost
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    34
   create JVM -> set signal handlers -> destroy JVM -> send signals  -> check signal handlers were called
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    35
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    36
There is one more scenario called 'nojvm'.
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    37
In this case no jvm is created, so pure signal testing is done.
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    38
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    39
Signal handlers don't do anything, so the only fact that signal handler was called is checked.
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    40
Also 2 different ways of setting signal handlers are tested: sigaction, sigset.
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    41
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    42
For 'postpre' and 'postpro' libjsig.so is used to chain signal handlers behind VM installed ones.
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    43
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    44
=> Current tests cover the following cases (don't count 'nojvm' scenario):
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    45
1. Support for pre-installed signal handlers when the HotSpot VM is created.
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    46
2. Support for signal handler installation after the HotSpot VM is created inside JNI code
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    47
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    48
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    49
Notes:
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    50
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    51
SIGQUIT, SIGTERM, SIGINT, and SIGHUP signals cannot be chained.
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    52
If the application needs to handle these signals, the -Xrs option needs
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    53
to be specified. So, test these signals only with -Xrs flag.
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    54
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    55
On Linux and Mac OS X, SIGUSR2 is used to implement suspend and resume. So,
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    56
don't test SIGUSR2 on Linux and Mac OS X.
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    57
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    58
SIGJVM1 and SIGJVM2 exist only on Solaris and are reserved for exclusive use
3614cbddd005 8200126: [TESTBUG] Open source VM runtime signal tests
mseledtsov
parents:
diff changeset
    59
by the JVM. So don't test SIGJVM1 and SIGJVM2.