[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

SystemStackError when rb_define_module_function() * 3

Suraj Kurapati

2/17/2006 6:21:00 AM

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

I'm getting a "test.rb:46: stack level too deep (SystemStackError)"
when defining three or more functions for a module, which is created
& given to Ruby via the Ruby C API.


## begin extra info ##

The test.rb (actually "samp/test.rb") file and the remaining source
code is available in a Subversion repository at RubyForge:

svn checkout -r21 svn://rubyforge.org/var/svn/ruby-vpi/trunk
- -or-
<http://rubyforge.org/plugins/scmsvn/viewcvs.php/trunk/?root=ruby-vpi&path...

Also, I run "make ivl" inside the "samp/" directory to run the
sample test bench ("test.v" and "test.rb").

Finally, I am using this Ruby version:
ruby 1.8.3 (2005-06-23) [i486-linux]

## end extra info ##


In particular, the error occurs when I register a third module
function with Ruby C API inside line 25 of the file
"src/RVPI.cin":

// register the VPI module
RVPI__rModuleDef = rb_define_module("VPI");

rb_define_module_function( // first func
RVPI__rModuleDef
, "relay_verilog"
, RVPI_rb_relay_verilog
, 0
);

rb_define_module_function( // second func
RVPI__rModuleDef
, "register_task"
, RVPI_rb_register_task
, 1
);

rb_define_module_function( // third func
RVPI__rModuleDef
, "handle_by_name"
, RVPI_rb_handle_by_name
, 2
); // FIXME: causes "stack level too deep (SystemStackError)"


I originally thought the problem was with the third module function
(named "RVPI_rb_handle_by_name") that I was trying to register. But
this was not the case, because the SystemStackError occurred even
when I registered the first module function under a different name:

// register the VPI module
RVPI__rModuleDef = rb_define_module("VPI");

rb_define_module_function( // first func
RVPI__rModuleDef
, "relay_verilog"
, RVPI_rb_relay_verilog
, 0
);

rb_define_module_function( // second func
RVPI__rModuleDef
, "register_task"
, RVPI_rb_register_task
, 1
);

rb_define_module_function( // first func with different name
RVPI__rModuleDef
, "foo"
, RVPI_rb_relay_verilog
, 0
);


What am I doing wrong?

Thank you.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFD9WgQmV9O7RYnKMcRAnv6AKCp2axs4vC3+n9h1vSmBIP7QL+ISgCdGH6X
U6pkTj3RoLSsPNj0dL1xVQg=
=18Ev
-----END PGP SIGNATURE-----


5 Answers

BeeJ

10/29/2013 7:01:00 PM

0

CoderX explained :
> "Arne Saknussemm" <motz001.20.wannabet@spamgourmet.com> wrote in message
> news:20131029111134.000068aa@eternal-september.org...
>> Internet is that way --> and there you may find plenty of infos and
>> tutorials, given that you'll use a bit of your time to search, read and
>> understand; just to add a bit, you should consider a VB6 form like a
>> class with a GUI this means that you may deal with a form just like you
>> do with a class module (add and use properties, methods and events),
>> sure, a Form may have a slightly different lifecycle since a user may
>> decide to close it (it isn't possible with a class) but it shouldn't be
>> difficult dealing with that
>>
>
> This is BJ you're talking about, the village idiot, the town mooch, a liberal
> and his EBT card. He'll tell you 'he tried' to look, but lies like a two
> dollar whore. He won't show you his code (probably because he has none to
> show) and show bits and pieces that make no sense. E$verything he wants us
> to write for him flies against any MSFT UI standards (which is usually an
> indication of a badly written app). This will keep going and going until
> someone writes it all out for him. And someone will. They always do.
>
> Just sit back and enjoy the show.

You seem to think you are such a brain, when are you ever going to
contribute to this newsgroup? All I see is a person with so little
self esteem that he gets his jollies by ridiculing. Sad.


se

10/29/2013 8:35:00 PM

0


"BeeJ" <spamnot@nospam.com> skrev i meddelelsen
news:l4p0lk$nk3$1@speranza.aioe.org...
> CoderX explained :
>> "Arne Saknussemm" <motz001.20.wannabet@spamgourmet.com> wrote in message
>> news:20131029111134.000068aa@eternal-september.org...
>>> Internet is that way --> and there you may find plenty of infos and
>>> tutorials, given that you'll use a bit of your time to search, read and
>>> understand; just to add a bit, you should consider a VB6 form like a
>>> class with a GUI this means that you may deal with a form just like you
>>> do with a class module (add and use properties, methods and events),
>>> sure, a Form may have a slightly different lifecycle since a user may
>>> decide to close it (it isn't possible with a class) but it shouldn't be
>>> difficult dealing with that
>>>
>>
>> This is BJ you're talking about, the village idiot, the town mooch, a
>> liberal and his EBT card. He'll tell you 'he tried' to look, but lies
>> like a two dollar whore. He won't show you his code (probably because he
>> has none to show) and show bits and pieces that make no sense.
>> E$verything he wants us to write for him flies against any MSFT UI
>> standards (which is usually an indication of a badly written app). This
>> will keep going and going until someone writes it all out for him. And
>> someone will. They always do.
>>
>> Just sit back and enjoy the show.
>
> You seem to think you are such a brain, when are you ever going to
> contribute to this newsgroup? All I see is a person with so little self
> esteem that he gets his jollies by ridiculing. Sad.
>

Well answered.
a bull's - eye

se

10/29/2013 8:38:00 PM

0


"CoderX" <coder@x.com> skrev i meddelelsen
news:l4ojl6$efl$1@dont-email.me...
>
> "Arne Saknussemm" <motz001.20.wannabet@spamgourmet.com> wrote in message
> news:20131029111134.000068aa@eternal-september.org...
>> Internet is that way --> and there you may find plenty of infos and
>> tutorials, given that you'll use a bit of your time to search, read and
>> understand; just to add a bit, you should consider a VB6 form like a
>> class with a GUI this means that you may deal with a form just like you
>> do with a class module (add and use properties, methods and events),
>> sure, a Form may have a slightly different lifecycle since a user may
>> decide to close it (it isn't possible with a class) but it shouldn't be
>> difficult dealing with that
>>
>
> This is BJ you're talking about, the village idiot, the town mooch, a
> liberal and his EBT card. He'll tell you 'he tried' to look, but lies
> like a two dollar whore. He won't show you his code (probably because he
> has none to show) and show bits and pieces that make no sense.
> E$verything he wants us to write for him flies against any MSFT UI
> standards (which is usually an indication of a badly written app). This
> will keep going and going until someone writes it all out for him. And
> someone will. They always do.
>
> Just sit back and enjoy the show.
>

FOAD !

Coder X

10/29/2013 11:29:00 PM

0


"BeeJ" <spamnot@nospam.com> wrote in message
news:l4p0lk$nk3$1@speranza.aioe.org...

> You seem to think you are such a brain, when are you ever going to
> contribute to this newsgroup? All I see is a person with so little self
> esteem that he gets his jollies by ridiculing. Sad.

I've contributed here for years, way before you ever crawled your way here.
I won't help *you* cause all I see is a sad, pathetic old man who has to
whine and complain that he can't write code (or be bothered to look it up
for himself) and has to nag everyone else into doing it for him. Those
kinds of people are the worst. You don't even try, and that's what makes
you a loser.


Coder X

10/29/2013 11:30:00 PM

0


"se" <se@no-one.here> wrote in message news:l4p6a7$apl$1@dont-email.me...
>
> FOAD !

Still irrelevant as ever, se.