Hugin - Panorama Tools GUI

About window crashes on OSX for 2011.0 beta versions

Reported by hvdwolf on 2011-03-12
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Hugin
Undecided
Unassigned

Bug Description

The aboutdialog.cpp crashes hugin in the 2011 branch. The aboutdialog in the trunk works correctly.

This is due to the fact that the aboutdialog.cpp within the 2011.0 (beta) branch is different from the trunk one.
I have already been fiddling with the code the past couple of days but I'm obviously an even worse programmer than I expected to be as I can't repair it.

Can this please be fixed?

The trunk contains the code (This functions!):
=====================================
void AboutDialog::SetMode(int newMode)
{
    if(m_mode==newMode){
        return;
    }
    if((newMode!=6)&&(m_mode!=6)){
        m_mode=newMode;
        return;
    }
    // image to be displayed on dedication tab
    if(newMode==6){
        m_logo.LoadFile(huginApp::Get()->GetXRCPath() +
                        wxT("data/") + wxT("logo.png"),
                        wxBITMAP_TYPE_PNG);
        m_logoImgCtrl->SetBitmap(m_logo);
        m_mode=newMode;
        return;
    }
    // image to be displayed on any other tab
    if(m_mode==6){
        m_logo.LoadFile(huginApp::Get()->GetXRCPath() +
                        wxT("data/") + wxT("logo.png"),
                        wxBITMAP_TYPE_PNG);
        m_logoImgCtrl->SetBitmap(m_logo);
        m_mode=newMode;
        return;
    }
};
=====================================

The 2011.0 branch contains the code (This crashes hugin!):
=====================================
void AboutDialog::SetMode(int newMode)
{
    if(m_mode==newMode){
        return;
    }

    switch ( newMode ) {

        case 0 :
            // about tab
   wxString strFile = MacGetPathToBundledResourceFile(CFSTR("splash.png"));
   SetLogo(wxT(strFile));
            break;

        case 6 :
            // dedication tab
   strFile = MacGetPathToBundledResourceFile(CFSTR("dedication.png"));
   SetLogo(wxT(strFile));
            break;

        default :
            // all other tabs
   strFile = MacGetPathToBundledResourceFile(CFSTR("logo.png"));
   SetLogo(wxT(strFile));

    }

    m_mode=newMode;
    return;
};
=====================================

hvdwolf (hvdwolf) wrote :

I'm very, very sorry. The code segment for the 2011.0 branch in the previous post was one of my latest tries (and doesn't even compile).

The correct code segment from the 2011.0 branch, that makes Hugin crash on OSX, is:
=====================================
void AboutDialog::SetMode(int newMode)
{
    if(m_mode==newMode){
        return;
    }

    switch ( newMode ) {

        case 0 :
            // about tab
            SetLogo(wxT("splash.png"));
            break;

        case 6 :
            // dedication tab
            SetLogo(wxT("dedication.png"));
            break;

        default :
            // all other tabs
            SetLogo(wxT("logo.png"));
    }

    m_mode=newMode;
    return;
};
=====================================

Bruno Postle (brunopostle) wrote :

Also crashes on Linux, current 2011.0.0 snaphot.

tmodes (tmodes) wrote :

Is snapshot the released beta version? This should be fixed in 2011.0 branch. See https://bugs.launchpad.net/hugin/+bug/726318

To my knowledge the "snapshot" is always the latest version at that moment
when you take the snapshot (= quick picture with camera). So that should be
the trunk.
Trunk works for me.

Harry

2011/3/13 tmodes <email address hidden>

> Is snapshot the released beta version? This should be fixed in 2011.0
> branch. See https://bugs.launchpad.net/hugin/+bug/726318
>
>

Bruno Postle (brunopostle) wrote :

I see the crash (just a segfault with no other messages) on fedora 14 i386, 2011.0 branch, from 11th March, HG 5098:45dc653144f3. Deleting the ~/.hugin file makes no difference.

The same snapshot on fedora 13 x86_64 is ok. These are both built in mock chroots, so they should be 'clean' installs. f13 and f14 have the same version of wxwidgets. So I don't have any ideas, if nobody else can reproduce on Linux then we can probably ignore this.

tmodes (tmodes) wrote :

It works on windows, so I booted into Ubuntu and can now reproduce the crash. But not yet a solution found.

tmodes (tmodes) wrote :

Should be fixed in branch now.

Changed in hugin:
milestone: none → 2011.0beta3
status: New → Fix Committed
hvdwolf (hvdwolf) wrote :

As far as I could detect the patch was a onely a the addition of "m_logoImgCtrl=NULL;"
I applied that patch to my beta2, but the about windows still crashes.

Yuv (yuv) wrote :

tried to initialize a couple of variables more. please try again with changeset 5109:3a274f80c25f or later

tmodes (tmodes) wrote :

There are changes from 2 changeset necessary to fix this crash: 038c0de240d6 and 0b204475079d. So it is not sufficient to only apply 0b204475079d to beta2, because 038c0de240d6 was pushed after beta2.

hvdwolf (hvdwolf) wrote :

Hi Yuv,

2011/3/13 Yuv <email address hidden>

> tried to initialize a couple of variables more. please try again with
> changeset 5109:3a274f80c25f or later
>
>
Your patch works, at least on OSX.

thanks.

Harry

hvdwolf (hvdwolf) wrote :

2011/3/13 tmodes <email address hidden>

> There are changes from 2 changeset necessary to fix this crash:
> 038c0de240d6 and 0b204475079d. So it is not sufficient to only apply
> 0b204475079d to beta2, because 038c0de240d6 was pushed after beta2.
>
>
>
I applied both your an Yuv's patch and now it works.

Harry

hvdwolf (hvdwolf) wrote :

I committed the patches by hand to the 2011-beta2 version.
First Thomas patch and then, on top of that, Yuv's patch.

Now the About dialog works.

hvdwolf (hvdwolf) wrote :

And finally I committed the third patch where Thomas undid part of Yuv's patch.

It still works fine on OSX.

Thanks all.

Yuv (yuv) on 2011-03-13
Changed in hugin:
status: Fix Committed → Fix Released
Bruno Postle (brunopostle) wrote :

Thanks, fix works here

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers