Hi,
I got this bug on my system running Ubuntu (breezy):
/usr/lib/ruby/1.8/date/format.rb:598: [BUG] unknown node type 0
ruby 1.8.3 (2005-06-23) [i486-linux]
Tested the same code with ruby 1.8.2 (2004-12-25) [sparc-solaris2.9]
and got the following instead:
1) Error:
test_correct_login_event(TC_POSPresenter):
RuntimeError: POSModel::manager? takes -1, not 0, arguments
./test/mockposmodel.rb:34:in `method_missing'
./lib/pospresenter.rb:127:in `update'
/home/olda9867/ruby/lib/ruby/1.8/observer.rb:185:in `notify_observers'
/home/olda9867/ruby/lib/ruby/1.8/observer.rb:184:in `each'
/home/olda9867/ruby/lib/ruby/1.8/observer.rb:184:in `notify_observers'
./test/mockposview.rb:111:in `raise_login_event'
./test/tc_pospresenter.rb:301:in `test_correct_login_event'
I saw that the "node type 0" bug had been reported several times but
did not find anything on the second error message (takes -1, not 0,
arguments). Wanted to report this in case the second error message
could give further information about the bug.
In article <2572ec7805072905422866d465@mail.gmail.com>,
Ramzi Ferchichi <raziir@gmail.com> writes:
I got this bug on my system running Ubuntu (breezy):
/usr/lib/ruby/1.8/date/format.rb:598: [BUG] unknown node type 0
ruby 1.8.3 (2005-06-23) [i486-linux]
Although the bug is too hard to fix without a script to reproduce it,
following patch may show bit more information.
Index: eval.c
···
===================================================================
RCS file: /src/ruby/eval.c,v
retrieving revision 1.616.2.114
diff -u -p -r1.616.2.114 eval.c
--- eval.c 29 Jul 2005 01:00:07 -0000 1.616.2.114
+++ eval.c 30 Jul 2005 03:13:02 -0000
@@ -2806,7 +2806,15 @@ unknown_node(node)
NODE *volatile node;
{
ruby_current_node = 0;
- rb_bug("unknown node type %d", nd_type(node));
+ if (node->flags == 0) {
+ rb_bug("terminated node (0x%lx)", node);
+ }
+ else if (BUILTIN_TYPE(node) != T_NODE) {
+ rb_bug("not a node 0x%02lx (0x%lx)", BUILTIN_TYPE(node), node);
+ }
+ else {
+ rb_bug("unknown node type %d (0x%lx)", nd_type(node), node);
+ }
}
static VALUE
--
Tanaka Akira
Ramzi Ferchichi wrote:
Hi,
I got this bug on my system running Ubuntu (breezy):
/usr/lib/ruby/1.8/date/format.rb:598: [BUG] unknown node type 0
ruby 1.8.3 (2005-06-23) [i486-linux]
Tested the same code with ruby 1.8.2 (2004-12-25) [sparc-solaris2.9]
and got the following instead:
1) Error:
test_correct_login_event(TC_POSPresenter):
RuntimeError: POSModel::manager? takes -1, not 0, arguments
./test/mockposmodel.rb:34:in `method_missing'
./lib/pospresenter.rb:127:in `update'
/home/olda9867/ruby/lib/ruby/1.8/observer.rb:185:in `notify_observers'
/home/olda9867/ruby/lib/ruby/1.8/observer.rb:184:in `each'
/home/olda9867/ruby/lib/ruby/1.8/observer.rb:184:in `notify_observers'
./test/mockposview.rb:111:in `raise_login_event'
./test/tc_pospresenter.rb:301:in `test_correct_login_event'
I saw that the "node type 0" bug had been reported several times but
did not find anything on the second error message (takes -1, not 0,
arguments). Wanted to report this in case the second error message
could give further information about the bug.
Can you show us the code please?
Dan
I worked with the thread creator when we got this error. Later we
realized that the output in the case when it does not crash ("takes
-1, not 0, arguments") is of course (a bug) from our own code. Oops...
The weird thing is that the crash only occurs on his Ubuntu (breezy)
laptop and not on my Ubuntu (breezy) installation at home or our
Solaris workstations.
Anyway, thanks for the patch, we shall try to find time to test it.
-Olof
···
On 7/30/05, Tanaka Akira <akr@m17n.org> wrote:
In article <2572ec7805072905422866d465@mail.gmail.com>,
Ramzi Ferchichi <raziir@gmail.com> writes:
> I got this bug on my system running Ubuntu (breezy):
>
> /usr/lib/ruby/1.8/date/format.rb:598: [BUG] unknown node type 0
> ruby 1.8.3 (2005-06-23) [i486-linux]
Although the bug is too hard to fix without a script to reproduce it,
following patch may show bit more information.
Index: eval.c
RCS file: /src/ruby/eval.c,v
retrieving revision 1.616.2.114
diff -u -p -r1.616.2.114 eval.c
--- eval.c 29 Jul 2005 01:00:07 -0000 1.616.2.114
+++ eval.c 30 Jul 2005 03:13:02 -0000
@@ -2806,7 +2806,15 @@ unknown_node(node)
NODE *volatile node;
{
ruby_current_node = 0;
- rb_bug("unknown node type %d", nd_type(node));
+ if (node->flags == 0) {
+ rb_bug("terminated node (0x%lx)", node);
+ }
+ else if (BUILTIN_TYPE(node) != T_NODE) {
+ rb_bug("not a node 0x%02lx (0x%lx)", BUILTIN_TYPE(node), node);
+ }
+ else {
+ rb_bug("unknown node type %d (0x%lx)", nd_type(node), node);
+ }
}
static VALUE
--
Tanaka Akira