Thread: Drop schema/Create new schema SIGSEGV - pgadmin3 git version

Drop schema/Create new schema SIGSEGV - pgadmin3 git version

From
Vladimir Kokovic
Date:
Hi,

If I try to drop or create new schema 'Program received signal
SIGSEGV, Segmentation fault' happened.

Problem is in the line 51 of pgadmin3/pgadmin/ctl/ctlDefaultSecurityPanel.cpp.

Should be: if (conn && conn->BackendMinimumVersion(9, 2))


root@vlD-kuci:/tmp# gdb --args
/media/sda5/tmp/pgadmin3-git/debug/pgadmin/pgadmin3 GNU gdb
(Ubuntu/Linaro 7.3-0ubuntu2) 7.3-2011.08
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /media/sda5/tmp/pgadmin3-git/debug/pgadmin/pgadmin3...done.
(gdb) run
Starting program: /media/sda5/tmp/pgadmin3-git/debug/pgadmin/pgadmin3
[Thread debugging using libthread_db enabled]
06:06:13 PM: Debug: Adding duplicate image handler for 'PNG file'
[New Thread 0xb52c8b70 (LWP 27284)]
[Thread 0xb52c8b70 (LWP 27284) exited]

Program received signal SIGSEGV, Segmentation fault.
0x080d3198 in pgConn::BackendMinimumVersion (this=0x0, major=9,
minor=2) at ../../pgadmin3/pgadmin/db/pgConn.cpp:442
442             if (!majorVersion)
(gdb) bt
#0  0x080d3198 in pgConn::BackendMinimumVersion (this=0x0, major=9,
minor=2) at ../../pgadmin3/pgadmin/db/pgConn.cpp:442
#1  0x080b4c0a in ctlDefaultSecurityPanel::ctlDefaultSecurityPanel
(this=0x9319790, conn=0x0, nb=0x92b5710, imgList=0x9106890)   at
../../pgadmin3/pgadmin/ctl/ctlDefaultSecurityPanel.cpp:51
#2  0x081b225a in
dlgDefaultSecurityProperty::dlgDefaultSecurityProperty
(this=0x92afe80, f=0x88c0ec0, frame=0x90dc7c8, obj=0x0,   resName=..., privList=..., privChar=0x856511c "UC",
createDefPrivPanel=true) at
../../pgadmin3/pgadmin/dlg/dlgProperty.cpp:1920
#3  0x081bed74 in dlgSchema::dlgSchema (this=0x92afe80, f=0x88c0ec0,
frame=0x90dc7c8, node=0x0, parent=0x92448e8)   at ../../pgadmin3/pgadmin/dlg/dlgSchema.cpp:34
#4  0x081becea in pgSchemaBaseFactory::CreateDialog (this=0x88c0ec0,
frame=0x90dc7c8, node=0x0, parent=0x92448e8)   at ../../pgadmin3/pgadmin/dlg/dlgSchema.cpp:30
#5  0x084ad21a in pgaCollectionFactory::CreateDialog (this=0x88c0f80,
frame=0x90dc7c8, node=0x0, parent=0x92448e8)   at ../../pgadmin3/pgadmin/utils/factory.cpp:221
#6  0x081aed43 in dlgProperty::CreateDlg (frame=0x90dc7c8,
node=0x925fd00, asNew=true, factory=0x88c0f80)   at ../../pgadmin3/pgadmin/dlg/dlgProperty.cpp:1219
#7  0x081aeea6 in dlgProperty::CreateObjectDialog (frame=0x90dc7c8,
node=0x925fd00, factory=0x88c0f80)   at ../../pgadmin3/pgadmin/dlg/dlgProperty.cpp:1254
#8  0x0821f26c in frmMain::OnNew (this=0x90dc7c8, ev=...) at
../../pgadmin3/pgadmin/frm/events.cpp:1025
#9  0xb7781a98 in wxAppConsole::HandleEvent (this=0x896c570,
handler=0x90dc7c8, func=   (void (wxEvtHandler::*)(wxEvtHandler * const, wxEvent &))
0x821f1a2 <frmMain::OnNew(wxCommandEvent&)>, event=...)   at ../src/common/appbase.cpp:322
#10 0xb782d33a in wxEvtHandler::ProcessEventIfMatches (entry=...,
handler=0x90dc7c8, event=...) at ../src/common/event.cpp:1239
#11 0xb782d7b1 in wxEvtHandler::SearchDynamicEventTable
(this=0x90dc7c8, event=...) at ../src/common/event.cpp:1421
#12 0xb782d914 in ProcessEvent (event=..., this=0x90dc7c8) at
../src/common/event.cpp:1297
#13 wxEvtHandler::ProcessEvent (this=0x90dc7c8, event=...) at
../src/common/event.cpp:1272
#14 0xb782d8c9 in ProcessEvent (event=..., this=0x90dc9e4) at
../src/common/event.cpp:1308
#15 wxEvtHandler::ProcessEvent (this=0x90dc9e4, event=...) at
../src/common/event.cpp:1272
#16 0xb7b38ffb in wxWindowBase::TryParent (this=0x918f600, event=...)
at ../src/common/wincmn.cpp:2661
#17 0xb782d8de in ProcessEvent (event=..., this=0x918f600) at
../src/common/event.cpp:1314
#18 wxEvtHandler::ProcessEvent (this=0x918f600, event=...) at
../src/common/event.cpp:1272
#19 0xb782d8c9 in ProcessEvent (event=..., this=0x918d280) at
../src/common/event.cpp:1308
#20 wxEvtHandler::ProcessEvent (this=0x918d280, event=...) at
../src/common/event.cpp:1272
#21 0xb7b6b709 in wxScrollHelperEvtHandler::ProcessEvent
(this=0x918d280, event=...) at ../src/generic/scrlwing.cpp:208
#22 0xb7b137b5 in wxMenuBase::SendEvent (this=0x91f4e60, id=386,
checked=-1) at ../src/common/menucmn.cpp:792
#23 0xb7a98334 in gtk_menu_clicked_callback (widget=0x921ff58,
menu=0x91f4e60) at ../src/gtk/menu.cpp:658
#24 0xb6d6814c in g_cclosure_marshal_VOID__VOID () from
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#25 0xb6d66c3c in g_closure_invoke () from
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#26 0xb6d799f0 in ?? () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#27 0xb6d82787 in g_signal_emit_valist () from
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#28 0xb6d828f3 in g_signal_emit () from
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0
---Type <return> to continue, or q <return> to quit---
#29 0xb70c84d5 in gtk_widget_activate () from
/usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#30 0xb6fa5977 in gtk_menu_shell_activate_item () from
/usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#31 0xb6fa5d81 in ?? () from /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#32 0xb6f9905d in ?? () from /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#33 0xb6f8fc52 in ?? () from /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#34 0xb6d6568d in ?? () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#35 0xb6d66c3c in g_closure_invoke () from
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#36 0xb6d79838 in ?? () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#37 0xb6d82599 in g_signal_emit_valist () from
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#38 0xb6d828f3 in g_signal_emit () from
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#39 0xb70c9553 in ?? () from /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#40 0xb6f8deae in gtk_propagate_event () from
/usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#41 0xb6f8e240 in gtk_main_do_event () from
/usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#42 0xb6e00888 in ?? () from /usr/lib/i386-linux-gnu/libgdk-x11-2.0.so.0
#43 0xb6c8425f in g_main_context_dispatch () from
/lib/i386-linux-gnu/libglib-2.0.so.0
#44 0xb6c84990 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#45 0xb6c84c2a in g_main_context_iteration () from
/lib/i386-linux-gnu/libglib-2.0.so.0
#46 0xb6f8d231 in gtk_main_iteration () from
/usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#47 0xb7a988ad in wxWindow::DoPopupMenu (this=0x918f600,
menu=0x91f4e60, x=175, y=569) at ../src/gtk/menu.cpp:1730
#48 0x080ac964 in wxWindowBase::PopupMenu (this=0x918f600,
menu=0x91f4e60, pos=...) at /usr/include/wx-2.8/wx/window.h:924
#49 0x0821dae1 in frmMain::doPopup (this=0x90dc7c8, win=0x918f600,
point=..., object=0x925fd00) at
../../pgadmin3/pgadmin/frm/events.cpp:690
#50 0x0821dd65 in frmMain::OnSelRightClick (this=0x90dc7c8, event=...)
at ../../pgadmin3/pgadmin/frm/events.cpp:733
#51 0xb7781a98 in wxAppConsole::HandleEvent (this=0x896c570,
handler=0x90dc7c8, func=   (void (wxEvtHandler::*)(wxEvtHandler * const, wxEvent &))
0x821dc60 <frmMain::OnSelRightClick(wxTreeEvent&)>, event=...)   at ../src/common/appbase.cpp:322
#52 0xb782d33a in wxEvtHandler::ProcessEventIfMatches (entry=...,
handler=0x90dc7c8, event=...) at ../src/common/event.cpp:1239
#53 0xb782d4aa in wxEventHashTable::HandleEvent (this=0x88ba8c4,
event=..., self=0x90dc7c8) at ../src/common/event.cpp:906
#54 0xb782d939 in ProcessEvent (event=..., this=0x90dc7c8) at
../src/common/event.cpp:1301
#55 wxEvtHandler::ProcessEvent (this=0x90dc7c8, event=...) at
../src/common/event.cpp:1272
#56 0xb782d8c9 in ProcessEvent (event=..., this=0x90dc9e4) at
../src/common/event.cpp:1308
#57 wxEvtHandler::ProcessEvent (this=0x90dc9e4, event=...) at
../src/common/event.cpp:1272
#58 0xb7b38ffb in wxWindowBase::TryParent (this=0x918f600, event=...)
at ../src/common/wincmn.cpp:2661
#59 0xb782d8de in ProcessEvent (event=..., this=0x918f600) at
../src/common/event.cpp:1314
#60 wxEvtHandler::ProcessEvent (this=0x918f600, event=...) at
../src/common/event.cpp:1272
#61 0xb782d8c9 in ProcessEvent (event=..., this=0x918d280) at
../src/common/event.cpp:1308
#62 wxEvtHandler::ProcessEvent (this=0x918d280, event=...) at
../src/common/event.cpp:1272
#63 0xb7b6b709 in wxScrollHelperEvtHandler::ProcessEvent
(this=0x918d280, event=...) at ../src/generic/scrlwing.cpp:208
#64 0xb7b8025c in wxGenericTreeCtrl::OnMouse (this=0x918f600,
event=...) at ../src/generic/treectlg.cpp:3426
---Type <return> to continue, or q <return> to quit---
#65 0xb7781a98 in wxAppConsole::HandleEvent (this=0x896c570,
handler=0x918f600, func=   (void (wxEvtHandler::*)(wxEvtHandler * const, wxEvent &))
0xb7b7f660 <wxGenericTreeCtrl::OnMouse(wxMouseEvent&)>, event=...)   at ../src/common/appbase.cpp:322
#66 0xb782d33a in wxEvtHandler::ProcessEventIfMatches (entry=...,
handler=0x918f600, event=...) at ../src/common/event.cpp:1239
#67 0xb782d4aa in wxEventHashTable::HandleEvent (this=0x88b4640,
event=..., self=0x918f600) at ../src/common/event.cpp:906
#68 0xb782d939 in ProcessEvent (event=..., this=0x918f600) at
../src/common/event.cpp:1301
#69 wxEvtHandler::ProcessEvent (this=0x918f600, event=...) at
../src/common/event.cpp:1272
#70 0xb782d8c9 in ProcessEvent (event=..., this=0x918d280) at
../src/common/event.cpp:1308
#71 wxEvtHandler::ProcessEvent (this=0x918d280, event=...) at
../src/common/event.cpp:1272
#72 0xb7b6b709 in wxScrollHelperEvtHandler::ProcessEvent
(this=0x918d280, event=...) at ../src/generic/scrlwing.cpp:208
#73 0xb7a3364a in wxWindow::GTKProcessEvent (this=0x918f600,
event=...) at ../src/gtk/window.cpp:1433
#74 0xb7a3c43d in gtk_window_button_press_callback (widget=0x8aa9328,
gdk_event=0x9220940, win=0x918f600) at ../src/gtk/window.cpp:1632
#75 0xb6f8fc52 in ?? () from /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#76 0xb6d66c3c in g_closure_invoke () from
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#77 0xb6d799f0 in ?? () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#78 0xb6d82599 in g_signal_emit_valist () from
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#79 0xb6d828f3 in g_signal_emit () from
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#80 0xb70c9553 in ?? () from /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#81 0xb6f8deae in gtk_propagate_event () from
/usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#82 0xb6f8e240 in gtk_main_do_event () from
/usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#83 0xb6e00888 in ?? () from /usr/lib/i386-linux-gnu/libgdk-x11-2.0.so.0
#84 0xb6c8425f in g_main_context_dispatch () from
/lib/i386-linux-gnu/libglib-2.0.so.0
#85 0xb6c84990 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#86 0xb6c84f9b in g_main_loop_run () from /lib/i386-linux-gnu/libglib-2.0.so.0
#87 0xb6f8cfcf in gtk_main () from /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#88 0xb7a23e1a in wxEventLoop::Run (this=0x89dca78) at ../src/gtk/evtloop.cpp:76
#89 0xb7ab515f in wxAppBase::MainLoop (this=0x896c570) at
../src/common/appcmn.cpp:312
#90 0xb7ab472f in wxAppBase::OnRun (this=0x896c570) at
../src/common/appcmn.cpp:367
#91 0xb77c46d6 in wxEntry (argc=@0xb78b16d0, argv=0x896b8c8) at
../src/common/init.cpp:448
#92 0xb77c4776 in wxEntry (argc=@0xbffff1f0, argv=0xbffff284) at
../src/common/init.cpp:460
#93 0x0807ae6c in main (argc=1, argv=0xbffff284) at
../../pgadmin3/pgadmin/pgAdmin3.cpp:118
(gdb) quit
A debugging session is active.
       Inferior 1 [process 27225] will be killed.

Quit anyway? (y or n) y
root@vlD-kuci:/tmp#


Best regards
Vladimir Kokovic, Belgrade, Serbia


Re: Drop schema/Create new schema SIGSEGV - pgadmin3 git version

From
Guillaume Lelarge
Date:
On Thu, 2012-01-12 at 18:29 +0100, Vladimir Kokovic wrote:
> Hi,
> 
> If I try to drop or create new schema 'Program received signal
> SIGSEGV, Segmentation fault' happened.
> 
> Problem is in the line 51 of pgadmin3/pgadmin/ctl/ctlDefaultSecurityPanel.cpp.
> 
> Should be: if (conn && conn->BackendMinimumVersion(9, 2))
> 

Nope. This will simply not display the tab, and we don't want that.
There is a bug to fix, but that's not the good way to fix it: we want to
keep the tab. So, we need to understand why conn isn't available at this
time.

But thanks for your report.


-- 
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com
PostgreSQL Sessions #3: http://www.postgresql-sessions.org



Re: Drop schema/Create new schema SIGSEGV - pgadmin3 git version

From
Guillaume Lelarge
Date:
On Thu, 2012-01-12 at 23:35 +0100, Guillaume Lelarge wrote:
> On Thu, 2012-01-12 at 18:29 +0100, Vladimir Kokovic wrote:
> > Hi,
> > 
> > If I try to drop or create new schema 'Program received signal
> > SIGSEGV, Segmentation fault' happened.
> > 
> > Problem is in the line 51 of pgadmin3/pgadmin/ctl/ctlDefaultSecurityPanel.cpp.
> > 
> > Should be: if (conn && conn->BackendMinimumVersion(9, 2))
> > 
> 
> Nope. This will simply not display the tab, and we don't want that.
> There is a bug to fix, but that's not the good way to fix it: we want to
> keep the tab. So, we need to understand why conn isn't available at this
> time.
> 
> But thanks for your report.
> 

Fixed. We handle this the same way than with dlgDatabase. IOW, we don't
display the tab if we don't have the node. Kind of like you did but in
another way.

It would need a major refactor to do otherwise.


-- 
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com
PostgreSQL Sessions #3: http://www.postgresql-sessions.org