Win32OLE issue in 1.8.0

I am having a problem using Win32OLE events with 1.8.0. I have tried it
with the latest version (0.5.5). It works in 1.6.8 however. I have
tracked the problem down to code which calls

p = ALLOC_N(char, size)

and later calls

free§

And there it segment faults.

I am not an extension writer, so I don’t know if this
is kosher in 1.6.8 and not in 1.8.0 or not.

If you want to know exactly where it breaks, then it is in find_iid near
the bottom of the function where it does free(pstr).

The ruby code that breaks it is as follows:

require “win32ole”

printer = WIN32OLE.new(“BIPRNDRV.BiPrnDrvCtrl.1”)
ev = WIN32OLE_EVENT.new(printer, “_DBiPrnDrvEvents”)

Thanks for any help,

Steve Tuckner

It seems to me that WIN32OLE in 1.8.0 is much less stable than that in
1.6.8. I have code that I run on 1.8.0 (PragProg build) and it will segfault
at times; the exact same code will run flawlessly in 1.6.8 (PragProg build).
This will happen with soleb.rb and olegen.rb as well as the code that I’m
working with.

-austin

···

On Tue, 28 Oct 2003 03:26:19 +0900, Steve Tuckner wrote:

I am having a problem using Win32OLE events with 1.8.0. I have tried it
with the latest version (0.5.5). It works in 1.6.8 however. I have
tracked the problem down to code which calls


austin ziegler * austin@halostatue.ca * Toronto, ON, Canada
software designer * pragmatic programmer * 2003.10.27
* 13.43.53

Well those frees of objects allocated by ole_wc2mb (which calls ALLOC_N) are
sprinkled around the code so those seg faults don’t surprise me.

···

-----Original Message-----
From: Austin Ziegler [mailto:austin@halostatue.ca]
Sent: Monday, October 27, 2003 12:46 PM
To: ruby-talk ML
Subject: Re: Win32OLE issue in 1.8.0

On Tue, 28 Oct 2003 03:26:19 +0900, Steve Tuckner wrote:

I am having a problem using Win32OLE events with 1.8.0. I
have tried it
with the latest version (0.5.5). It works in 1.6.8 however. I have
tracked the problem down to code which calls

It seems to me that WIN32OLE in 1.8.0 is much less stable
than that in
1.6.8. I have code that I run on 1.8.0 (PragProg build) and
it will segfault
at times; the exact same code will run flawlessly in 1.6.8
(PragProg build).
This will happen with soleb.rb and olegen.rb as well as the
code that I’m
working with.

-austin

austin ziegler * austin@halostatue.ca * Toronto, ON, Canada
software designer * pragmatic programmer * 2003.10.27
* 13.43.53

More information…

If I just put the following code

 char *pstr;
 pstr = ALLOC_N(char, 11);
 free(pstr);

at the beginning of the fev_s_new entry point, then it segment faults in
1.8 and works when built for 1.6.8.

Steve Tuckner

···

-----Original Message-----
From: Steve Tuckner [mailto:STUCKNER@MULTITECH.COM]
Sent: Monday, October 27, 2003 1:08 PM
To: ruby-talk ML
Subject: Re: Win32OLE issue in 1.8.0

Well those frees of objects allocated by ole_wc2mb (which
calls ALLOC_N) are
sprinkled around the code so those seg faults don’t surprise me.

-----Original Message-----
From: Austin Ziegler [mailto:austin@halostatue.ca]
Sent: Monday, October 27, 2003 12:46 PM
To: ruby-talk ML
Subject: Re: Win32OLE issue in 1.8.0

On Tue, 28 Oct 2003 03:26:19 +0900, Steve Tuckner wrote:

I am having a problem using Win32OLE events with 1.8.0. I
have tried it
with the latest version (0.5.5). It works in 1.6.8
however. I have
tracked the problem down to code which calls

It seems to me that WIN32OLE in 1.8.0 is much less stable
than that in
1.6.8. I have code that I run on 1.8.0 (PragProg build) and
it will segfault
at times; the exact same code will run flawlessly in 1.6.8
(PragProg build).
This will happen with soleb.rb and olegen.rb as well as the
code that I’m
working with.

-austin

austin ziegler * austin@halostatue.ca * Toronto, ON, Canada
software designer * pragmatic programmer * 2003.10.27
* 13.43.53