[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: Syck 0.35 + YAML.rb 0.60 -- the 1st stable release

Nigel Gilbert

7/6/2003 11:07:00 PM

Could your segmentation fault be due to the same problem as in the
following?

From: Mauricio Fernández <batsman.geo@yahoo.com>
Date: Sat Jul 5, 2003 7:20:38 PM Europe/London
To: ruby-talk@ruby-lang.org (ruby-talk ML)
Subject: Re: Tracking down a seg fault
Reply-To: ruby-talk@ruby-lang.org

On Sun, Jul 06, 2003 at 02:29:23AM +0900, Nigel Gilbert wrote:
> I am getting
>
> webcount.rb:818: [BUG] Segmentation fault
> ruby 1.6.8 (2002-12-24) [powerpc-darwin6.6]
> Abort
>
> from my program. It happens after running the program for some tens of
> minutes, and the location identified varies apparently randomly. (The
> program essentially downloads web pages in order to measure their size
> in terms of pages, links, images etc. for some work I am doing on
> devising new indicators of the 'digital economy').
>
> I need advice on the best strategy to use to identify what is going
> wrong. The program uses threads (obtained through the Resource Pooling
> code to be found at
> http://www.rubygarden.org/ruby?ObjectPoolingAn...), and
> net/http, both of which could, I suppose, complicate matters, and the
> program is about 900 lines of code, so a strategy is rather important!

I had a similar problem, with the same code (I wrote
ObjectPoolingAndThreading :-)

I was getting random segfaults with a heavily threaded script that was
doing 200 connections to a dictd server. After some time, I found out
that the problem seemed to be associated to GCC, as the segfault would
only happen when targeting i386 and using gcc 3.2...

> Your advice would be much appreciated.

You could check if the problem persists w/ a different GCC (although
I don't know if you are limited to gcc 3.1 in OSX). Other than that,
I guess there's not much to do :-( In my case, it was impossible to
isolate the bug, as any attempt to remove code would make it impossible
to reproduce it.

--
_ _
| |__ __ _| |_ ___ _ __ ___ __ _ _ __
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ | |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

<Tazman> damn my office is cold.
<Tazman> need a hot secretary to warm it up.
-- Seen on #Linux


On Sunday, July 6, 2003, at 11:27 AM, Richard Zidlicky wrote:

> On Sat, Jul 05, 2003 at 09:17:18AM +0900, why the lucky stiff wrote:
>> Richard Zidlicky (rz@linux-m68k.org) wrote:
>>>
>>> /usr/lib/ruby/1.6/i386-linux/ruby.h has:
>>>
>>> ruby.h:#define INT2NUM(v) rb_int2inum(v)
>>> ruby.h:#define UINT2NUM(v) rb_uint2inum(v)
>>>
>>> but not LONG2NUM
>>
>> If you're comfortable editing the source, then you can just replace
>> with
>> INT2NUM and it will work.
>
> done that already :)
>
> got a new problem though, this time it is happening randomly and
> pretty rare in a threaded program so could not get gdb backtrace
> yet:
>
> /usr/lib/site_ruby/1.6/yaml/emitter.rb:285: [BUG] Segmentation fault
> ruby 1.6.7 (2002-03-19) [i386-linux]
> Aborted
>
> Any idea?
>
> Richard
>
>
>
________________________________________________________________________
__
Professor Nigel Gilbert, FREng, AcSS, Pro Vice-Chancellor and Professor
of
Sociology, University of Surrey, Guildford GU2 7XH, UK. +44 (0)1483
689173


3 Answers

Richard Zidlicky

7/8/2003 9:51:00 AM

0

On Mon, Jul 07, 2003 at 08:07:21AM +0900, Nigel Gilbert wrote:
> Could your segmentation fault be due to the same problem as in the
> following?

it could be the same or related, but so far all symptoms
described seem much to random to be debugged.
Does anyone have a truly repeatable testcase?

BTW does ruby have an option to dump cure instead of
catching the segfault?

Richard

Mauricio Fernández

7/8/2003 11:14:00 AM

0

On Tue, Jul 08, 2003 at 06:50:53PM +0900, Richard Zidlicky wrote:
> On Mon, Jul 07, 2003 at 08:07:21AM +0900, Nigel Gilbert wrote:
> > Could your segmentation fault be due to the same problem as in the
> > following?
>
> it could be the same or related, but so far all symptoms
> described seem much to random to be debugged.
> Does anyone have a truly repeatable testcase?
>
> BTW does ruby have an option to dump cure instead of
> catching the segfault?

I did the following:
* comment the following lines in signal.c (around line 736)
#ifdef SIGSEGV
install_sighandler(SIGSEGV, sigsegv);
#endif
* compile and rename the binary to gruby, then put it in my path

This way I can get core dumps when debugging rjni.

--
_ _
| |__ __ _| |_ ___ _ __ ___ __ _ _ __
| ''_ \ / _` | __/ __| ''_ ` _ \ / _` | ''_ \
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

<dark> Turns out that grep returns error code 1 when there are no matches.
I KNEW that. Why did it take me half an hour?
-- Seen on #Debian

why the lucky stiff

7/8/2003 4:38:00 PM

0

On Tuesday 08 July 2003 03:50 am, Richard Zidlicky wrote:
>
> it could be the same or related, but so far all symptoms
> described seem much to random to be debugged.
> Does anyone have a truly repeatable testcase?
>

I tested thousands of operations loading/dumping the sample file you gave me.
I''m trying to get some random data in there to test as well, but so far
things seem fine.

What version of Syck are you using? If you''re using 0.35, then I would
upgrade to the CVS version. You can find cases of dump segfaults on
ruby-core that have been fixed since 0.35.

Don''t worry. We''ll beat this thing.

_why