From: Nigel Gilbert Date: 2003-07-06T04:23:41+09:00 Subject: Re: Tracking down a seg fault 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 :-) > > 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 > > damn my office is cold. > need a hot secretary to warm it up. > -- Seen on #Linux > >