cast_object_to bug / PerlQt cvs compilation (Was Re: [Kde-bindings] [Bug 71316] QtRuby : Segmentation fault when loading Qt)

Richard Dale Richard_Dale at tipitina.demon.co.uk
Mon Jan 12 11:34:28 UTC 2004


On Sunday 11 January 2004 19:16, Alexander Kellett wrote:
> at the moment i'm working on a khtml based html documentation
> browser with searching functionality / automated index creation.
> unfortunately i've hit across a stumbling block which has now
> got me completely baffled.
>
> richard: could you take a look at cast_object_to in Qt::Internal
> and try running the example korundum/examples/kde.rb?
I can't find that method in kdebindings/qtruby/rubylib/qtruby/lib/Qt/qtruby.rb 
- is that where I should be looking? I think we need to fix the runtime to 
know about rtti that it can get from node.nodeType, and instanciate an 
instance of the correct  DOM:: class.

     until node.isNull
         puts "NODE NAME :: #{node.inspect}"
         if node.nodeType == 9 # DOM::Node::TEXT_NODE
            blah = Qt::Internal::cast_object_to(node, "KDE::DOM::Text")
            str = puts '"' + blah.data.string + '"'
         end
         if not node.firstChild.isNull

> this example contains the currently crashing script. just export
> BASEDOCURL with an interesting html file and load up kde.rb
> then click the debug button. it'll crash immeditely. i'd like
> to get this repeated in PerlQt to find out if its a smoke or
> qtruby/kordundum bug, which i assume it is, as i really don't
> understand the code that i've currently got in , somehow
> the cast and then subsequent calls on the resulting VALUE
> object are causing stack corruption problems later on in
> the execution. removing the line accessing the text node's
> string stops the crash later on in the document.
Well, it looks to be a problem with cast_object_to() not working I would have 
thought. Either check in the code for the method or post in on kdebindings, 
but I think the best solution is to avoid needing it.

-- Richard



More information about the Kde-bindings mailing list