Content deleted Content added
Rescuing 1 sources and tagging 0 as dead. #IABot (v2.0beta15) |
m Disambiguating links to SUSE (link changed to SUSE S.A.) using DisamAssist. |
||
(18 intermediate revisions by 14 users not shown) | |||
Line 1:
{{Short description|Field of research in computer science}}
In [[computer science]], '''dynamic software updating''' ('''DSU''') is a field of research pertaining to [[upgrade|upgrading]] programs while they are running. DSU is not currently widely used in industry. However, researchers have developed a wide variety of systems and techniques for implementing DSU. These systems are commonly tested on real-world programs.
Line 4 ⟶ 5:
== Introduction ==
Any running program can be thought of a [[tuple]] <math>(\delta, P)</math>, where <math>\delta</math> is the current program state and <math>P</math> is the current program code. Dynamic software updating systems transform a running program <math>(\delta, P)</math> to a new version <math>(\delta', P')</math>. In order to do this, the state must be transformed into the representation <math>P'</math> expects. This requires a ''state transformer'' function. Thus, DSU transforms a program <math>(\delta, P)</math> to <math>(S (\delta), P')</math>. An update is considered '''valid''' if and only if the running program <math>(S (\delta), P')</math> can be reduced to a point tuple <math>(\delta, P')</math> that is reachable from the starting point of the new version of the program, {{nobr|1=<math>(\delta_{init}, P')</math>.<ref name="gupta">{{cite journal
| author-last1 = Gupta | author-first1 = Deepak
| author-last2 = Jalote | author-first2 = Pankaj
Line 14 ⟶ 15:
| archive-url = https://web.archive.org/web/20140407175809/http://www.win.tue.nl/~hmei/SoftwareUpdate/A%20formal%20framework%20for%20on-line%20software%20version%20change.pdf
| archive-date = 2014-04-07
|
| year = 1996 | doi = 10.1109/32.485222
}}</ref>}}
The ___location in a program where a dynamic update occurs is referred to as an '''update point'''. Existing DSU implementations vary widely in their treatment of update points. In some systems, such as [[#UpStare|UpStare]] and [[#PoLUS|PoLUS]], an update can occur at any time during execution. [[#Ginseng|Ginseng]]'s compiler will attempt to infer good locations for update points, but can also use programmer-specified update points. [[#Kitsune and Ekiden|Kitsune and Ekiden]] require developers to manually specify and name all update points.
Line 29 ⟶ 30:
The problem space addressed by dynamic updating can be thought of as an intersection of several others. Examples include [[checkpointing]], [[dynamic linking]], and [[Persistence (computer science)|persistence]]. As an example, a database that must be [[backward-compatible]] with previous versions of its on-disk file format, must accomplish the same type of state transformation expected of a dynamic updating system. Likewise, a program that has a plugin architecture, must be able to load and execute new code at runtime.
Similar techniques are sometimes also employed for the purpose of [[dynamic dead-code elimination]] to remove conditionally [[dead code|dead]] or [[unreachable code]] at load or runtime, and recombine the remaining code to minimize its [[memory footprint]] or improve speed.<ref name="Paul_1997_FreeKEYB">{{
| title = FreeKEYB - Enhanced DOS keyboard and console driver
| edition = v6.5
Line 36 ⟶ 37:
| type = User Manual
| date = 1997-10-13 | orig-year = first published 1991
}} [https://web.archive.org/web/20190309194320/http://sta.c64.org/dosprg/fk657p1.zip<!-- FreeKEYB 6.57p1 Beta as of 2004-08-17 with outdated and incomplete documentation -->] (NB. The K3PLUS successor FreeKEYB is a fully reconfigurable driver with many dynamically loadable special features. It implements a unique form of byte-level granular [[dynamic dead code elimination]] and [[relocation (computing)|relocation]] techniques at [[load-time]] as well as [[self-modifying code]] and reconfigurability at [[runtime (computing)|run-time]] to minimize its memory footprint close to the [[canonical form]] depending on the hardware, operating system, other environment and driver configuration as well as the selected feature set and locale (about sixty configuration switches with hundreds of options for an almost unlimited number of possible combinations). The build process utilizes a [[macro assembler]] as well as a framework of automatic pre- and post-processing tools analyzing the temporary binaries to generate dependency and [[code morphing]] [[meta data]] to be embedded into the resulting [[executable file]] alongside the [[binary code]] and a self-discarding, [[instruction relaxation|relaxing]] and [[relocating loader]] to dynamically (re)combine, (over)load, modify, update or unload the runtime image (code and data) of the driver as requested. The complexity is hidden in a single self-contained file so that for a user the handling is the same as for a normal (semi-)monolithic driver/[[
| title = FreeKEYB - Advanced international DOS keyboard and console driver
| edition = v7 preliminary
Line 54 ⟶ 55:
| year = 1983 | publisher = University of Wisconsin - Madison
| url = http://www.cis.upenn.edu/~lee/mydissertation.doc
|
| archiveurl = https://web.archive.org/web/20030916031953/http://www.cis.upenn.edu/~lee/mydissertation.doc
| archivedate = 2003-09-16
Line 103 ⟶ 104:
}}</ref>
If the target program is implemented in a [[virtual machine]] language, the VM can use existing infrastructure to load new code, since modern virtual machines support runtime loading for other use cases besides DSU (mainly [[debugging]]). The [[HotSpot (virtual machine)|HotSpot]] [[JVM]] supports runtime code loading, and DSU systems targeting [[Java (programming language)]] can utilize this feature.
In native languages such as [[C (programming language)|C]] or [[C++]], DSU systems can use specialized compilers that insert indirection into the program. At update time, this indirection is updated to point to the newest version. If a DSU system does not use a compiler to insert these indirections statically, it insert them at runtime with [[binary rewriting]]. Binary rewriting is the process of writing low-level code into the memory image of a running native program to re-direct functions. While this requires no static analysis of a program, it is highly platform-dependent.
Line 143 ⟶ 144:
| year = 2006 | citeseerx = 10.1.1.625.4663 }}</ref> If a function is proven ''cons-free'', it can be updated even if it is live on the stack, since it will not cause a type error by accessing state using the old representation.
Empirical analysis of ''cons-freeness'' and activeness safety by Hayden et
==Existing systems==
Line 153 ⟶ 154:
{{Category see also|Linux kernel live patching}}
[[Ksplice]] is a DSU system that targets only the [[Linux kernel]], making itself one of the specialized DSU systems that support an [[operating system kernel]] as the target program. Ksplice uses source-level [[diff]]s to determine changes between current and updated versions of the Linux kernel, and then uses binary rewriting to insert the changes into the running kernel.<ref name="ksplice">{{cite book
| title = Ksplice: automatic rebootless kernel updates▼
| author-first1 = Jeff | author-last1 = Arnold
| author-first2 = M. Frans | author-last2 = Kaashoek | author-link2 = Frans Kaashoek
|
| year = 2009
▲ | journal = Proceedings of the 4th ACM European Conference on Computer Systems
| hdl = 1721.1/51698 | url = https://www.ksplice.com/doc/ksplice.pdf▼
▲ | pages = 187 | doi = 10.1145/1519065.1519085
| isbn = 9781605584829 | s2cid = 7720018 }}</ref> Ksplice was maintained by a commercial venture founded by its original authors, Ksplice Inc., which was acquired by [[Oracle Corporation]] in July 2011.<ref>{{cite news▼
▲ | url = https://www.ksplice.com/doc/ksplice.pdf
▲| isbn = 9781605584829 }}</ref> Ksplice was maintained by a commercial venture founded by its original authors, Ksplice Inc., which was acquired by [[Oracle Corporation]] in July 2011.<ref>{{cite news
| url = http://www.oracle.com/us/corporate/Acquisitions/ksplice/index.html
| title = Oracle and Ksplice
Line 171 ⟶ 172:
}}</ref>
[[SUSE S.A.|SUSE]] developed [[kGraft]] as an open-source alternative for live kernel patching, and [[Red Hat]] did likewise with [[kpatch]]. They both allow function-level changes to be applied to a running Linux kernel, while relying on live patching mechanisms established by [[ftrace]]. The primary difference between kGraft and kpatch is the way they ensure runtime consistency of the updated code sections while [[hot patch]]es are applied. kGraft and kpatch were submitted for inclusion into the [[Linux kernel mainline]] in April 2014 and May 2014, respectively,<ref name="lwn-597123">{{cite web
| url = https://lwn.net/Articles/597123/
| title = kpatch: dynamic kernel patching
Line 225 ⟶ 226:
| author-first2 = Rida A. | author-last2 = Bazzi
| journal = Proceedings of the 2009 Conference on USENIX Annual Technical Conference
| url =
| year = 2009
}}</ref>
Line 249 ⟶ 250:
| archive-url = https://web.archive.org/web/20120426060636/http://ppi.fudan.edu.cn/system/publications/paper/chen-polus.pdf
| archive-date = 2012-04-26
|
}}</ref>
Line 275 ⟶ 276:
| date = 2013-03-06 | accessdate = 2014-11-27
| author-first = Sébastien | author-last = Martinez
| publisher = [[Bitbucket
}}</ref>
=== Microsoft Visual C++ ===
Microsoft is utilizing internal patching technology for Microsoft Visual C++ that supports patching individual C++ functions while maintaining functional correctness of patches. Currently known applications is SQL Server in Azure SQL Database.<ref>{{Cite web|url=https://techcommunity.microsoft.com/t5/Azure-SQL-Database/Hot-Patching-SQL-Server-Engine-in-Azure-SQL-Database/ba-p/849700|title=Hot Patching SQL Server Engine in Azure SQL Database|date=2019-09-11|website=TECHCOMMUNITY.MICROSOFT.COM|language=en|access-date=2019-09-15}}</ref>
== See also ==
*
* [[Persistence (computer science)]]
* [[Runtime verification]]
Line 293 ⟶ 297:
* [http://www.erlang.org Erlang homepage]
* [http://www.nongnu.org/katana/doc/katana.html Katana homepage]
* [https://techcommunity.microsoft.com/t5/Azure-SQL-Database/Hot-Patching-SQL-Server-Engine-in-Azure-SQL-Database/ba-p/849700 Whitepaper blog post on Visual C++ patching]
[[Category:System administration]]
|