[#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-10 20:57:12 UTC
List: ruby-core #8830
On Sep 9, 2006, at 7:16 PM, Sean E. Russell wrote:
> On Saturday 09 September 2006 01:42, Eric Hodel wrote:
>>> libxml = DL.dlopen( 'libxml2.so' )
>>> file_reader = libxml[ 'xmlNewTextReaderFilename', 'IS' ]
>>
>> The documentation says:
>> xmlTextReaderPtr	xmlNewTextReaderFilename	(const char * URI)
>>
>> So I think IS is wrong, and PS is correct.
>
> 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.

>>> The documentation says:
>>> int   xmlTextReaderHasAttributes      (xmlTextReaderPtr reader)
>>>
>>> So I think SI is wrong and SP is correct.
>>
>> I meant IP, like I wrote below in the code.
>
> Yeah, that would do it.  I'm not sure P -> I is that big of a deal,  
> but I -> S
> would certainly gum up the works.  Thanks for catching that.

P -> I is a big deal.

$ ruby -p xml2.rb tst.xml
ruby 1.8.5 (2006-08-25) [powerpc-darwin8.7.0]
1
Name = a
has attributes (1, 0, -1)? 14434976

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

http://trackmap.robotcoop.com



In This Thread