...to http://www.mirandabanda.org/files/Cog/VM/VM.r2379/. These fix shallowCopy and copyFrom: for contexts and (I hope) fix the linux Locale plugin. best, Eliot
|
On Tue, 26 Apr 2011, Eliot Miranda wrote: > ...to http://www.mirandabanda.org/files/Cog/VM/VM.r2379/. These fix > shallowCopy and copyFrom: for contexts and (I hope) fix the linux Locale > plugin. Great, thanks! Levente > > best, > Eliot > |
In reply to this post by Eliot Miranda-2
with a fix for the VMs in 2379 to http://www.mirandabanda.org/files/Cog/VM/VM.r2380/. These pass Levente's shift/reset tests. Apologies for the earlier slip. On Tue, Apr 26, 2011 at 2:01 PM, Eliot Miranda <[hidden email]> wrote: ...to http://www.mirandabanda.org/files/Cog/VM/VM.r2379/. These fix shallowCopy and copyFrom: for contexts and (I hope) fix the linux Locale plugin. |
On Tue, 26 Apr 2011, Eliot Miranda wrote: > with a fix for the VMs in 2379 to http://www.mirandabanda.org/files/Cog/VM/VM.r2380/. These pass Levente's shift/reset tests. Apologies for the earlier slip. Thanks Eliot, it works as expected. Levente |
In reply to this post by Eliot Miranda-2
Philippe, can you please profile before and after? This could very well be to do with the additional cost of shallowCopy for contexts, but it is inevitable that a correct implementation is going to be more expensive than the simple block-copy. The new implementation can be optimized, but we need to profile first to be sure we're tilting at the relevant windmill. AdvThanksance Eliot On Wed, Apr 27, 2011 at 9:40 AM, Philippe Marschall <[hidden email]> wrote:
|
In reply to this post by Eliot Miranda-2
can you post a stack trace from gdb? Also, what linux system and what image are you using? TIA Eliot
On Wed, Apr 27, 2011 at 8:18 AM, Philippe Marschall <[hidden email]> wrote:
|
In reply to this post by Eliot Miranda-2
Hi All, 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.
Hilaire, Phillipe, you should have seen and reported the "last object overwritten" report form the VM and if so we would have debugged this a lot sooner. Error messages are there to be read.
Ian, David, I recommend that you fold URL: http://www.squeakvm.org/svn/squeak/branches/Cog/platforms/unix/plugins/LocalePlugin/sqUnixLocale.c
Revision: 2382 back into trunk. I've replaced all uses of strcpy in platforms/unix/plugins/LocalePlugin/sqUnixLocale.c with the following: /* For Cog do *not* copy the trailing null since the VM checks for attempts to * overwrite the end of an object, and copying the trailing null into a string * does precisely this.
*/ #define safestrcpy(str,source) do { \ char *src = (source); \ int len = strlen(src); \ strncpy(str,src,len); \ } while (0) On Wed, Apr 27, 2011 at 8:18 AM, Philippe Marschall <[hidden email]> wrote:
|
In reply to this post by Eliot Miranda-2
and now http://www.mirandabanda.org/files/Cog/VM/VM.r2382/ has the fix for Locale on linux. On Tue, Apr 26, 2011 at 6:37 PM, Eliot Miranda <[hidden email]> wrote: with a fix for the VMs in 2379 to http://www.mirandabanda.org/files/Cog/VM/VM.r2380/. These pass Levente's shift/reset tests. Apologies for the earlier slip. |
Free forum by Nabble | Edit this page |