Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Wiki Markup
When certain kinds of errors are detected, such as irrecoverable logic errors, rather than risk data corruption by continuing to execute in an indeterminate state, the appropriate strategy may be for the system to quickly shut down, allowing the operator to start it afresh in a determinate state.
 Section 6.46, "Termination Strategy \[REU\]," \[[ISO/IEC TR 24772:2010|AA. Bibliography#ISOReferences#ISO/IEC TR 24772-2010]\] says:

...

Wiki Markup
{{Runtime.exit()}} is the typical way of exiting a program. According to the Java API \[[API 06|AA. Bibliography#APIReferences#API 06]\] {{Runtime.exit()}}:

...

Wiki Markup
{{Runtime.halt()}} is similar to {{Runtime.exit()}} but does _not_ run shutdown hooks or finalizers. According to the Java API \[[API 06|AA. Bibliography#APIReferences#API 06]\], {{Runtime.halt()}}

...

Wiki Markup
According to the Java API \[[API 2006|AA. Bibliography#APIReferences#API 06]\], Class {{Runtime}}, method {{addShutdownHook()}},

...

Wiki Markup
To avoid race conditions or deadlock between shutdown actions, it may be better to run a series of shutdown tasks from one thread by using a single shutdown hook \[[Goetz 2006|AA. Bibliography#GoetzReferences#Goetz 06]\].

This compliant solution shows the standard method to install a hook.

...

The CERT C Secure Coding Standard

ERR04-C. Choose an appropriate termination strategy

The CERT C++ Secure Coding Standard

ERR04-CPP. Choose an appropriate termination strategy

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="f255c170459848eb-8e709041-441b43c1-a81890ba-50ea5e43d25013adc3bd2806"><ac:plain-text-body><![CDATA[

[ISO/IEC TR 24772:2010

http://www.aitcnet.org/isai/]

Termination Strategy [REU]

]]></ac:plain-text-body></ac:structured-macro>

MITRE CWE

CWE-705. Incorrect control flow scoping

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="5175b1e1f56df200-88ce8020-403445bc-a47197b2-eb3e463b6b67dc17a31fbf62"><ac:plain-text-body><![CDATA[

[[API 06

AA. Bibliography#API References#API 06]]

[Class Runtime

http://download.oracle.com/javase/6/docs/api/java/lang/Runtime.html]

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="737347fd58faffe3-0c96f21f-49eb4ea2-85099d32-a562dbc9ad3ea1289bdb7e65"><ac:plain-text-body><![CDATA[

[[ISO/IEC TR 24772:2010

AA. Bibliography#ISOReferences#ISO/IEC TR 24772-2010]]

Section 6.46, Termination Strategy [REU]

]]></ac:plain-text-body></ac:structured-macro>

...