Re: [pgAdmin4][Patch]: RM #3277 Runtime startup error handling is broken on Windows.

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Akshay Joshi <akshay(dot)joshi(at)enterprisedb(dot)com>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: [pgAdmin4][Patch]: RM #3277 Runtime startup error handling is broken on Windows.
Date: 2018-05-10 14:08:00
Message-ID: CA+OCxozgxKo5sO=2cwRubEh1H1z0C+qtZD-X62kF2SiLs32b5g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi

On Thu, May 10, 2018 at 2:00 PM, Akshay Joshi <akshay(dot)joshi(at)enterprisedb(dot)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.

Starting /Users/dpage/git/pgadmin4/build-pgAdmin4-Desktop_Qt_5_
10_1_clang_64bit-Debug/pgAdmin4.app/Contents/MacOS/pgAdmin4...
Python path: "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
packages:/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7"
Python Home: ""
Fatal Python error: Py_Initialize: unable to load the file system codec
File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/encodings/__init__.py",
line 123
raise CodecRegistryError,\
^
SyntaxError: invalid syntax

Current thread 0x00007fffcbb433c0 (most recent call first):
The program has unexpectedly finished.
/Users/dpage/git/pgadmin4/build-pgAdmin4-Desktop_Qt_5_
10_1_clang_64bit-Debug/pgAdmin4.app/Contents/MacOS/pgAdmin4 crashed.

Starting /Users/dpage/git/pgadmin4/build-pgAdmin4-Desktop_Qt_5_
10_1_clang_64bit-Debug/pgAdmin4.app/Contents/MacOS/pgAdmin4...
Python path: "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
packages:/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7"
Python Home: ""
Fatal Python error: Py_Initialize: unable to load the file system codec
File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/encodings/__init__.py",
line 123
raise CodecRegistryError,\
^
SyntaxError: invalid syntax

Current thread 0x00007fffcbb433c0 (most recent call first):
The program has unexpectedly finished.
/Users/dpage/git/pgadmin4/build-pgAdmin4-Desktop_Qt_5_
10_1_clang_64bit-Debug/pgAdmin4.app/Contents/MacOS/pgAdmin4 crashed.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Anthony Emengo 2018-05-10 14:38:31 Re: [pgadmin4][patch] Initial patch to decouple from ACI Tree
Previous Message Akshay Joshi 2018-05-10 13:00:25 [pgAdmin4][Patch]: RM #3277 Runtime startup error handling is broken on Windows.