Skip navigation.
Home
The QNX Community Portal

View topic - Core dump after setting image resource

Core dump after setting image resource

Isn't the name clear?

Core dump after setting image resource

Postby fhuett » Fri Oct 31, 2008 2:19 pm

Hi Folks

I've some problems when setting the Pt_ARG_IMAGEAREA_IMAGE resource at a PtImageArea.

In my project I use a PtImageArea to show some different pictures depending on a external database value. To do so I use a PtImageArea for output which is also the parent of the construction and furthermore I've attached some PtImageAreas as children for storing the PhImage_t information of different pictures.

The idea is to scan all the attached children, when the db value was changed and than get the _IMAGE resource from the fitting children to display it at the parent widget.

It works fine in PhAB! Every time I change my db value, PtGetResource delivers a pointer to the _IMAGE resource of the selected widget and the output widget displays the picture.

But when I run my application outside of PhAB, the application quits service after I chose a selected value for the second time. The PtGetReource call also delivers a pointer (the same one as in the first call) to the _IMAGE resource of the fitting children widget but than after the PtSetReource call the application runs into a core dump.

I've add a simplified example of what is called when the db value was changed.

Expl.:

Code: Select all
PtWidget_t     *Child;

for ( Child = PtWidgetChildBack (pWidget); Child; Child = PtWidgetBrotherInFront (Child) )
{
    int                    Rtc = 0;
    PhImage_t      *Image;

    Rtc += PtGetResource ( Child, Pt_ARG_IMAGEAREA_IMAGE, &Image, 0 );

    if ( Rtc != 0 ) continue;

    switch (...)
    {
    ...
    case RTR_COMPMODE_EQUAL:
      if ( ... )
      {
        PtSetResource  ( Parent->WgtImageArea, Pt_ARG_IMAGEAREA_IMAGE, Image, 0 );
       
        // PtDamageWidget ( Parent->WgtImageArea ); // tried
      }
      break;
    }
}


Some idea why this happens? Or is there a more detailed description necessary?

Thanks for your help!
fhuett
New Member
 
Posts: 2
Joined: Wed Oct 31, 2007 3:30 pm

RE: Core dump after setting image resource

Postby juanplacco » Fri Oct 31, 2008 8:03 pm

When you run the app outside de builder, are you sure you are running the same executable? Maybe you are running the debug version from inside and the realese version from the outside. Check <your_traget>/o-g/your_app_g....

Try these as first aproach.

Juan Manuel
juanplacco
Senior Member
 
Posts: 318
Joined: Wed May 17, 2006 2:30 pm

RE: Core dump after setting image resource

Postby fhuett » Mon Nov 03, 2008 8:26 am

The code above is part of a custom widget library and I use it precompiled (as lib) in another project. So I'm relative sure PhAB uses the same binary as the executable.

Franz
fhuett
New Member
 
Posts: 2
Joined: Wed Oct 31, 2007 3:30 pm

RE: Core dump after setting image resource

Postby juanplacco » Mon Nov 03, 2008 3:22 pm

You should debug your core dump file. You must run the "dumper" process if it isn't running yet. After that, run your app. Then debbug your /var/dumps/app.core. Doing a backtrace (bt) you should realize what your program was trying to do when died.

Regards,
Juan Manuel
juanplacco
Senior Member
 
Posts: 318
Joined: Wed May 17, 2006 2:30 pm


Return to GUI Programming

Who is online

Users browsing this forum: No registered users and 3 guests

cron