[Kde-bindings] KRecentFilesAction#add_url crash

David Palacio dpalacio at uninorte.edu.co
Wed Dec 31 21:08:34 UTC 2008


Attached is a Korundum application that triggers a strange crash.

To install use either CMake and point it to a KDE dir or run setup.rb. Then 
call krubyapplication/reader.rb.

How to reproduce:
1) Open a few files with the open dialog
2) Reopen previous files with «Open recent» in the File menu

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f7aff0416f0 (LWP 7899)]
QUrlPrivate::toEncoded (this=0x100000000, options={i = 117837024}) at 
io/qurl.cpp:3609
3609    io/qurl.cpp: No such file or directory.
        in io/qurl.cpp
Current language:  auto; currently c++


"Fix". In:
if @url
  @recent_action.add_url( @url )
  puts @url.inspect
  puts @url.path
  set_caption @url.file_name
end

Put @recent_action.add_url( @url ) at the end of the conditional.

It is not fixed by: Creating a new KURL with the copy constructor nor creating 
a KURL with @url.path_or_url as parameter. Passing an unrelated KUrl (e.g. 
empty) does not crash.

Clearly the problem occurs when the add_url is called with @url or a KUrl 
based on it.


Why do I think this is not a Qt or KDE bug? I had another strange crash with 
the Okular Ruby generator. It fails an assert in a QIODevice when this does 
not happen with the C++ generator(which is basically the same).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reader.tar.gz
Type: application/x-compressed-tar
Size: 4786 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20081231/e257a847/attachment.tar.gz>


More information about the Kde-bindings mailing list