Description of problem: configured pgadmin3 and added, but crash on start Version-Release number of selected component: pgadmin3-1.22.1-1.fc24 Additional info: reporter: libreport-2.7.0 backtrace_rating: 4 cmdline: /usr/bin/pgadmin3 crash_function: pgConn::GetStatus executable: /usr/bin/pgadmin3 global_pid: 13496 kernel: 4.5.0-302.fc24.x86_64 runlevel: N 5 type: CCpp uid: 1000 Truncated backtrace: Thread no. 1 (10 frames) #0 pgConn::GetStatus at db/pgConn.cpp:1011 #1 pluginUtilityFactory::CheckEnable at frm/plugins.cpp:383 #2 menuFactoryList::CheckMenu at utils/factory.cpp:266 #3 frmMain::setDisplay at frm/events.cpp:600 #4 frmMain::execSelChange at frm/events.cpp:512 #5 frmMain::OnExpand at frm/events.cpp:277 #6 wxEvtHandler::ProcessEventIfMatches at src/common/event.cpp:1239 #7 wxEventHashTable::HandleEvent at src/common/event.cpp:906 #8 wxEvtHandler::ProcessEvent at src/common/event.cpp:1301 #10 wxWindowBase::TryParent at src/common/wincmn.cpp:2661
Created attachment 1156018 [details] File: backtrace
Created attachment 1156019 [details] File: cgroup
Created attachment 1156020 [details] File: core_backtrace
Created attachment 1156021 [details] File: dso_list
Created attachment 1156022 [details] File: environ
Created attachment 1156023 [details] File: exploitable
Created attachment 1156024 [details] File: limits
Created attachment 1156025 [details] File: maps
Created attachment 1156026 [details] File: mountinfo
Created attachment 1156027 [details] File: namespaces
Created attachment 1156028 [details] File: open_fds
Created attachment 1156029 [details] File: proc_pid_status
Created attachment 1156030 [details] File: var_log_messages
*** Bug 1335904 has been marked as a duplicate of this bug. ***
*** Bug 1329316 has been marked as a duplicate of this bug. ***
*** Bug 1336516 has been marked as a duplicate of this bug. ***
Would you please fix this issue? this doesn't happen on freshly installed Fedora 24 alpha
Similar problem has been detected: I just tried to start PgAdmin3 the first time after upgrading to f24 reporter: libreport-2.7.1 backtrace_rating: 3 cmdline: /usr/bin/pgadmin3 crash_function: pgConn::GetStatus executable: /usr/bin/pgadmin3 global_pid: 10644 kernel: 4.5.5-300.fc24.x86_64 package: pgadmin3-1.22.1-1.fc24 pkg_fingerprint: 73BD E983 81B4 6521 pkg_vendor: Fedora Project reason: pgadmin3 killed by SIGSEGV reproducible: Not sure how to reproduce the problem runlevel: N 5 type: CCpp uid: 1000
Similar problem has been detected: 1. Install and setup postgres server 2. launch pgadmin3 3. create connection to postgres server pgadmin3 dies immediatly and then on each subsequent launch. reporter: libreport-2.7.1 backtrace_rating: 4 cmdline: /usr/bin/pgadmin3 crash_function: pgConn::GetStatus executable: /usr/bin/pgadmin3 global_pid: 27160 kernel: 4.5.7-300.fc24.x86_64 package: pgadmin3-1.22.1-1.fc24 pkg_fingerprint: 73BD E983 81B4 6521 pkg_vendor: Fedora Project reason: pgadmin3 killed by SIGSEGV reproducible: The problem is reproducible runlevel: N 5 type: CCpp uid: 1000
Similar problem has been detected: Tried to start pgadmin3 from cinnamon menu. Displays the splash then immediately dies. It worked last week - some update killed it. reporter: libreport-2.7.1 backtrace_rating: 4 cmdline: /usr/bin/pgadmin3 crash_function: pgConn::GetStatus executable: /usr/bin/pgadmin3 global_pid: 1855 kernel: 4.5.6-300.fc24.x86_64 package: pgadmin3-1.22.1-1.fc24 pkg_fingerprint: 73BD E983 81B4 6521 pkg_vendor: Fedora Project reason: pgadmin3 killed by SIGSEGV reproducible: Not sure how to reproduce the problem runlevel: N 5 type: CCpp uid: 1000
In fact, looking at pgadmin3.log, the last time it worked was Jun 15 at 10am. It broke the 16th, and the only things installed in that interval were postgresql and screenruler. Gee, I wonder which one of those could have fubared pgadmin3? I'll try uninstalling postgresql and see if pgadmin3 works again...
BINGO! Uninstall postgresql, and pgadmin3 works again! I need psql too! Can we fix this? Workaround: run psql on another box via ssh. This might be a good excuse for learning lxc...
yes.. if package postgresql-9.5.3-1.fc24.x86_64 removed , pgadmin3 can run again
This could be a bug in postgresql also. Should we add another bug?
Similar problem has been detected: pgAdmin3 crashes on start-up. The start-up box displays and then a segmentation fault. This is only an issue when pgAdmin3 is run by an un-privlaged user. root can start the program normally. reporter: libreport-2.7.1 backtrace_rating: 4 cmdline: /usr/bin/pgadmin3 crash_function: pgConn::GetStatus executable: /usr/bin/pgadmin3 global_pid: 2633 kernel: 4.5.7-300.fc24.x86_64 package: pgadmin3-1.22.1-1.fc24 pkg_fingerprint: 73BD E983 81B4 6521 pkg_vendor: Fedora Project reason: pgadmin3 killed by SIGSEGV reproducible: The problem occurs regularly runlevel: N 5 type: CCpp uid: 1000
*** Bug 1350800 has been marked as a duplicate of this bug. ***
Similar problem has been detected: Created connection, pgadmin3 crashed reporter: libreport-2.7.1 backtrace_rating: 4 cmdline: pgadmin3 crash_function: pgConn::GetStatus executable: /usr/bin/pgadmin3 global_pid: 24258 kernel: 4.5.7-300.fc24.x86_64 package: pgadmin3-1.22.1-1.fc24 pkg_fingerprint: 73BD E983 81B4 6521 pkg_vendor: Fedora Project reason: pgadmin3 killed by SIGSEGV reproducible: Not sure how to reproduce the problem runlevel: N 5 type: CCpp uid: 1000
Confirm, workaround works. Removal of postgresql-9.5.3-1.fc24.x86_64 package helps.
*** Bug 1351393 has been marked as a duplicate of this bug. ***
Looks like pgadmin3 is SIGSEGV'ing while trying to get output of `/usr/bin/pg_dump --version` command. So better temporary solution probably is to move/rename pg_dump executable instead of deleting whole postgresql package.
Confirm, renaming pg_dump works. Better workaround - let's me use psql locally.
Replacing pg_dump with a script that echoes PostgreSQL also makes pgadmin3 segfault. Replacing pg_dump with a script that echoes "foobar" make pgadmin3 work fine. So it only fails when isPgApp returns true on the path of pg_dump. So I pulled the source, and the problem is related to wxString. The line that happens to fail on f24 is this: wxLogInfo(wxT("PG pg_dump : %s"), pgBackupExecutable.c_str()); pgBackupExecutable is a wxString, and wxLogInfo is a varargs function. The wxString docs say this under "Using wxString with vararg functions": // ALL EXAMPLES HERE DO NOT WORK, DO NOT USE THEM! printf("Don't do this: %s", s); printf("Don't do that: %s", s.c_str()); printf("Nor even this: %s", s.mb_str()); wprintf("And even not always this: %s", s.wc_str()); And pgadmin3 does exactly that - all over the place! Except wxLogInfo, unlike printf, is supposed to be smart enough to detect whether you passed a wxString object, the magic object returned from wxString.c_str(), or an actual const char * or wchar_t *. I'm skeptical that that can be done portably. Let me try removing the c_str() as recommended to see if that changes anything.
That wasn't it. Actually, it seems to be a compiler change. Here is the disassembly of pgConn::GetStatus() Dump of assembler code for function pgConn::GetStatus() const: 0x0000555555759bb0 <+0>: mov %rdi,%rax => 0x0000555555759bb3 <+3>: mov (%rdi),%rdi 0x0000555555759bb6 <+6>: test %rdi,%rdi 0x0000555555759bb9 <+9>: je 0x555555759bd0 <pgConn::GetStatus() const+32> 0x0000555555759bbb <+11>: push %rbx 0x0000555555759bbc <+12>: mov %rax,%rbx 0x0000555555759bbf <+15>: callq 0x5555556b9830 0x0000555555759bc4 <+20>: mov %eax,0x1c(%rbx) 0x0000555555759bc7 <+23>: pop %rbx 0x0000555555759bc8 <+24>: retq 0x0000555555759bc9 <+25>: nopl 0x0(%rax) 0x0000555555759bd0 <+32>: mov 0x1c(%rax),%eax 0x0000555555759bd3 <+35>: retq There is no code generated for: if (!this) return PGCONN_BAD; There might need to be a way to force gcc6 to test for that. (Aren't null this pointers bad practice?)
Yep, pgConn::GetStatus is totally broken. http://www.viva64.com/en/b/0226/
Trying this patch (in lieu of fixing everyplace that calls GetConnection() - which I'll try next): diff -up ./pgadmin/schema/pgObject.cpp.nullthis ./pgadmin/schema/pgObject.cpp --- ./pgadmin/schema/pgObject.cpp.nullthis 2016-07-01 00:01:28.676137250 -0400 +++ ./pgadmin/schema/pgObject.cpp 2016-07-01 00:02:35.751920005 -0400 @@ -1105,6 +1105,7 @@ wxString pgObject::GetGrant(const wxStri } +static pgConn badConn; pgConn *pgObject::GetConnection() const { @@ -1121,7 +1122,7 @@ pgConn *pgObject::GetConnection() const if (server) return server->connection(); - return 0; + return &badConn; }
That fixes it. I don't think I have write access on the package, so I'll let the maintainer apply the patch. If anyone needs my build: http://gathman.org/linux/f24/x86_64/pgadmin3-1.22.1-1.1.fc24.x86_64.rpm http://gathman.org/linux/f24/src/pgadmin3-1.22.1-1.1.fc24.src.rpm
That fixes the immediate problem, but some other things break. Looks like someone needs to fix all the GetConnection() calls to test for null.
Created attachment 1175082 [details] patch avoid direct this == 0 comparison Got it! I created a static pgConn::GetStatus function, and then made the member function call that with this inline. This still violates the C++ standard, but it avoids the compiler optimization breaking things for the time being. http://gathman.org/linux/f24-testing/src/pgadmin3-1.22.1-1.3.fc24.src.rpm http://gathman.org/linux/f24-testing/x86_64/pgadmin3-1.22.1-1.3.fc24.x86_64.rpm http://gathman.org/linux/f24-testing/x86_64/pgadmin3-debuginfo-1.22.1-1.3.fc24.x86_64.rpm
Similar problem has been detected: when i start pgadmin reporter: libreport-2.7.1 backtrace_rating: 4 cmdline: /usr/bin/pgadmin3 crash_function: pgConn::GetStatus executable: /usr/bin/pgadmin3 global_pid: 2281 kernel: 4.6.3-300.fc24.i686 package: pgadmin3-1.22.1-1.fc24 pkg_fingerprint: 73BD E983 81B4 6521 pkg_vendor: Fedora Project reason: pgadmin3 killed by SIGSEGV reproducible: Not sure how to reproduce the problem runlevel: N 5 type: CCpp uid: 1000
Similar problem has been detected: Just opened pgadmin3, crash happens before the splash screen ends. reporter: libreport-2.7.1 backtrace_rating: 4 cmdline: /usr/bin/pgadmin3 crash_function: pgConn::GetStatus executable: /usr/bin/pgadmin3 global_pid: 6395 kernel: 4.5.7-300.fc24.x86_64 package: pgadmin3-1.22.1-1.fc24 pkg_fingerprint: 73BD E983 81B4 6521 pkg_vendor: Fedora Project reason: pgadmin3 killed by SIGSEGV reproducible: The problem is reproducible runlevel: N 5 type: CCpp uid: 1000
*** Bug 1352288 has been marked as a duplicate of this bug. ***
Similar problem has been detected. Packages: 1) GCC-6.1.1-3.fc24 2) pgadmin3-1.22.1-1.fc24 I built pgadmin3 with -O2 -fno-delete-null-pointer-checks Its work fine for me.
*** Bug 1353009 has been marked as a duplicate of this bug. ***
I'm commenting because I haven't heard a plan of action as to this will be fixed. If I'm wrong anywhere below, please feel free to correct me. It sounds like this crash is because GCC is now optimizing code it didn't used to optimize; however, this specific code shouldn't be optimized because it's poorly written. (See http://www.viva64.com/en/b/0226/) As I see it, there are 3 solutions. 1) Recompile the package with -fno-delete-null-pointer-checks. This doesn't fix any of the bad code. It just ignores the bad code by reverting to the previous behavior. 2) Adopt Stuart D Gathman's patch, which wraps the bad code around a function that acts properly. (Stuart Gathman, please correct me if I misread/misunderstood your patch.) 3) The textbook proper fix. Fix all the bad code wherever it appears. Given that PgAdmin 4 is already in beta, is it worth all the work to do number 3? Do we have an estimate when PgAdmin 4 will be available in repositories, at least rawhide for testing? Do we know how pervasive the bad code is (a dozen places, a hundred)? What are the security implications of option 1 vs option 2? There seems to be at least one prominent example of a kernel bug because people relied on a code fix rather an adding the option flag. (See http://forums.fedoraforum.org/archive/index.php/t-226657.html) Does anyone know how upstream feels about any of this?
I grepped for "(!this)" and "(this ==" , finding only two methods that compare this to null. The other method is sqlTable::Paste(), which is not as easy to wrap. There are dozens of places where pgConn::GetStatus() is called (46). I submitted my patch to pgadmin-hackers, they are busy with pgadmin4. I'm fine with #1 or #2. #3 will require far too much QA for a maintenance release.
is this similar to https://bugzilla.redhat.com/show_bug.cgi?id=1344917 ?
(In reply to Joseph D. Wagner from comment #44) > Does anyone know how upstream feels about any of this? Dave Page upstream writes: > Oh, it's a pgAdmin 3 issue? That's probably why I didn't see it. > > We don't expect to release any further updates for pgAdmin 3, as our > focus is on pgAdmin 4 now.
(In reply to Timon from comment #46) > is this similar to https://bugzilla.redhat.com/show_bug.cgi?id=1344917 ? Yes, and this bug has a range of workarounds from renaming pg_dump to recompiling the pgadmin3 SRPM with a patch, or downloading a compiled RPM (with patch). So 1344917 should be closed as a dup.
(In reply to Stuart D Gathman from comment #47) > (In reply to Joseph D. Wagner from comment #44) > > > Does anyone know how upstream feels about any of this? > > Dave Page upstream writes: > > > Oh, it's a pgAdmin 3 issue? That's probably why I didn't see it. > > > > We don't expect to release any further updates for pgAdmin 3, as our > > focus is on pgAdmin 4 now. That is a pity because I tried pgAdmin4 and IMHO is is still months away from production. BTW pgAdmin3 is released as stable in Fedora 24. If it is not and will not be then it should be taken away from the repository.
(In reply to Clodoaldo Pinto Neto from comment #49) > > BTW pgAdmin3 is released as stable in Fedora 24. If it is not and will not > be then it should be taken away from the repository. pgadmin3 is stable with any of the workarounds listed in comment #30 and comment #44. I'm not sure why the maintainer is not applying fix #1 or #2 from comment #44. I may ask for write access to the package so I can submit a new release.
*** Bug 1355900 has been marked as a duplicate of this bug. ***
*** Bug 1356135 has been marked as a duplicate of this bug. ***
> BTW pgAdmin3 is released as stable in Fedora 24. If it is not and will not be then it should be taken away from the repository. Since there's a workaround, I think we should keep it but patch. BTW, OpenSuse choose the -fno-delete-null-pointer-checks solution. See: https://build.opensuse.org/request/show/406019 I hope an update to fix this will be available soon.
*** Bug 1356570 has been marked as a duplicate of this bug. ***
Similar problem has been detected: Upgraded from F23 to F24 on a x86_64 machine. The problem only occurs when the prior .pgadmin3 file exists (and contains a [Servers] section. If I remove all the saved server blocks and from .pgadmin3 it starts fine. The smallest .pgadmin3 file I can repeat the exception with just contains: [Servers] Count=1 [Servers/1] Server=localhost When running with the 4 line file above: $ gdb pgadmin3 I get: (gdb) where #0 pgConn::GetStatus (this=0x0) at db/pgConn.cpp:1011 #1 0x00005555559b4060 in pluginUtilityFactory::CheckEnable (this=0x555556d9d6c0, obj=0x555556ec1210) at frm/plugins.cpp:383 #2 0x0000555555be26aa in menuFactoryList::CheckMenu (this=0x555556b40200, obj=obj@entry=0x555556ec1210, menubar=0x555556e1aa60, toolbar=0x555556d92ad0) at utils/factory.cpp:266 #3 0x00005555558f35df in frmMain::setDisplay (this=this@entry=0x555556d68270, data=0x555556ec1210, props=props@entry=0x0, sqlbox=sqlbox@entry= 0x0) at frm/events.cpp:600 #4 0x00005555558f38fa in frmMain::execSelChange (this=this@entry=0x555556d68270, item=..., currentNode=<optimized out>) at frm/events.cpp:512 #5 0x00005555558f3f47 in frmMain::OnExpand (this=0x555556d68270, event=...) at frm/events.cpp:277 #6 0x00007ffff604cc5c in wxEvtHandler::ProcessEventIfMatches (entry=..., handler=<optimized out>, event=...) at src/common/event.cpp:1239 #7 0x00007ffff604cd13 in wxEventHashTable::HandleEvent (this=<optimized out>, event=..., self=self@entry=0x555556d68270) at src/common/event.cpp:906 #8 0x00007ffff604d0cb in wxEvtHandler::ProcessEvent (this=0x555556d68270, event=...) at src/common/event.cpp:1301 #9 0x00007ffff604d04b in wxEvtHandler::ProcessEvent (this=0x555556d68620, event=...) at src/common/event.cpp:1308 #10 0x00007ffff69e257c in wxWindowBase::TryParent (this=<optimized out>, event=...) at src/common/wincmn.cpp:2661 #11 0x00007ffff6a361a3 in wxGenericTreeCtrl::Expand (this=0x555556e34650, itemId=...) at src/generic/treectlg.cpp:1792 #12 0x0000555555945888 in frmMain::frmMain (this=0x555556d68270, title=...) at frm/frmMain.cpp:239 #13 0x000055555570bc64 in pgAdmin3::OnInit (this=0x555556326730) at pgAdmin3.cpp:786 #14 0x00007ffff5ff43a7 in wxAppConsole::CallOnInit (this=<optimized out>) at include/wx/app.h:76 #15 wxEntry (argc=<optimized out>, argv=<optimized out>) at src/common/init.cpp:432 #16 0x00005555556bd402 in main (argc=<optimized out>, argv=<optimized out>) at pgAdmin3.cpp:126 reporter: libreport-2.7.1 backtrace_rating: 4 cmdline: /usr/bin/pgadmin3 crash_function: pgConn::GetStatus executable: /usr/bin/pgadmin3 global_pid: 6451 kernel: 4.6.3-300.fc24.x86_64 package: pgadmin3-1.22.1-1.fc24 pkg_fingerprint: 73BD E983 81B4 6521 pkg_vendor: Fedora Project reason: pgadmin3 killed by SIGSEGV reproducible: The problem occurs regularly runlevel: N 5 type: CCpp uid: 1001
Thanks Jeff Buhrt. We've already figured out the problem and how to fix it two weeks ago. We're just waiting for the maintainer (is that Devrim GÜNDÜZ?) to apply the fix, or give someone else access to do it.
*** Bug 1357270 has been marked as a duplicate of this bug. ***
HI, can this please get fixed? User devrim seems to haven't done any koji builds since months: http://koji.fedoraproject.org/koji/userinfo?userID=355 Package spec wasn't touched since months: http://pkgs.fedoraproject.org/cgit/rpms/pgadmin3.git/ so sad, so sad...
(In reply to Thomas Meyer from comment #58) > HI, > > > can this please get fixed? > > User devrim seems to haven't done any koji builds since months: > http://koji.fedoraproject.org/koji/userinfo?userID=355 > > Package spec wasn't touched since months: > http://pkgs.fedoraproject.org/cgit/rpms/pgadmin3.git/ > > so sad, so sad... I've requested commit access, and so has https://admin.fedoraproject.org/pkgdb/packager/itamarjp/ Devrim needs to approve one of us.
*** Bug 1357827 has been marked as a duplicate of this bug. ***
pgadmin3-1.22.1-2.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-b790e4139a
Devrim granted me access, and I submitted an update with the compiler flag. I checked, and we get better code with my patch, but it doesn't necessarily cover all the places where this == 0 is abused - needs more testing. Since pgadmin4 is on the way, it probably isn't worth optimizing pgadmin3.
pgadmin3-1.22.1-2.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-b790e4139a
pgadmin3-1.22.1-2.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.
*** Bug 1344917 has been marked as a duplicate of this bug. ***