×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Dec 2009
    Posts
    5

    atk_object_set_name: assertion 'name != NULL' failed

    I've just started using Qt and I'm creating a simple application that adds a button to the main window app and when I click the button, the application is closed. Even in this simple example I'm getting a weird message everytime I launch my application. I'm using qtsdk-2009.05 sdk in ubuntu 9.10. Could someone help me identify what is wrong with my code?

    Here's the error:

    ** (<unknown>:8326): CRITICAL **: atk_object_set_name: assertion 'name != NULL' failed


    Here's the code:

    #include <QtGui/QApplication>
    #include <QtGui/QPushButton>

    int main(int argc, char *argv[])
    {
    QApplication app(argc, argv);

    QPushButton *button = new QPushButton("Quit");
    QObject::connect(button, SIGNAL(clicked()),&app, SLOT(quit()));
    button->show();

    return app.exec();

    }

    Thanks

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2009
    Posts
    430

    Re: atk_object_set_name: assertion 'name != NULL' failed

    Your code is correct, there has be another source for the problem.

  3. #3
    Registered User
    Join Date
    Dec 2009
    Posts
    5

    Re: atk_object_set_name: assertion 'name != NULL' failed

    Thanks for your reply. I also found that using the same code and qmake from version 4.5.2 instead of 4.6.0, I get no error message. Either way the programs behaves as expected and the only difference is the message when using 4.6.0.

  4. #4
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: atk_object_set_name: assertion 'name != NULL' failed

    The sample code without memory leaks:

    Code:
    #include <QApplication>
    #include <QPushButton>
    
    int main(int argc, char *argv[])
    {
        QApplication app(argc, argv);
    
        QPushButton button("Quit");
        QObject::connect(&button, SIGNAL(clicked()),&app, SLOT(quit()));
        button.show();
    
        return app.exec();
    }

    I've tried
    Code:
    ldd your_binary | grep atk
    for Qt 4.5.3 and it's not using libatk. I cannot try it now for Qt 4.6, it would be interesting to see the results.

  5. #5
    Registered User
    Join Date
    Dec 2009
    Posts
    5

    Re: atk_object_set_name: assertion 'name != NULL' failed

    Hi Divanov,

    I've just compiled the code as you sent on your post, using 4.6.0 qmake and libs, and got the output below when ran "ldd helloqt46 (my bin file)" and found the following:

    1) atklib is not present
    2) libQtGui.so.4 is linked to libQtGui.so.4.6.0 - inside /opt/qtsdk-2009.05/qt/lib folder
    3) libQtCore.so.4 is linked to libQtCore.so.4.6.0 - inside /opt/qtsdk-2009.05/qt/lib folder
    4) Keep getting the same error msg but the program ran as expected
    5) ldd helloqt46 output:

    linux-gate.so.1 => (0x00e6c000)
    libQtGui.so.4 => /opt/qtsdk-2009.05/qt/lib/libQtGui.so.4 (0x00e6d000)
    libQtCore.so.4 => /opt/qtsdk-2009.05/qt/lib/libQtCore.so.4 (0x00a22000)
    libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0x007db000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00602000)
    libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0x00110000)
    libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00136000)
    libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x002ba000)
    libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0x00154000)
    librt.so.1 => /lib/tls/i686/cmov/librt.so.1 (0x005eb000)
    libglib-2.0.so.0 => /lib/libglib-2.0.so.0 (0x0015a000)
    libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x004e9000)
    libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0x00211000)
    libSM.so.6 => /usr/lib/libSM.so.6 (0x0024f000)
    libICE.so.6 => /usr/lib/libICE.so.6 (0x00258000)
    libXrender.so.1 => /usr/lib/libXrender.so.1 (0x00273000)
    libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x0027d000)
    libz.so.1 => /lib/libz.so.1 (0x003fe000)
    libXext.so.6 => /usr/lib/libXext.so.6 (0x00deb000)
    libX11.so.6 => /usr/lib/libX11.so.6 (0x007f4000)
    libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0x002aa000)
    /lib/ld-linux.so.2 (0x00780000)
    libpcre.so.3 => /lib/libpcre.so.3 (0x005a3000)
    libuuid.so.1 => /lib/libuuid.so.1 (0x002ae000)
    libexpat.so.1 => /lib/libexpat.so.1 (0x00414000)
    libXau.so.6 => /usr/lib/libXau.so.6 (0x002b3000)
    libxcb.so.1 => /usr/lib/libxcb.so.1 (0x0043b000)
    libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00459000)

    Thanks,

  6. #6
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: atk_object_set_name: assertion 'name != NULL' failed

    Quote Originally Posted by edgarlsfilho View Post
    Hi Divanov,

    I've just compiled the code as you sent on your post
    Well, memory leak doesn't affect glib criticals and atk.

    Quote Originally Posted by edgarlsfilho View Post
    1) atklib is not present
    The correct package name in Ubuntu is libatk: http://packages.ubuntu.com/jaunty/libatk1.0-0

    Quote Originally Posted by edgarlsfilho View Post
    4) Keep getting the same error msg but the program ran as expected
    Atk is accessibility toolkit Gtk is using in automated GUI testing. I've never heard that Qt was/is using Atk. My guess is that glib critical is coming not from your application and ldd shows it's not really using Atk (unless it's statically linked in some of the libraries, which would be strange).

    The next step I would try is to install libatk1.0-dbg, run gdb (gdb helloqt46)
    and try to set breakpoint (b atk_object_set_name). At this point gdb should complain that it didn't find atk_object_set_name symbol. c - to continue execution until breakpoint is reached.
    Last edited by divanov; 2010-01-01 at 09:35.

  7. #7
    Nokia Developer Champion
    Join Date
    Mar 2009
    Posts
    430

    Re: atk_object_set_name: assertion 'name != NULL' failed

    Are you using the gnome desktop and therefore Qt applications get styled using the gtk-style? This way gtk and friends are going into your application. Try to start your application with -style windows and see whether the problem is still there.

  8. #8
    Registered User
    Join Date
    Dec 2009
    Posts
    5

    Re: atk_object_set_name: assertion 'name != NULL' failed

    Hi Axeljaeger,

    I've just tried execute the program as you suggested (using "-style windows") and got the program running without the error msg. Based on your explanation it seems to be something with Gtk then. When I supply something as style, the program logs no error message.

    Follows the output USING "-style windows/cde/motif/gtk-style" - (no error msg):
    $ ./helloqt46 -style windows
    $ ./helloqt46 -style cde
    $ ./helloqt46 -style motif
    $ ./helloqt46 -style gtk-style

  9. #9
    Registered User
    Join Date
    Jan 2010
    Posts
    1

    Re: atk_object_set_name: assertion 'name != NULL' failed

    Ran across this thread looking for an answer to the same problem ... which I then found, so I thought I'd pop back here and post.

    It's a known bug in GTK, and should be fixed in the next release. You'll actually see a lot of applications throwing this message currently on a new Linux release like Ubuntu 9.10.

    - Roach

Similar Threads

  1. [moved] Cannot run the S60 5th ed Emulator (tagma.dll assertion)
    By Carbider in forum Symbian Tools & SDKs
    Replies: 20
    Last Post: 2010-06-07, 17:21
  2. S60 5th ed emulator startup failed
    By hony in forum Symbian Tools & SDKs
    Replies: 8
    Last Post: 2009-08-11, 21:12
  3. emulator startup failed
    By hony in forum Symbian User Interface
    Replies: 3
    Last Post: 2008-11-11, 06:07
  4. Please its veru urgent on nokia 3250
    By siva_guduru in forum Mobile Java General
    Replies: 8
    Last Post: 2008-05-01, 10:24
  5. S60 2nd to 3rd/ PlatformSecurity / Capabilities
    By jarkoos in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 4
    Last Post: 2007-04-14, 14:08

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •