Hi John<div><br></div><div>  ok, I get it.  Ignore the previous message.  Apologies.<br><br><div class="gmail_quote">On Fri, Jul 10, 2009 at 11:29 AM, John M McIntosh <span dir="ltr">&lt;<a href="mailto:johnmci@smalltalkconsulting.com">johnmci@smalltalkconsulting.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
As a reminder if this is being executed on a closure VM there is a bug in the VM where interacting with the SecurityPlugin<br>
can cause the VM to crash even if the image is not a closure based  image.  I attached the earlier note detailing this problem<br>
<br>
On 10-Jul-09, at 10:16 AM, Yoshiki Ohshima wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
At Fri, 10 Jul 2009 08:26:49 -0700,<br>
Yoshiki Ohshima wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
At Fri, 10 Jul 2009 00:10:10 -0700,<br>
Andreas Raab wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
The installer works fine but once I&#39;ve installed it I get VM crashes<br>
when trying to use the plugin a browser, regardless of which browser<br>
(Firefox, IE7, Chrome).<br>
<br>
The crashes are extremely similar, see below:<br>
</blockquote>
<br>
 Thank you for testing.  I do get the crash, actually, too.<br>
<br>
 One theory floating was OggPlugin, but removing it seems to take any<br>
effect.  As the debug log suggests, it could be in the security<br>
plugin.  I wonder what has changed.  I&#39;ll look into it.<br>
</blockquote>
<br>
 It works fine with the VM we used to distribute with the previous<br>
public installer, which claim to be 3.10.10 but I think with some<br>
modification on the SecurityPlugin where it expands the<br>
pseudo-variables like %MYDOCUMENTS% in etoys.ini.  (But after<br>
substituting them in the .ini files it still crashes, so the expanding<br>
them may not be a problem.)<br>
<br>
 If I put self halt in #enterRestrictedMode and step execute it, it<br>
goes through fine.  It seems to suggest that some stack unbalance in a<br>
primitive (disableFileAccess or disableImageWrite) may be the issue.<br>
<br>
 For the interest of release time, I think I put up an installer with<br>
the old VM for now, and look into the difference from it and 3.11.2<br>
VM.<br>
<br>
-- Yoshiki<br>
</blockquote>
<br>
<br>
<br>
----------<br>
<br>
Begin forwarded message:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
From: John M McIntosh &lt;<a href="mailto:johnmci@smalltalkconsulting.com" target="_blank">johnmci@smalltalkconsulting.com</a>&gt;<br>
Date: May 3, 2009 1:58:29 PM PDT (CA)<br>
To: Andreas Raab &lt;<a href="mailto:andreas.raab@gmx.de" target="_blank">andreas.raab@gmx.de</a>&gt;<br>
Subject: Fwd: Squeak crash<br>
<br>
<br>
<br>
Sent from my iPhone<br>
<br>
Begin forwarded message:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
From: John McIntosh &lt;<a href="mailto:johnmci@smalltalkconsulting.com" target="_blank">johnmci@smalltalkconsulting.com</a>&gt;<br>
Date: May 3, 2009 1:43:21 PM PDT (CA)<br>
To: Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt;<br>
Cc: Bert Freudenberg &lt;<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>&gt;<br>
Subject: Re: Squeak crash<br>
<br>
Ok I&#39;m older and wiser this morning now if I had turned check for<br>
balanced stacks about a day ago the answer would be clearer.It seem<br>
the code in disable read write pops the stack which unbalanced it.<br>
Then the push literal sticks that constant in but then the method<br>
return true uses that as the content index where in the past that slot<br>
wasn&#39;t used or critical, so now you die<br>
<br>
I think andreas wrote the original security code, also was there not<br>
some recovery code for unbalanced stacks somewhere?  My concern is<br>
there other example of this which we not yet crashed over. So how<br>
would we fix the VM to avoid? Or do we need to check all the plugin<br>
prim code for coding issues.<br>
<br>
On 5/2/09, John M McIntosh &lt;<a href="mailto:johnmci@smalltalkconsulting.com" target="_blank">johnmci@smalltalkconsulting.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On 30-Apr-09, at 9:12 AM, Eliot Miranda wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
John,<br>
<br>
   I owuld run under gdb, put a halt somehwere after the context is<br>
created and before the primitive is called at put a watch on the<br>
address of closureOrNil.<br>
</blockquote>
<br>
Ok, I&#39;m older, but not sure I&quot;m wiser...  However<br>
<br>
what i did is use some of the message send tracing code to break at<br>
the point of the enterRestrictedMode send, then look at the method<br>
contexts being allocated.<br>
A quick check showed the message context was the third back from the<br>
point of break on message send of enterRestrictedMode/<br>
<br>
problem context is at<br>
S2077c9cc   &lt;----- third back<br>
S207a1644<br>
S207a16a0(gdb) hereweare<br>
Undefined command: &quot;hereweare&quot;.  Try &quot;help&quot;.<br>
(gdb) 1f4367a4  is the problem at 0x14 from 2077c9cc<br>
5f e3 9a 05 80 bc 77 20 e3 00 00 00 01 00 00 00<br>
80 86 42 20 a4 67 43 1f 30 3b 8f 1f 30 3b 8f 1f<br>
<br>
method is<br>
enterRestrictedMode<br>
<br>
run again, now the context is 0x2077ceac, a set up of a<br>
watch location for 0x14 from the start of the context triggers on the<br>
longAtPointerput.<br>
<br>
       CASE(81)<br>
           /* pushLiteralVariableBytecode */<br>
           {<br>
               flag(&quot;requires currentBytecode to be expanded to a constant&quot;);<br>
               /* begin fetchNextBytecode */<br>
               currentBytecode = byteAtPointer(++localIP);<br>
               /* begin pushLiteralVariable: */<br>
               /* begin internalPush: */<br>
               longAtPointerput(localSP += BytesPerWord, longAt(((longAt((foo-<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
method + BaseHeaderSize) + (((81 &amp; 31) + LiteralStart) &lt;&lt;<br>
</blockquote>
ShiftForWord))) + BaseHeaderSize) + (ValueIndex &lt;&lt; ShiftForWord)));<br>
           }<br>
;<br>
<br>
<br>
localReturnContext is 0x2077ceac<br>
localHomeContext is 0x2077ceac<br>
local SP is 0x2077cec0<br>
local IP is 0x204286fc<br>
currentByteCode is 112<br>
<br>
which stuffs 0x1f4367a4 into 0x2077cec0 which<br>
is offset 0x14 in localReturnContext<br>
<br>
then on the returnTrue for context 0x2077ceac we see the 0x1f4367a4<br>
and start the while loop until we get a memory exception...<br>
<br>
So let&#39;s look at the code.<br>
<br>
enterRestrictedMode<br>
   &quot;Some insecure contents was encountered. Close all doors and proceed.&quot;<br>
   self isInRestrictedMode ifTrue:[^true].<br>
   (SugarLauncher isRunningInRainbow or: [Preferences<br>
securityChecksEnabled not]) ifTrue: [^true]. &quot;it&#39;s been your choice...&quot;<br>
   Preferences warnAboutInsecureContent ifTrue:[<br>
       (PopUpMenu confirm:<br>
&#39;You are about to load some insecure content.<br>
If you continue, access to files as well as<br>
some other capabilities will be limited.&#39; translated<br>
           trueChoice:&#39;Load it anyways&#39; translated<br>
           falseChoice:&#39;Do not load it&#39; translated) ifFalse:[<br>
               &quot;user doesn&#39;t really want it&quot;<br>
               ^false.<br>
           ].<br>
   ].<br>
   &quot;here goes the actual restriction&quot;<br>
   self flushSecurityKeys.<br>
   self disableFileAccess.<br>
   self disableImageWrite.<br>
   &quot;self disableSocketAccess.&quot;<br>
   FileDirectory setDefaultDirectory: self untrustedUserDirectory.<br>
   ^true<br>
<br>
I note we are at case(81) which is hex 51 which I guess would be the<br>
120 &lt;51&gt; pushLit: FileDirectory<br>
<br>
81 &lt;70&gt; self<br>
82 &lt;D0&gt; send: isInRestrictedMode<br>
83 &lt;98&gt; jumpFalse: 85<br>
84 &lt;79&gt; return: true<br>
85 &lt;45&gt; pushLit: SugarLauncher<br>
86 &lt;D4&gt; send: isRunningInRainbow<br>
87 &lt;99&gt; jumpFalse: 90<br>
88 &lt;71&gt; pushConstant: true<br>
89 &lt;92&gt; jumpTo: 93<br>
90 &lt;43&gt; pushLit: Preferences<br>
91 &lt;D2&gt; send: securityChecksEnabled<br>
92 &lt;D1&gt; send: not<br>
93 &lt;98&gt; jumpFalse: 95<br>
94 &lt;79&gt; return: true<br>
95 &lt;43&gt; pushLit: Preferences<br>
96 &lt;DC&gt; send: warnAboutInsecureContent<br>
97 &lt;AC 0C&gt; jumpFalse: 111<br>
99 &lt;47&gt; pushLit: PopUpMenu<br>
100 &lt;29&gt; pushConstant: &#39;You are about to load some insecure content.<br>
If you continue, access to files as well as<br>
some other capabilities will be limited.&#39;<br>
101 &lt;D8&gt; send: translated<br>
102 &lt;2A&gt; pushConstant: &#39;Load it anyways&#39;<br>
103 &lt;D8&gt; send: translated<br>
104 &lt;2B&gt; pushConstant: &#39;Do not load it&#39;<br>
105 &lt;D8&gt; send: translated<br>
106 &lt;83 66&gt; send: confirm:trueChoice:falseChoice:<br>
108 &lt;A8 01&gt; jumpTrue: 111<br>
110 &lt;7A&gt; return: false<br>
111 &lt;70&gt; self<br>
112 &lt;DD&gt; send: flushSecurityKeys<br>
113 &lt;87&gt; pop<br>
114 &lt;70&gt; self<br>
115 &lt;DE&gt; send: disableFileAccess<br>
116 &lt;87&gt; pop<br>
117 &lt;70&gt; self<br>
118 &lt;DF&gt; send: disableImageWrite<br>
119 &lt;87&gt; pop<br>
120 &lt;51&gt; pushLit: FileDirectory<br>
121 &lt;70&gt; self<br>
122 &lt;83 12&gt; send: untrustedUserDirectory<br>
124 &lt;83 30&gt; send: setDefaultDirectory:<br>
126 &lt;87&gt; pop<br>
127 &lt;79&gt; return: true<br>
<br>
Let&#39;s see if anything looks interesting<br>
<br>
 disableImageWrite<br>
   &quot;SecurityManager default disableImageWrite&quot;<br>
   &quot;Primitive. Disable writing to an image file.<br>
   Cannot be revoked from the image.&quot;<br>
   &lt;primitive: &#39;primitiveDisableImageWrite&#39; module: &#39;SecurityPlugin&#39;&gt;<br>
   ^self primitiveFailed<br>
<br>
EXPORT(sqInt) primitiveDisableImageWrite(void) {<br>
   ioDisableImageWrite();<br>
   if (!(interpreterProxy-&gt;failed())) {<br>
       interpreterProxy-&gt;pop(1);<br>
   }<br>
}<br>
<br>
<br>
int ioDisableImageWrite() {<br>
  allowImageWrite = 0;<br>
   return 0;<br>
}<br>
<br>
<br>
disableFileAccess<br>
   &quot;SecurityManager default disableFileAccess&quot;<br>
   &quot;Primitive. Disable unlimited access to files.<br>
   Cannot be revoked from the image.&quot;<br>
   &lt;primitive: &#39;primitiveDisableFileAccess&#39; module: &#39;FilePlugin&#39;&gt;<br>
   ^self primitiveFailed<br>
<br>
<br>
EXPORT(sqInt) primitiveDisableFileAccess(void) {<br>
   if (sDFAfn != 0) {<br>
        ((sqInt (*)(void))sDFAfn)();<br>
   }<br>
   if (!(interpreterProxy-&gt;failed())) {<br>
       interpreterProxy-&gt;pop(1);<br>
   }<br>
}<br>
<br>
   sDFAfn = interpreterProxy-&gt;ioLoadFunctionFrom(&quot;secDisableFileAccess&quot;,<br>
&quot;SecurityPlugin&quot;);<br>
<br>
<br>
EXPORT(sqInt) secDisableFileAccess(void) {<br>
   return ioDisableFileAccess();<br>
}<br>
<br>
/* disabling/querying */<br>
int ioDisableFileAccess(void) {<br>
  allowFileAccess = 0;<br>
 return 0;<br>
}<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
=<br>
=<br>
=<br>
========================================================================<br>
John M. McIntosh &lt;<a href="mailto:johnmci@smalltalkconsulting.com" target="_blank">johnmci@smalltalkconsulting.com</a>&gt;   Twitter:<br>
squeaker68882<br>
Corporate Smalltalk Consulting Ltd.  <a href="http://www.smalltalkconsulting.com" target="_blank">http://www.smalltalkconsulting.com</a><br>
=<br>
=<br>
=<br>
========================================================================<br>
<br>
<br>
<br>
<br>
<br>
</blockquote>
<br>
</blockquote></blockquote>
<br>
--<br>
===========================================================================<br>
John M. McIntosh &lt;<a href="mailto:johnmci@smalltalkconsulting.com" target="_blank">johnmci@smalltalkconsulting.com</a>&gt;   Twitter:  squeaker68882<br>
Corporate Smalltalk Consulting Ltd.  <a href="http://www.smalltalkconsulting.com" target="_blank">http://www.smalltalkconsulting.com</a><br>
===========================================================================<br>
<br>
<br>
<br>
<br>
</blockquote></div><br></div>