Re: [pgAdmin4][Patch]: RM #3277 Runtime startup error handling isbroken on Windows. - Mailing list pgadmin-hackers
From | Dave Page |
---|---|
Subject | Re: [pgAdmin4][Patch]: RM #3277 Runtime startup error handling isbroken on Windows. |
Date | |
Msg-id | CA+OCxoxoAya7A1ALj5DrYraDXapVgrzW9pn_zgYQ95kA7UHJUw@mail.gmail.com Whole thread Raw |
In response to | Re: [pgAdmin4][Patch]: RM #3277 Runtime startup error handling isbroken on Windows. (Akshay Joshi <akshay.joshi@enterprisedb.com>) |
List | pgadmin-hackers |
Hi
On Fri, May 11, 2018 at 7:23 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
-- HiOn Thu, May 10, 2018 at 7:38 PM, Dave Page <dpage@pgadmin.org> wrote:HiOn Thu, May 10, 2018 at 2:00 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote: Hi Hackers,Please find the attached patch to fix RM #3277 Runtime startup error handling is broken on Windows.This issue is regression of RM #3177 "Sporadically crashes on Windows when exit". Where below code of pgAdmin4.cpp creates the problem:QObject::connect(server, SIGNAL(finished()), server, SLOT(deleteLater()));In case when PythonPath is not provided then application server not started and server thread finished there execution, due to the above line of code Destructor of Server class has been called and we are accessing the function server->getError().length() at line no 251 of pgAdmin4.cpp, which cause the application crash.I have removed that line and tested RM #3177 and RM# 3277, both are working fine.Please review and test it.So my first test was compiled against Python 3, but my config was still pointing at a Python 2 venv. I got the error below in the console of QtCreator.Also, wouldn't it make more sense to move the connect that you removed so it only happens once the server is up and running? That way we will still ensure it gets properly deleted when appropriate, but not prematurely if an error occurs during startup.Agreed, I have move that call to other place when server is up and running. Attached is the modified patch.
Thanks, applied.
Starting /Users/dpage/git/pgadmin4/build-pgAdmin4-Desktop_Qt_5_10_1_c lang_64bit-Debug/pgAdmin4.app/ Contents/MacOS/pgAdmin4... Python path: "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa ges:/Users/dpage/.virtualenvs/ pgadmin4/lib/python2.7" Python Home: ""Fatal Python error: Py_Initialize: unable to load the file system codecFile "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/encodings/ __init__.py", line 123 raise CodecRegistryError,\^SyntaxError: invalid syntaxCurrent thread 0x00007fffcbb433c0 (most recent call first):The program has unexpectedly finished./Users/dpage/git/pgadmin4/build-pgAdmin4-Desktop_Qt_5_10_1_c lang_64bit-Debug/pgAdmin4.app/ Contents/MacOS/pgAdmin4 crashed. Starting /Users/dpage/git/pgadmin4/build-pgAdmin4-Desktop_Qt_5_10_1_c lang_64bit-Debug/pgAdmin4.app/ Contents/MacOS/pgAdmin4... Python path: "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa ges:/Users/dpage/.virtualenvs/ pgadmin4/lib/python2.7" Python Home: ""Fatal Python error: Py_Initialize: unable to load the file system codecFile "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/encodings/ __init__.py", line 123 raise CodecRegistryError,\^SyntaxError: invalid syntaxCurrent thread 0x00007fffcbb433c0 (most recent call first):The program has unexpectedly finished./Users/dpage/git/pgadmin4/build-pgAdmin4-Desktop_Qt_5_10_1_c lang_64bit-Debug/pgAdmin4.app/ Contents/MacOS/pgAdmin4 crashed. Yes, it is reproducible. I have tried putting try catch around "Py_Initialize", but no success.
Hmm, yeah - seems this is the problem:
Which is.. unfortunate.
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
pgadmin-hackers by date: