# \[Bug #1763\] SecurityError on an Exception object because of modification of instance variable #\_\_Thr

**URL:** <https://www.ruby-forum.com/t/bug-1763-securityerror-on-an-exception-object-because-of-modification-of-instance-variable-thr/171925>\
**Category:** Development\
**Created:** [July 11, 2009, 5:04pm UTC](https://www.ruby-forum.com/t/bug-1763-securityerror-on-an-exception-object-because-of-modification-of-instance-variable-thr/171925 "2009-07-11T17:04:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 11, 2009, 5:04pm UTC](https://www.ruby-forum.com/t/bug-1763-securityerror-on-an-exception-object-because-of-modification-of-instance-variable-thr/171925/1 "2009-07-11T17:04:14Z")

</div>

Bug #1763: SecurityError on an Exception object because of modification  
of instance variable # **ThrowState**  
[http://redmine.ruby-lang.org/issues/show/1763](http://redmine.ruby-lang.org/issues/show/1763)

e$B5/I\<\<Te(B: Hidetoshi Nagai  
e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal  
ruby -v: ruby 1.9.2dev (2009-07-08) [i686-linux]

## e$B0J2\<$h$&$JNc$G!$Nc30%_%V%8%'%/%H$N%$%s%9%?%s%9JQ?te(B (# **ThrowState** ) e$BA`:n$Ne(B SecurityError e$B$H$J$j!$E,@Z$JNc30\>u67$rB_$($k$3$H$,$G$-$^$;$s!%e(B

cmd = proc{p “cmd: safe\_level == #{$SAFE}”; raise SystemExit}  
safe0\_p = proc{|\*args| p args}

## proc{ $SAFE = 4 begin cmd.call rescue SystemExit =\> e safe0\_p[“SystemExit: #{e.inspect}”] raise e rescue Exception =\> e safe0\_p[“Exception (NOT SystemExit): #{e.inspect}”] raise e end }.call

vm.c e$B$Ne(B vm\_exec()  
e$B$NCf$G@\_Dj$7$h$&$H$7$F$$$k$?$a!$%f!\<%6$K$h$kBP=h$,6K$a$F:$Fq$G$9!%e(B  
e$BNc30%\*%V%8%'%/%H$Ke(B untrust e$B@\_Dj$7$h$&$K$b!$e(B  
$SAFE==0 e$B$Ne(B cmd e$B$+$i8+$F30B&$Ne(B safe level  
e$B$OJ,$+$j$^$;$s$+$ie(B  
untrust e$B$9$Y$-$+$I$&$+H=CG$G$-$^$;$s$7!$e(B  
e$B$=$N30B&$Oe(B $SAFE==4 e$B$G$9$N$Ge(B untrust  
e$B@\_Dj$9$k8"8B$,$"$j$^$;$s!%e(B

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 16, 2009, 11:37am UTC](https://www.ruby-forum.com/t/bug-1763-securityerror-on-an-exception-object-because-of-modification-of-instance-variable-thr/171925/2 "2009-07-16T11:37:47Z")

</div>

e$B%A%1%C%He(B #1763 e$B$,99?7$5$l$^$7$?!#e(B (by Nobuyoshi N.)

e$B%9%F!\<%?%9e(B Assignede$B$+$ie(BClosede$B$KJQ99e(B  
e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B

## Applied in changeset r24148.

[http://redmine.ruby-lang.org/issues/show/1763](http://redmine.ruby-lang.org/issues/show/1763)
