[MacRuby-devel] REXML broken

2010-01-26 Thread Robert Rice
This problem started with either the 1/23 or the 1/24 nightly.

Last login: Mon Jan 25 19:18:11 on console
new-host:~ robertrice$ macirb
irb(main):001:0> require "rexml/document"
Assertion failed: (chmaxlen < sizeof(chbuf)), function 
unescape_escaped_nonascii, file re.c, line 2205.
Abort trap
new-host:~ robertrice$ 


I backed up to the 1/22 nightly and REXML worked again.

Last login: Tue Jan 26 01:49:52 on ttys001
new-host:~ robertrice$ macirb
irb(main):001:0> require "rexml/document"
=> true
irb(main):002:0> exit

Bob Rice

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] Getting involved in MacRuby development

2010-01-26 Thread Laurent Sansonetti

On Jan 25, 2010, at 10:52 PM, Maxime Curioni wrote:

Hello Laurent,

Thanks for your message and for the advice. I will start by tackling  
the easy bugs in Trac. I know that I'll be slow in the weeks to  
come, that it's going to take me a while to get situated with the  
codebase but I will try my best.


Excellent :)

I don't want to bother the mailing-list with my questions when I  
(will) have some. Is there anybody that I should contact first for  
help or reference ?


You can definitely write questions on the mailing-list, it's supposed  
to host development discussions :) However, feel free to write me  
directly if you like.


Good luck!

Laurent
___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] OpenCL experiment (request for comments)

2010-01-26 Thread Ruben Fonseca
Hi @all!

I promised Laurent I would start a discussion on OpenCL and Macruby on the ML, 
and here I am :)

I wrote a small hack for MacRuby that adds basic (and hacky) support for OpenCL 
kernels running on your GPUs or CPUs. You can read about it on my blog post 
here http://blog.0x82.com/2010/1/23/opencl-in-macruby-hack-not-very-useful

The branch with the code is located here on github 
http://github.com/rubenfonseca/macruby. If you are interested on the actual 
hacky implementation, please look at “opencl.c” file.

Now there are a couple of things I need help. It was my very first (mac)ruby C 
extension, and I’m not really sure about many details on the implementation (I 
basically copy-pasted code from other modules eheh). I’ll raise a couple of 
questions here, I’m sure you can answer some of them :)

- How and were to store primitive values?

   For instance, OpenCL::Device has somewhere inside a “cl_device_id” pointer. 
However, on other classes (think OpenCL::Context#new) I’ll need to have a 
reference to that “cl_device_id” pointer somewhere.

   What’s the best way to store the pointer? Inside the Object struct? As an 
instance var? As an accessor? These later options doesn’t make sense to me, 
'cause I’m never interested on getting the “cl_device_id” pointer on a IRB 
shell for instance... Hope I’m making myself clear.

- How the memory should be managed?

   As I said, I never wrote a MacRuby extension before. When writing the 
extension, I needed to do a couple of memory allocations. I used “xmalloc” 
(discovered by looking at other macurby *.c files). However, when I called 
“free” after I don’t need the memory anymore, all sorts of warnings happened at 
runtime.

   After I deleted the “free” calls, it all worked, but I’m not sure if I’m 
leaking memory somehow. On the other hand, maybe the memory is automatically 
GC’ed :) Can you clear this for me and show me the best practices?

- How to turn the OpenCL API more “Rubyish"

  I have no clue on this one. OpenCL seems like a huge API, and I don’t have a 
really background knowledge of GPU programming. There are all sorts of 
variations on each call, and a number of different entities (classes). Any 
suggestion on how to make this more pleasant to write in Ruby would be very 
very welcome.

  I even saw Laurent talk about a “Ruby -> OpenCL direct compiler via LLVM 
bitcode”, but I’m definitely not qualified to even consider that hipotesys. I 
tried twice creating a very simple compiler with LLVM and failed completely :P


Anyhow, sorry for the long email, but I would be very thankful for any help I 
can get :)

Cheers,
Rúben Fonseca
___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #493: signals cannot be intercepted

2010-01-26 Thread MacRuby
#493: signals cannot be intercepted
---+
 Reporter:  lsansone...@…  |   Owner:  martinlagarde...@…
 Type:  defect |  Status:  assigned  
 Priority:  blocker|   Milestone:  MacRuby 0.5   
Component:  MacRuby|Keywords:
---+

Comment(by martinlagarde...@…):

 Signals are now partially implemented in r3338, with some limitations:
 - Raising an exception within a signal handler will not work
 - Ruby doesn't handle any signal by default, except SIGBUS, SIGSEGV,
 SIGPIPE, and SIGCHLD

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #493: signals cannot be intercepted

2010-01-26 Thread MacRuby
#493: signals cannot be intercepted
---+
 Reporter:  lsansone...@…  |   Owner:  martinlagarde...@…
 Type:  defect |  Status:  assigned  
 Priority:  blocker|   Milestone:  MacRuby 0.5   
Component:  MacRuby|Keywords:
---+

Comment(by ernest.prabha...@…):

 Great, mspec/bin/mspec -B spec/macruby.mspec
 spec/macruby/core/gcd/source_spec.rb now seems to run properly.
 (versus failing randomly every few runs).

 Please check against it if you make further changes. :-)

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] REXML broken

2010-01-26 Thread Laurent Sansonetti

Hi Robert,

This works for me as of trunk. Which OS version do you run? Is your  
cpu 32-bit or 64-bit?


Thanks,
Laurent

On Jan 25, 2010, at 11:40 PM, Robert Rice wrote:


This problem started with either the 1/23 or the 1/24 nightly.

Last login: Mon Jan 25 19:18:11 on console
new-host:~ robertrice$ macirb
irb(main):001:0> require "rexml/document"
Assertion failed: (chmaxlen < sizeof(chbuf)), function  
unescape_escaped_nonascii, file re.c, line 2205.

Abort trap
new-host:~ robertrice$


I backed up to the 1/22 nightly and REXML worked again.

Last login: Tue Jan 26 01:49:52 on ttys001
new-host:~ robertrice$ macirb
irb(main):001:0> require "rexml/document"
=> true
irb(main):002:0> exit

Bob Rice

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] [MacRuby] #577: EXC_BAD_ACCESS in IO.read

2010-01-26 Thread MacRuby
#577: EXC_BAD_ACCESS in IO.read
-+--
 Reporter:  spamtr...@…  |   Owner:  lsansone...@…
 Type:  defect   |  Status:  new  
 Priority:  minor|   Milestone:   
Component:  MacRuby  |Keywords:   
-+--
 I had a small spelling accident tonight, which caused me to stumble over
 this :[[BR]]
 using ios.read, with an argument of nil, i.e.

 {{{
 s = ""
 f = File.open("xxx")
 while (!f.eof?)
   s += f.read(nil)
 end
 }}}

 will cause this :

 {{{
 Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
 Exception Codes: KERN_INVALID_ADDRESS at 0x
 Crashed Thread:  0  Dispatch queue: com.apple.main-thread

 Application Specific Information:
 objc[26488]: garbage collection is ON

 0   libSystem.B.dylib   0x7fe007c5 __memcpy + 37
 1   libauto.dylib   0x7fff83a1f210
 auto_zone_write_barrier_memmove + 96
 2   libauto.dylib   0x7fff83a2020e
 auto_realloc(_malloc_zone_t*, void*, unsigned long) + 878
 3   libSystem.B.dylib   0x7fff84c1ab3b
 malloc_zone_realloc + 92
 4   com.apple.CoreFoundation0x7fff8215eb49 __CFDataGrow +
 233
 5   com.apple.CoreFoundation0x7fff82184e05 CFDataSetLength
 + 181
 6   libmacruby.dylib0x00010005c1fa
 rb_io_read_internal + 522
 7   libmacruby.dylib0x00010005d6b6 rb_io_eof + 54
 8   libmacruby.dylib0x00010016d32f rb_vm_dispatch
 + 7279
 }}}


 Macruby version is Nightly build from 2010/01/26.

 The weird thing is i can only reproduce it with large files. My test files
 are CD sized, created with "dd if=/dev/random of=test.dat bs=65536
 count=1"

 I know calling read(nil) twice on a file doesn't make much sense, but
 reading the docs leads me to believe it should just return "" (http
 ://ruby-doc.org/core/classes/IO.html)

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] REXML broken

2010-01-26 Thread Robert Rice
Hi Laurent:

REXML loads again in the 1/26 nightly build.

Thanks,
Bob Rice


On Jan 26, 2010, at 6:39 PM, Laurent Sansonetti wrote:

> Hi Robert,
> 
> This works for me as of trunk. Which OS version do you run? Is your cpu 
> 32-bit or 64-bit?
> 
> Thanks,
> Laurent
> 
> On Jan 25, 2010, at 11:40 PM, Robert Rice wrote:
> 
>> This problem started with either the 1/23 or the 1/24 nightly.
>> 
>> Last login: Mon Jan 25 19:18:11 on console
>> new-host:~ robertrice$ macirb
>> irb(main):001:0> require "rexml/document"
>> Assertion failed: (chmaxlen < sizeof(chbuf)), function 
>> unescape_escaped_nonascii, file re.c, line 2205.
>> Abort trap
>> new-host:~ robertrice$
>> 
>> 
>> I backed up to the 1/22 nightly and REXML worked again.
>> 
>> Last login: Tue Jan 26 01:49:52 on ttys001
>> new-host:~ robertrice$ macirb
>> irb(main):001:0> require "rexml/document"
>> => true
>> irb(main):002:0> exit
>> 
>> Bob Rice
>> 
>> ___
>> MacRuby-devel mailing list
>> MacRuby-devel@lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
> 
> ___
> MacRuby-devel mailing list
> MacRuby-devel@lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
> 

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #576: It's possible to close STDOUT (and presumably other standard IO streams)

2010-01-26 Thread MacRuby
#576: It's possible to close STDOUT (and presumably other standard IO streams)
---+
 Reporter:  matt...@…  |   Owner:  lsansone...@…
 Type:  defect |  Status:  new  
 Priority:  critical   |   Milestone:  MacRuby 0.5  
Component:  MacRuby|Keywords:   
---+

Comment(by danielcavan...@…):

 very simple implementation: just checks for the original stdout, stderr,
 and stdin within io_close() and ignores them

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #573: Creating a void pointer causes abort()

2010-01-26 Thread MacRuby
#573: Creating a void pointer causes abort()
+---
 Reporter:  ca...@… |   Owner:  lsansone...@…
 Type:  defect  |  Status:  new  
 Priority:  major   |   Milestone:  MacRuby 0.5  
Component:  MacRuby |Keywords:   
+---

Comment(by danielcavan...@…):

 a patch to fix this issue

 firstly, it refactors the new-pointer code to avoid querying the size of
 void and reduces duplication as a side effect

 secondly, it alters get_sizeof() to not query llvm when passed an unsized
 typed, in case this happens again. really llvm should be doing this, but
 it doesn't so we just have to deal with it

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel