[#8815] Segfault in libc strlen, via rb_str_new2 — "Sean E. Russell" <ser@...>

Howdy,

12 messages 2006/09/09
[#8817] Re: Segfault in libc strlen, via rb_str_new2 — Eric Hodel <drbrain@...7.net> 2006/09/09

On Sep 8, 2006, at 10:10 PM, Sean E. Russell wrote:

Re: Segfault in libc strlen, via rb_str_new2

From: Eric Hodel <drbrain@...7.net>
Date: 2006-09-11 20:46:46 UTC
List: ruby-core #8848
On Sep 11, 2006, at 9:01 AM, Sean Russell wrote:
> On Monday 11 September 2006 03:58, Marc Haisenko wrote:
>> On Sunday 10 September 2006 22:57, Eric Hodel wrote:
>>> On Sep 9, 2006, at 7:16 PM, Sean E. Russell wrote:
>>>> Hmm.  My C is rusty, but I didn't think there was any difference
>>>> between a pointer and an integer on 32-bit x86.
>>>
>>> I don't have one of those (PPC G4).  It is very likely that you'll
>>> run into a platform where this will matter, so your code should be
>>> correct.
>>
>> Yes, for example AMD64: sizeof(int) == 4, sizeof(void*) == 8
>>
>> One is NEVER allowed to assume that a pointer can be stored in an
>> arithmetic value, e.g. it's possible that on some architecture
>> arithmetic values are 32 bit and pointers are 36 bit (IIRC there is
>> an architecture where this is really true).
>
> Wow.  It is as if I never said "on 32-bit x86".  Eerie.

You did ask a question about a non-working example in public...

-- 
Eric Hodel - drbrain@segment7.net - http://blog.segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com



In This Thread