PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.ruby > ruby and rdebug
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
ruby and rdebug

Réponse
 
LinkBack Outils de la discussion
Vieux 31/03/2008, 05h06   #1
barjunk
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut ruby and rdebug

I'm running a ruby script like so:

ruby test.rb

and because it has some problems it eventually crashes with

'stack level too deep (SystemStackError)'.

This is a problem I'm looking into, however, if I run the program like
this:

rdebug test.rb

It doesn't crash in the same place. In fact, I haven't been able to
get it to crash at all.

What sort of things could cause this to take place? This happens in
1.8.4 and the latest 1.8.6.

I haven't finished trying to find the reason why my ruby program
crashes in the first place, but it just seems odd that it wouldn't
also crash when using rdebug.

Ideas, suggestions?

Mike B.
  Réponse avec citation
Vieux 31/03/2008, 13h14   #2
Chiyuan Zhang
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: ruby and rdebug

It seems to be recursion level too deep. Have you tried to
run ruby in gdb and get a backtrace when the program faulted?
gdb /usr/bin/ruby test.rb

2008/3/31, barjunk <barjunk@attglobal.net>:
> I'm running a ruby script like so:
>
> ruby test.rb
>
> and because it has some problems it eventually crashes with
>
> 'stack level too deep (SystemStackError)'.
>
> This is a problem I'm looking into, however, if I run the program like
> this:
>
> rdebug test.rb
>
> It doesn't crash in the same place. In fact, I haven't been able to
> get it to crash at all.
>
> What sort of things could cause this to take place? This happens in
> 1.8.4 and the latest 1.8.6.
>
> I haven't finished trying to find the reason why my ruby program
> crashes in the first place, but it just seems odd that it wouldn't
> also crash when using rdebug.
>
> Ideas, suggestions?
>
> Mike B.
>
>


  Réponse avec citation
Vieux 31/03/2008, 13h30   #3
Marc Heiler
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: ruby and rdebug

> 'stack level too deep (SystemStackError)'

I remember that usually when I have that method, there is some recursion
at work (and my fault for invoking it)

The silliest one I ever had was like this:

N = "\n" # use N for newline

variable = N
variable << ' foo'
variable << ' bar'


I am not sure this is exactly what I made wrong, but you basically see
that I somehow appended string data to the constant and then had a huge
string that was growing and growing as it was passed through multiple
methods (I am really not sure that this was the exact error, but I am
100% sure i assigned wrongly somewhere and then had the string grow
hugely)
--
Posted via http://www.ruby-forum.com/.

  Réponse avec citation
Vieux 31/03/2008, 17h46   #4
barjunk
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: ruby and rdebug

On Mar 31, 4:14 am, Chiyuan Zhang <plus...@gmail.com> wrote:
> It seems to be recursion level too deep. Have you tried to
> run ruby in gdb and get a backtrace when the program faulted?
> gdb /usr/bin/ruby test.rb
>
> 2008/3/31, barjunk <barj...@attglobal.net>:
>
> > I'm running a ruby script like so:

>
> > ruby test.rb

>
> > and because it has some problems it eventually crashes with

>
> > 'stack level too deep (SystemStackError)'.

>
> > This is a problem I'm looking into, however, if I run the program like
> > this:

>
> > rdebug test.rb

>
> > It doesn't crash in the same place. In fact, I haven't been able to
> > get it to crash at all.

>
> > What sort of things could cause this to take place? This happens in
> > 1.8.4 and the latest 1.8.6.

>
> > I haven't finished trying to find the reason why my ruby program
> > crashes in the first place, but it just seems odd that it wouldn't
> > also crash when using rdebug.

>
> > Ideas, suggestions?

>
> > Mike B.


Thanks. I have used gdb to trace the problem...I'm still working on
that. However, the curious part is that the error doesn't occur when
using rdebug....which is the part I'm currently trying to understand.

Mike B.
  Réponse avec citation
Vieux 02/04/2008, 04h04   #5
barjunk
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: ruby and rdebug

On Mar 31, 8:46 am, barjunk <barj...@attglobal.net> wrote:
> On Mar 31, 4:14 am, Chiyuan Zhang <plus...@gmail.com> wrote:
>
>
>
> > It seems to be recursion level too deep. Have you tried to
> > run ruby in gdb and get a backtrace when the program faulted?
> > gdb /usr/bin/ruby test.rb

>
> > 2008/3/31, barjunk <barj...@attglobal.net>:

>
> > > I'm running a ruby script like so:

>
> > > ruby test.rb

>
> > > and because it has some problems it eventually crashes with

>
> > > 'stack level too deep (SystemStackError)'.

>
> > > This is a problem I'm looking into, however, if I run the program like
> > > this:

>
> > > rdebug test.rb

>
> > > It doesn't crash in the same place. In fact, I haven't been able to
> > > get it to crash at all.

>
> > > What sort of things could cause this to take place? This happens in
> > > 1.8.4 and the latest 1.8.6.

>
> > > I haven't finished trying to find the reason why my ruby program
> > > crashes in the first place, but it just seems odd that it wouldn't
> > > also crash when using rdebug.

>
> > > Ideas, suggestions?

>
> > > Mike B.

>
> Thanks. I have used gdb to trace the problem...I'm still working on
> that. However, the curious part is that the error doesn't occur when
> using rdebug....which is the part I'm currently trying to understand.
>
> Mike B.


Further testing shows that using rdebug still fails, it just takes a
few more iterations before it does. It is still wierd that it would
fail in a different spot.

Mike B.
  Réponse avec citation
Vieux 02/04/2008, 08h37   #6
barjunk
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: ruby and rdebug

On Apr 1, 7:04 pm, barjunk <barj...@attglobal.net> wrote:
> On Mar 31, 8:46 am, barjunk <barj...@attglobal.net> wrote:
>
>
>
> > On Mar 31, 4:14 am, Chiyuan Zhang <plus...@gmail.com> wrote:

>
> > > It seems to be recursion level too deep. Have you tried to
> > > run ruby in gdb and get a backtrace when the program faulted?
> > > gdb /usr/bin/ruby test.rb

>
> > > 2008/3/31, barjunk <barj...@attglobal.net>:

>
> > > > I'm running a ruby script like so:

>
> > > > ruby test.rb

>
> > > > and because it has some problems it eventually crashes with

>
> > > > 'stack level too deep (SystemStackError)'.

>
> > > > This is a problem I'm looking into, however, if I run the program like
> > > > this:

>
> > > > rdebug test.rb

>
> > > > It doesn't crash in the same place. In fact, I haven't been able to
> > > > get it to crash at all.

>
> > > > What sort of things could cause this to take place? This happens in
> > > > 1.8.4 and the latest 1.8.6.

>
> > > > I haven't finished trying to find the reason why my ruby program
> > > > crashes in the first place, but it just seems odd that it wouldn't
> > > > also crash when using rdebug.

>
> > > > Ideas, suggestions?

>
> > > > Mike B.

>
> > Thanks. I have used gdb to trace the problem...I'm still working on
> > that. However, the curious part is that the error doesn't occur when
> > using rdebug....which is the part I'm currently trying to understand.

>
> > Mike B.

>
> Further testing shows that using rdebug still fails, it just takes a
> few more iterations before it does. It is still wierd that it would
> fail in a different spot.
>
> Mike B.


Well I never figured out why rdebug behaved differently, but after
removing all my references to rb_warn from my extension...I couldn't
get it to crash.

So for some reason I don't understand at the moment, rb_warn was
causing the errors.

Mike B.
  Réponse avec citation
Vieux 02/04/2008, 14h46   #7
Gerardo Santana Gómez Garrido
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: ruby and rdebug

On 4/2/08, barjunk <barjunk@attglobal.net> wrote:

> Well I never figured out why rdebug behaved differently, but after
> removing all my references to rb_warn from my extension...I couldn't
> get it to crash.


Oh, it's an extension. I didn't read that before.

>
> So for some reason I don't understand at the moment, rb_warn was
> causing the errors.


Beware, because that can be deceiving. It has all the symptoms of
memory corruption. Being a C extension, it's probably that you have a
lost pointer, or writing on a memory location that you shouldn't.

--
Gerardo Santana

  Réponse avec citation
Vieux 02/04/2008, 21h05   #8
barjunk
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: ruby and rdebug

On Apr 2, 5:46 am, Gerardo Santana Gómez Garrido
<gerardo.sant...@gmail.com> wrote:
> On 4/2/08, barjunk <barj...@attglobal.net> wrote:
>
> > Well I never figured out why rdebug behaved differently, but after
> > removing all my references to rb_warn from my extension...I couldn't
> > get it to crash.

>
> Oh, it's an extension. I didn't read that before.
>
>
>
> > So for some reason I don't understand at the moment, rb_warn was
> > causing the errors.

>
> Beware, because that can be deceiving. It has all the symptoms of
> memory corruption. Being a C extension, it's probably that you have a
> lost pointer, or writing on a memory location that you shouldn't.
>
> --
> Gerardo Santana


I'm not sure what you are saying is deceiving? Can you elaborate some
more?

Mike B.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 03h00.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,17884 seconds with 16 queries