Re: Crash during displaying drop-down menu for server

From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
To: "Tomasz Rybak" <bogomips(at)post(dot)pl>, "pgAdmin Hackers" <pgadmin-hackers(at)postgresql(dot)org>
Cc: "Andreas Pflug" <pgadmin(at)pse-consulting(dot)de>
Subject: Re: Crash during displaying drop-down menu for server
Date: 2005-10-07 10:05:02
Message-ID: E7F85A1B5FF8D44C8A1AF6885BC9A0E4CC3263@ratbert.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

> -----Original Message-----
> From: pgadmin-hackers-owner(at)postgresql(dot)org
> [mailto:pgadmin-hackers-owner(at)postgresql(dot)org] On Behalf Of
> Tomasz Rybak
> Sent: 06 October 2005 19:18
> To: pgAdmin Hackers
> Subject: [pgadmin-hackers] Crash during displaying drop-down
> menu for server
>
> I updated my sources to 4512, compiled and installed.
> When I run pgAdmin, and try to right-click on server
> in databases tree, pgAdmin crashes.
>
> After little debugging I discovered, that problem is in
> src/main/events.cpp, frmMain::doPopup.
>
> pgAdmin crashes in line 466:
> if (mil.Item(newItemPos)->GetData()->GetId() == newItem->GetId())
>
> It's caused because newItem is NULL, and it isn't received in line 458
> wxMenuItem
> *newItem=treeContextMenu->FindItem(newMenuFactory->GetId());
> What's strange, wxASSERT from next line isn't even called (at
> least not
> under GDB). I compiled using standard Debian setting, only added -ggdb
> for compiler and removed dh_strip from pkg/debian/rules.
>
> Message from GDB:
> #0 0x0807a083 in frmMain::doPopup (this=0x87680f0, win=0x8d0c640,
> point=
> {x = 145, y = 43}, object=0x8699340) at ./main/events.cpp:466
> 466 if (mil.Item(newItemPos)->GetData()->GetId() ==
> newItem->GetId())
>
> When I double-click on database in tree view (so pgAdmin is connected
> to it) and after that I right-click on it's entry, pgAdmin doesn't
> crash.

Yes, I can confirm this on Windows. I think the problem actually comes
from line 458:

wxMenuItem
*newItem=treeContextMenu->FindItem(newMenuFactory->GetId());
wxASSERT(newItem);

Where newItem is null if not connected to the server. I'm not sure how
to fix this - Andreas, can you look at it please?

Thanks, Dave.

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message svn 2005-10-07 10:32:24 SVN Commit by dpage: r4519 - trunk/pgadmin3/src/ui
Previous Message svn 2005-10-07 09:52:43 SVN Commit by dpage: r4518 - in trunk/pgadmin3: pkg/win32/src src