# Ocra chat list?; Ocra crashes; Subclassing String

**URL:** <https://www.ruby-forum.com/t/ocra-chat-list-ocra-crashes-subclassing-string/193684>\
**Category:** Ruby\
**Created:** [August 22, 2010, 7:39am UTC](https://www.ruby-forum.com/t/ocra-chat-list-ocra-crashes-subclassing-string/193684 "2010-08-22T07:39:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ralphshnelvar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Post date:** [August 22, 2010, 7:39am UTC](https://www.ruby-forum.com/t/ocra-chat-list-ocra-crashes-subclassing-string/193684/1 "2010-08-22T07:39:52Z")

</div>

1. Is there an active OCRA chat list?

2. When I use OCRA to create an executable, the executable crashes  
before the first puts is executed.

I _tentatively_ have isolated the problem to subclassing String. …

* * *

class PathnameString \< String  
def initialize(arg)  
super arg  
end

def is\_root\_directory?  
!((self.convert\_forward\_slash\_to\_back\_slash.strip =~  
/^[A-Za-z]:\$/).nil?)  
end

def convert\_forward\_slash\_to\_back\_slash  
self.class.new(self.gsub(///, “\”))  
end

…

end

* * *

Assuming that it is this subclassing that is causing OCRA difficulties,  
do any of the gurus here know what I might have to do get OCRA to  
understand the subclassing?

In the alternate … I will have to change this from an ISA method to a  
HASA method with a ton of delegates. Is there a good Ruby way to do  
that?

Does using a ghost method sound like a good idea here?

---

<div class="post-metadata">

**Author:** ![ralphshnelvar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Post date:** [August 23, 2010, 1:07am UTC](https://www.ruby-forum.com/t/ocra-chat-list-ocra-crashes-subclassing-string/193684/2 "2010-08-23T01:07:34Z")

</div>

On Sun, Aug 22, 2010 at 7:39 AM, Ralph S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> 1. Is there an active OCRA chat list?

You can go to [http://rubyforge.org/projects/ocra](http://rubyforge.org/projects/ocra) and post to the forum  
or create a request on the tracker.

> 1. When I use OCRA to create an executable, the executable crashes before the first puts is executed.

Can you be a bit more specific about the “crash”, please. If it’s an  
exception, please post the output (name and backtrace). It will also  
be very helpful if you can produce a minimal example that shows the  
problem. I can’t reproduce with the code your have provided.

I can also highly recommend trying out the new and improved Ocra  
1.2.0.rc1. (gem install ocra --pre)

---

<div class="post-metadata">

**Author:** ![ralphshnelvar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Post date:** [August 22, 2010, 5:45pm UTC](https://www.ruby-forum.com/t/ocra-chat-list-ocra-crashes-subclassing-string/193684/3 "2010-08-22T17:45:03Z")

</div>

Saturday, August 21, 2010, 11:39:22 PM, you wrote:

RS\> 1) Is there an active OCRA chat list?

RS\> 2) When I use OCRA to create an executable, the executable crashes  
before the first puts is executed.

RS\> I _tentatively_ have isolated the problem to subclassing String. …

RS\> - - - -

RS\> class PathnameString \< String  
RS\> def initialize(arg)  
RS\> super arg  
RS\> end  
RS\>  
RS\> def is\_root\_directory?  
RS\> !((self.convert\_forward\_slash\_to\_back\_slash.strip =~  
/^[A-Za-z]:\$/).nil?)  
RS\> end

RS\> def convert\_forward\_slash\_to\_back\_slash  
RS\> self.class.new(self.gsub(///, “\”))  
RS\> end  
RS\>  
RS\> …

RS\> end  
RS\> - - - -

RS\> Assuming that it is this subclassing that is causing OCRA  
difficulties, do any of the gurus here know what I might have to do get  
OCRA to understand the subclassing?

RS\> In the alternate … I will have to change this from an ISA method  
to a HASA method with a ton of delegates. Is there a good Ruby way to  
do that?

RS\> Does using a ghost method sound like a good idea here?

Replying to my own message:

Well, it was not subclassing, I think, that was messing OCRA up.

I had a handful of relatively innocuous \*.rb files in a subdirectory off  
of my main directory. These are some utility classes and modules. As  
far as I can tell, there is nothing particularly special about them.

These functions sat in a directory named “Utils”. Changing the name of  
the directory from Utils to UD\_Stuff did not clear the crash.

The only thing that worked was moving these innocuous utility functions  
from the subdirectory up a level to the same directory where _main.rb_  
…  
ruby mymain.rb

What’s weird is that I have other subdirectories (e.g. Models, Views,  
Controllers) with large and complicated ruby files, and I have no  
problems with them.

If anyone has any ideas … I’d love to hear them.

---

<div class="post-metadata">

**Author:** ![ralphshnelvar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Post date:** [August 23, 2010, 1:25am UTC](https://www.ruby-forum.com/t/ocra-chat-list-ocra-crashes-subclassing-string/193684/4 "2010-08-23T01:25:44Z")

</div>

Lars,

The only information about the crash is in the system event log

* * *

Faulting application UltraDedupGUI.exe, version 0.0.0.0, time stamp  
0x4b07346d, faulting module unknown, version 0.0.0.0, time stamp  
0x00000000, exception code 0xc0000005, fault offset 0x2f637273, process  
id 0x1a40, application start time 0x01cb424e0d9a7620

* * *

UltraDedupGUI.exe is the executable produced by OCRA.

I don’t know how much of a low-level programmer you are but 0xc0000005  
is an access violation … a wild pointer.

Thus … there is no trace to give you.

Ralph

Sunday, August 22, 2010, 5:06:50 PM, you wrote:

LC\> On Sun, Aug 22, 2010 at 7:39 AM, Ralph S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > 1. Is there an active OCRA chat list?

LC\> You can go to [http://rubyforge.org/projects/ocra](http://rubyforge.org/projects/ocra) and post to the  
forum  
LC\> or create a request on the tracker.

> > 1. When I use OCRA to create an executable, the executable crashes before the first puts is executed.

LC\> Can you be a bit more specific about the “crash”, please. If it’s an  
LC\> exception, please post the output (name and backtrace). It will also  
LC\> be very helpful if you can produce a minimal example that shows the  
LC\> problem. I can’t reproduce with the code your have provided.

LC\> I can also highly recommend trying out the new and improved Ocra  
LC\> 1.2.0.rc1. (gem install ocra --pre)

---

<div class="post-metadata">

**Author:** ![ralphshnelvar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Post date:** [August 23, 2010, 3:49am UTC](https://www.ruby-forum.com/t/ocra-chat-list-ocra-crashes-subclassing-string/193684/5 "2010-08-23T03:49:44Z")

</div>

Lars,

Sunday, August 22, 2010, 5:06:50 PM, you wrote:

LC\> On Sun, Aug 22, 2010 at 7:39 AM, Ralph S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > 1. Is there an active OCRA chat list?

LC\> You can go to [http://rubyforge.org/projects/ocra](http://rubyforge.org/projects/ocra) and post to the  
forum  
LC\> or create a request on the tracker.

> > 1. When I use OCRA to create an executable, the executable crashes before the first puts is executed.

LC\> Can you be a bit more specific about the “crash”, please. If it’s an  
LC\> exception, please post the output (name and backtrace). It will also  
LC\> be very helpful if you can produce a minimal example that shows the  
LC\> problem. I can’t reproduce with the code your have provided.

LC\> I can also highly recommend trying out the new and improved Ocra  
LC\> 1.2.0.rc1. (gem install ocra --pre)

I will post there.

I did the gem install and the latest exhibits the same bizarre behavior.
