Tracking down a seg fault

I am getting

webcount.rb:818: [BUG] Segmentation fault
ruby 1.6.8 (2002-12-24) [powerpc-darwin6.6]
Abort

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?ObjectPoolingAndThreading), 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!

Your advice would be much appreciated.

Nigel

···

from my program. It happens after running the program for some tens of

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?ObjectPoolingAndThreading), 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 :slight_smile:

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 :frowning: In my case, it was impossible to
isolate the bug, as any attempt to remove code would make it impossible
to reproduce it.

···

On Sun, Jul 06, 2003 at 02:29:23AM +0900, Nigel Gilbert wrote:


_ _

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

damn my office is cold.
need a hot secretary to warm it up.
– Seen on #Linux

Well, thank you for your information on this! It will certainly
prevent me from wasting hours on tracking the bug within ruby, although
it is a little sad if this is the cause. Incidentally, is there some
way of discovering from within ruby which compiler was used to create
it? The version on my Mac is gcc (GCC) 3.1 20020420 (prerelease), but
I can’t remember whether I compiled ruby or I got it as a binary.

Nigel

···

On Saturday, July 5, 2003, at 07:20 PM, Mauricio Fernández wrote:

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?ObjectPoolingAndThreading), 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 :slight_smile:

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 :frowning: 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

damn my office is cold.
need a hot secretary to warm it up.
– Seen on #Linux