[polyml] 06/07: Added patch wait-return-valid-status.diff
James Clarke
jrtc27-guest at moszumanska.debian.org
Mon Apr 25 20:35:52 UTC 2016
This is an automated email from the git hooks/post-receive script.
jrtc27-guest pushed a commit to branch master
in repository polyml.
commit 0ea1d532da75996906d2712f2c7b205335ced5d8
Author: James Clarke <jrtc27 at jrtc27.com>
Date: Mon Apr 25 21:12:50 2016 +0100
Added patch wait-return-valid-status.diff
This fixes a Fail "Unknown result status" exception being raised
occasionally.
---
debian/changelog | 3 +++
debian/patches/series | 1 +
debian/patches/wait-return-valid-status.diff | 30 ++++++++++++++++++++++++++++
3 files changed, 34 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 92b3171..ba332d9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,9 @@ polyml (5.6-6) UNRELEASED; urgency=medium
- reset-save-vector-sleep.diff: Ensure the save vector is reset when
sleeping in Posix.Process.sleep. This stops the save vector from
potentially overflowing and causing an assertion failure.
+ - wait-return-valid-status.diff: Only return the "status" value from
+ "wait" if the result is non-zero. This fixes a Fail "Unknown result
+ status" exception being raised occasionally.
-- James Clarke <jrtc27 at jrtc27.com> Mon, 25 Apr 2016 19:38:35 +0100
diff --git a/debian/patches/series b/debian/patches/series
index 83915c0..e0c1e51 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -26,3 +26,4 @@ hppa.diff
thread-exited-interrupt-requested-overlap.diff
polyc-it.diff
reset-save-vector-sleep.diff
+wait-return-valid-status.diff
diff --git a/debian/patches/wait-return-valid-status.diff b/debian/patches/wait-return-valid-status.diff
new file mode 100644
index 0000000..c49d59f
--- /dev/null
+++ b/debian/patches/wait-return-valid-status.diff
@@ -0,0 +1,30 @@
+Description: Only return the "status" value from "wait" if the result is
+ non-zero. The calling code in the Posix structure converts the status result
+ to a value of type exit_status even if the pid is zero. The result is
+ ignored in that case but it can result in a Fail exception if the status is
+ invalid.
+Origin: backport, https://github.com/polyml/polyml/commit/ba608ceb1dbc20db934bd01b0bccdd50c08ac4e9
+Author: David Matthews <dm at prolingua.co.uk>
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/libpolyml/unix_specific.cpp
++++ b/libpolyml/unix_specific.cpp
+@@ -1256,7 +1256,7 @@
+ int callFlags = get_C_long(taskData, DEREFHANDLE(args)->Get(2));
+ int flags = callFlags | WNOHANG; // Add in WNOHANG so we never block.
+ pid_t pres = 0;
+- int status;
++ int status = 0;
+ switch (kind)
+ {
+ case 0: /* Wait for any child. */
+@@ -1292,7 +1292,8 @@
+ {
+ Handle result, pidHandle, resHandle;
+ pidHandle = Make_arbitrary_precision(taskData, pres);
+- resHandle = Make_arbitrary_precision(taskData, status);
++ // If the pid is zero status may not be a valid value and may overflow.
++ resHandle = Make_arbitrary_precision(taskData, pres == 0 ? 0: status);
+
+ result = ALLOC(2);
+ DEREFHANDLE(result)->Set(0, DEREFWORDHANDLE(pidHandle));
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/polyml.git
More information about the debian-science-commits
mailing list