[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    problem with KCmdLineArgs::init() (was: weird issue in kalzium)
From:       Benoit Jacob <jacob () math ! jussieu ! fr>
Date:       2007-08-29 20:02:07
Message-ID: 20070829214958.N2618 () cantor ! math ! jussieu ! fr
[Download RAW message or body]

Hi Thiago,

I followed your advice and I've narrowed the problem very much:
it seems to be caused by KCmdLineArgs::init() !

What I've done is the following. I have tested OpenBabel's 
capability to return the full English name of an element from its 
atomic number. For instance, given the number 6, it must return 
"Carbon".

First, I've added some qDebug() to Kalzium's main.cpp to test that. The 
bug was triggered.

Then, I removed almost everything in main.cpp:

----- File:/trunk/KDE/kdeedu/kalzium/src/main.cpp -----
#include <iostream>
#include <openbabel/mol.h>
#include <kaboutdata.h>
#include <kcmdlineargs.h>
#include <klocale.h>
int main(int argc, char **argv) {
     KAboutData about("kalzium", 0, ki18n("Kalzium"), "150");
     KCmdLineArgs::init(argc, argv, &about);
     std::cout << "Here's how I spell Carbon: "
       << OpenBabel::etab.GetName(6) << std::endl;
     return 0;
}
----- End of file -----

And it still triggered the bug.

Then I commented out the line:
//  KCmdLineArgs::init(argc, argv, &about);

And the bug was no longer triggered!

So it seems to be related somehow to KCmdLineArgs::init().

This is far, far beyond my understanding :)

Cheers,
Benoit

On Wed, 29 Aug 2007, Thiago Macieira wrote:

> On Wednesday 29 August 2007 20:04:29 Benoit Jacob wrote:
>> Actually the problem is even worse than that, and not limited to global
>> objects.
>>
>> When we load molecules from files using OpenBabel, the Molecule object
>> that OpenBabel gives us has corrupted data. The atoms look like they are
>> aligned on a grid. Most likely, their coordinates, which are doubles, are
>> casted to ints.
>>
>> So it looks like, all the data the OpenBabel passes to us is corrupted by
>> some kind of unwanted casting to type it.
>>
>> The only data that's not getting corrupted is chars, so that agrees with
>> the theory that the corruption consists in casting all the data to ints.
>>
>> Do you have an idea? That looks very much like a linkage issue...
>
> From your description, I doubt it is a linkage issue.
>
> You said the Molecule object that OpenBabel gives you has corrupted data. The
> only way for that corrupted data to be there is for OpenBabel to have put it
> there.
>
> Or if you're reading it wrongly -- that is, binary incompatibly.
>
> Can you test your sample program with a normal compilation and a
> KDE-CMake-based compilation and see if the problem is reproduceable?
>
> In other words, start from your broken Kalzium and remove parts of it until
> your program starts working again (remove other modules, remove other
> libraries, remove the buildsystem).
>
> -- 
>   Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
>     PGP/GPG: 0x6EF45358; fingerprint:
>     E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
>

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic