[Kde-bindings] [Bug 229787] New: rbqtapi terminated with segmentation fault.

Richard Dale richard.dale at telefonica.net
Sun Mar 7 15:50:08 UTC 2010


On Sunday 07 March 2010 09:49:04 am ruby.twiddler at gmail.com wrote:
> https://bugs.kde.org/show_bug.cgi?id=229787
> 
>            Summary: rbqtapi terminated with segmentation fault.
>            Product: bindings
>            Version: unspecified
>           Platform: Compiled Sources
>         OS/Version: Linux
>             Status: UNCONFIRMED
>           Severity: normal
>           Priority: NOR
>          Component: general
>         AssignedTo: kde-bindings at kde.org
>         ReportedBy: ruby.twiddler at gmail.com
> 
> 
> Version:           Rev: 1097205 Last Changed Date: 2010-03-01 (using KDE
> 4.4.0) OS:                Linux
> Installed from:    Compiled From Sources
> 
> rbqtapi terminated with segmentation fault.
> 
> execute rbqtapi.
> rbqtapi:89: [BUG] Segmentation fault
> 
> here is my patch to fix this.
> diff -x .svn -uNrb kdebindings-latest/ruby/qtruby/bin/rbqtapi
> kdebindings-fix/ruby/qtruby/bin/rbqtapi
> --- kdebindings-latest/ruby/qtruby/bin/rbqtapi    2010-03-05
> 11:10:05.000000000 +0900
> +++ kdebindings-fix/ruby/qtruby/bin/rbqtapi    2010-03-06
> 14:04:54.000000000 +0900
> @@ -70,7 +70,7 @@
>  else
>    ARGV.each do |classname|
>      classid = Qt::Internal::find_pclassid(classname)
> -    if !classid.index
> +    if classid.smoke < 0 or !classid.index
>        puts "ERROR: class '#{classname}' not found"
>        exit 1
>      end
> @@ -82,7 +82,7 @@
> 
>  classnames.each do |classname|
>    classid = Qt::Internal::find_pclassid(classname)
> -  if !classid.index
> +  if classid.smoke < 0 or !classid.index
>      next
>    end
This patch looks wrong to me. If find_pclassid() doesn't find the classname it 
returns a null module index where both the 'Smoke * smoke' value and the index 
are zero. 'classid.smoke' should never be less than zero.

But the real problem here is the code that is mixing C++ and Ruby code, when 
really it all should be written in C++. This stuff is all much more complicated 
and error prone than it need be. 

-- Richard



More information about the Kde-bindings mailing list