[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

FXRuby Segmentation fault

Ernst Tanaka

12/9/2007 12:56:00 AM

I am getting this error.
I see on the forum more people had the error, but I can't find a
solution.

The error occurs in debug mode (via Netbeans) but also from the command
line (debug or not)



[BUG] Segmentation fault
ruby 1.8.6. <2007-03-13> [i386-mswin32]

The error points to this ruby line.

C:/ruby/lib/ruby/gems/1.8/gems/fxruby-1.6.13-mswin32/lib/fox16/kwargs.rb:1689:
[BUG] Segmentation fault
ruby 1.8.6 (2007-03-13) [i386-mswin32]
--
Posted via http://www.ruby-....

8 Answers

Ernst Tanaka

12/9/2007 2:57:00 PM

0

In addition to the above post;

I am on a windows/xp system.
I downloaded all the lastest version of the gems.

The error message I get is;

[BUG] Segmentation fault
ruby 1.8.6. <2007-03-13> [i386-mswin32]

It seems to be in calls to FXRuby.


I can do with some help;
- how can i debug errors like this?
- how can I get better error messages when using FXRuby


Searching for this error I found several posts, but none holds a
solution.

Thanks for your help,

Ernst



--
Posted via http://www.ruby-....

Axel Etzold

12/9/2007 3:12:00 PM

0


-------- Original-Nachricht --------
> Datum: Sun, 9 Dec 2007 23:57:10 +0900
> Von: Ernst Tanaka <ernst@tanakasite.com>
> An: ruby-talk@ruby-lang.org
> Betreff: Re: FXRuby Segmentation fault

> In addition to the above post;
>
> I am on a windows/xp system.
> I downloaded all the lastest version of the gems.
>
> The error message I get is;
>
> [BUG] Segmentation fault
> ruby 1.8.6. <2007-03-13> [i386-mswin32]
>
> It seems to be in calls to FXRuby.
>
>
> I can do with some help;
> - how can i debug errors like this?
> - how can I get better error messages when using FXRuby
>
>
> Searching for this error I found several posts, but none holds a
> solution.
>
> Thanks for your help,
>
> Ernst
>
>
>
> --
> Posted via http://www.ruby-....

Dear Ernst,

I am not an FXRuby expert either, but most of my segmentation fault
errors (and all those I could reproduce) were produced when I tried to use something from inside of
something else where the "something else" wasn't yet defined
(as Ruby allows you to create things on the fly which Fox and thus
C doesn't without previous declaration).

So to test whether there is really something wrong with your installation,
I'd try to run the test scripts that come with the FXRuby installation.

If you are not getting any errors there (save for non-installed dependencies), maybe you post (a simplified / shortened version of) your code to the FXRuby list. There is also a GUI builder for FXRuby from here:

http://fox-tool.rub... .

Best regards,

Axel





--
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/g...

Ernst Tanaka

12/10/2007 1:34:00 AM

0

Thanks Axel for your reply.

Still working on the errors.

I am also getting;

This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application's support team for more information.
>Exit code: -1073741819


I have proof that the error reproduces itself on a non-consistent
bases.

- One time program runs perfectly.
- make non essential change; like I add a line x = " "
- next time program does not run and gives the above mentioned errors.
- remove of line --> still errors

--
Posted via http://www.ruby-....

Joel VanderWerf

12/10/2007 1:58:00 AM

0

Ernst Tanaka wrote:
> Thanks Axel for your reply.
>
> Still working on the errors.
>
> I am also getting;
>
> This application has requested the Runtime to terminate it in an unusual
> way.
> Please contact the application's support team for more information.
>> Exit code: -1073741819
>
>
> I have proof that the error reproduces itself on a non-consistent
> bases.
>
> - One time program runs perfectly.
> - make non essential change; like I add a line x = " "
> - next time program does not run and gives the above mentioned errors.
> - remove of line --> still errors
>

Symptoms like this sometimes mean there is a memory management problem
(possibly somewhere in fxruby). It might mean that an object is being
freed even though there is a reference to it. Try doing this somewhere
early in your program:

GC.disable

If you do that, the program will consume increasing amounts of memory,
so it is not a solution to the problem. But if the crash does not
happen, then that probably indicates a memory management bug of some kind.

The source of the problem may be hard to find. You can insert GC.start
after creating objects (remove the GC.disable first). This may help
determine which allocation is the culprit. (Someone suggested a ruby
option to tell GC to collect frequently, which would help, but AFAIK
this doesn't exist yet.)

Also, you can try to cut your program down to the smallest example in
which the bug still happens.

--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

Ernst Tanaka

12/10/2007 1:47:00 PM

0

Joel VanderWerf wrote:
>
> GC.disable
>
>

Thanks Joel (dankjewel)

I tried GC.disable and GC.enable and GC.start
No difference; sometimes the program runs, sometimes not.

Debuging and minimizing the program by placing comments is giving
non-consistent results. It seems not to be a specific line in my code
which causes the error.

I am working with the lasted Gems, tried to execute the program from the
command line and from Netbeans and Scite. no difference. all the same
none-consistent results.

This is a tough one.

Ernst


--
Posted via http://www.ruby-....

Ernst Tanaka

12/10/2007 3:32:00 PM

0

Found another little clue

@bs_tab = ["Buy", "Sell"]
@bs = -1
unless @horizontalframe41
FX::HorizontalFrame.new(@horizontalframe4){|w|
@horizontalframe41=w
w.wdg_name='horizontalframe41'
w.backColor=Fox::FXRGBA(0,0,0,255)}
FX::ComboBox.new(@horizontalframe41){|w|
@w_bs=w
w.wdg_name='w_bs'
w.fillItems(@bs_tab)
w.backColor=Fox::FXRGBA(0,0,0,255)
w.textColor=Fox::FXRGBA(0,255,0,255)}
@horizontalframe41.create
end
@w_bs.currentItem = 0 if @bs == 1
@w_bs.currentItem = 1 if @bs == -1



It seems that the "w.fillItems(@bs_tab) is the cause of many of my
errors.


"This application has requested the Runtime to terminate it in an
unusual
way.
Please contact the application's support team for more information.
>Exit code: -1073741819"

--
Posted via http://www.ruby-....

Lyle Johnson

12/10/2007 4:15:00 PM

0

On Dec 10, 2007 9:32 AM, Ernst Tanaka <ernst@tanakasite.com> wrote:

> Found another little clue
>
> @bs_tab = ["Buy", "Sell"]
> @bs = -1
> unless @horizontalframe41
> FX::HorizontalFrame.new(@horizontalframe4){|w|
> @horizontalframe41=w
> w.wdg_name='horizontalframe41'
> w.backColor=Fox::FXRGBA(0,0,0,255)}
> FX::ComboBox.new(@horizontalframe41){|w|
> @w_bs=w
> w.wdg_name='w_bs'
> w.fillItems(@bs_tab)
> w.backColor=Fox::FXRGBA(0,0,0,255)
> w.textColor=Fox::FXRGBA(0,255,0,255)}
> @horizontalframe41.create
> end
> @w_bs.currentItem = 0 if @bs == 1
> @w_bs.currentItem = 1 if @bs == -1
>
> It seems that the "w.fillItems(@bs_tab) is the cause of many of my
> errors.

What is @bs_tab? It should be an array of strings. See what happens if
you replace the line:

w.fillItems(@bs_tab)

with this:

@bs_tab.each { |s| w.appendItem(s) }

Hope this helps,

Lyle

Ernst Tanaka

12/10/2007 6:35:00 PM

0

Lyle Johnson wrote:
> What is @bs_tab? It should be an array of strings. See what happens if
> you replace the line:
>
> w.fillItems(@bs_tab)
>
>

@bs_tab is an array filled with two elements. ["Buy", "Sell"]

Your suggestion make a world of difference.
It seems that the fillItems is not as robust as it could be.

appendItem is doing the trick.



Thanks,
Ernst

P.s. I am need for your book, spending to much time puzzling.
--
Posted via http://www.ruby-....