Hi All,<div><br></div><div>    this is because of carelessness in the trunk platforms/unix/plugins/LocalePlugin/sqUnixLocale.c which uses strcpy to copy C strings from the locale subsystem into Smalltalk strings.  strcpy copies the trailing null, which will overwrite the first byte of the following object.  This just happens not to kill the standard VM because current code always uses these functions on new strings.  But Cog currently checks for attempts to overwrite objects and hence it catches these attemptys and aborts, with an error message.</div>
<div><br></div><div>Hilaire, Phillipe, you should have seen and reported the &quot;last object overwritten&quot; report form the VM and if so we would have debugged this a lot sooner.  Error messages are there to be read. </div>
<div><br></div><div>Ian, David, I recommend that you fold</div><div><br></div><div><div>    URL: <a href="http://www.squeakvm.org/svn/squeak/branches/Cog/platforms/unix/plugins/LocalePlugin/sqUnixLocale.c">http://www.squeakvm.org/svn/squeak/branches/Cog/platforms/unix/plugins/LocalePlugin/sqUnixLocale.c</a></div>
<div>    Revision: 2382</div><div><br></div><div>back into trunk.</div><div><br></div><div>I&#39;ve replaced all uses of strcpy in platforms/unix/plugins/LocalePlugin/sqUnixLocale.c with the following:</div><div><br></div>
<div><div>/* For Cog do *not* copy the trailing null since the VM checks for attempts to</div><div> * overwrite the end of an object, and copying the trailing null into a string</div><div> * does precisely this.</div><div>
 */</div><div>#define safestrcpy(str,source) do { \</div><div>    char *src = (source); \</div><div>    int len = strlen(src); \</div><div>    strncpy(str,src,len); \</div><div>} while (0)</div></div><div><br></div><div><br>
</div><br><div class="gmail_quote">On Wed, Apr 27, 2011 at 8:18 AM, Philippe Marschall <span dir="ltr">&lt;<a href="mailto:kustos@gmx.net">kustos@gmx.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">On <a href="tel:26.04.2011%2023" value="+12604201123">26.04.2011 23</a>:01, Eliot Miranda wrote:<br>
&gt; ...to <a href="http://www.mirandabanda.org/files/Cog/VM/VM.r2379/" target="_blank">http://www.mirandabanda.org/files/Cog/VM/VM.r2379/</a>.  These fix<br>
&gt; shallowCopy and copyFrom: for contexts and (I hope) fix the linux Locale<br>
&gt; plugin.<br>
<br>
</div></div>The following still crashes my vm:<br>
<br>
(Locale localeID: (LocaleID isoLanguage: &#39;de&#39; isoCountry: &#39;CH&#39;))<br>
primShortDateFormat<br>
<br>
Cheers<br>
<font color="#888888">Philippe<br>
<br>
<br>
</font></blockquote></div><br></div>