From: Nigel Gilbert Date: 2003-07-07T08:07:21+09:00 Subject: Re: Syck 0.35 + YAML.rb 0.60 -- the 1st stable release Could your segmentation fault be due to the same problem as in the following? From: Mauricio Fern�ndez 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?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 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