summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-08-18 04:32:59 (GMT)
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-08-18 04:32:59 (GMT)
commit9ab43c7a6c0dc3c661ffb621714ee0c62bdd4566 (patch)
tree7134c6e4bde868d6b435c5bb0b513ed4a1257070
parentad6ffac7d6121c193b95c15bc011c9969967f554 (diff)
merge revision(s) f91879a7b548284c93743168acfd11e3d2aeefac: [Backport #15992]
handle_interrupt to defend monitor state [Bug #15992] If an exception is raised from another thread for example Timeout and this thread is just after `mon_exit`'s `@mon_owner = nil`, the exception breaks the state of MonitorMixin. To prevent that situation, it need to block interruption in mon_enter and mon_exit. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--lib/monitor.rb6
-rw-r--r--version.h4
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/monitor.rb b/lib/monitor.rb
index 999795c..5b6b14e 100644
--- a/lib/monitor.rb
+++ b/lib/monitor.rb
@@ -225,11 +225,13 @@ module MonitorMixin
# +MonitorMixin+.
#
def mon_synchronize
- mon_enter
+ # Prevent interrupt on handling interrupts; for example timeout errors
+ # it may break locking state.
+ Thread.handle_interrupt(Exception => :never){ mon_enter }
begin
yield
ensure
- mon_exit
+ Thread.handle_interrupt(Exception => :never){ mon_exit }
end
end
alias synchronize mon_synchronize
diff --git a/version.h b/version.h
index 7ff4100..cf71153 100644
--- a/version.h
+++ b/version.h
@@ -1,10 +1,10 @@
#define RUBY_VERSION "2.6.3"
#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
-#define RUBY_PATCHLEVEL 92
+#define RUBY_PATCHLEVEL 93
#define RUBY_RELEASE_YEAR 2019
#define RUBY_RELEASE_MONTH 8
-#define RUBY_RELEASE_DAY 11
+#define RUBY_RELEASE_DAY 18
#include "ruby/version.h"