-
-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
terminated by signal SIGSEGV (Address boundary error) #827
Comments
The line failing is
https://github.com/psycopg/psycopg/blob/ef8d6a307244521ed7ea528fc1c1929e43a3b68a/psycopg/psycopg/types/datetime.py#L542
What value triggers the error?
|
There is no specific value, and the same value doesn't always produce error. I run my app again and it may not fail. The behaviour is not regular. |
As you can see, the line where you have a sigsegv is just a Python
statement.
What platform are you using? Are you customize the timezone objects in any
way?
|
I'm on Ubuntu Linux. The query I am executing is simply a data_type -------------------------- timestamp with time zone (1 row) |
This issue is really strange: the line where it happens is:
```
(dt - tzoff).astimezone(self._timezone)
```
which is a normal Python statement. So this seems at most a bug in Python
to me.
The entire psycopg development happened on Ubuntu and I've never stumbled
in that error.
Also, curious thing is that you get a Python traceback at all: usually the
way cpython crashes in C is to just die and leave a core file if the OS is
configured so, not to print a Python traceback.
So, I think you have something on your computer that causes that problem,
which is a Python problem, not a psycopg one. If you want to do something
to help us looking at what happens please instrument psycopg to print to a
file the value of the variables before and after the statement in question.
If we don't have anything reproducible, or at least the value in which the
episode happens, we cannot do anything to avoid it.
|
You are right @dvarrazzo python doesn't give any traceback and just dies. Since I was not able to catch any exception at python level and my program was just dying, I added following lines to my code.
This is what is giving the error traceback. Without this It just dies. The fact that there is no python exception that I could catch hints towards something with lower level C. Also the same value sometimes gives this issue, and sometimes doesn't is hinting towards concurrency issue (or something of that sort). I'm using async connection pool. This is troubling me, please let me know if any additional information is required. I would request to consider this for fixing. |
I am likely making unhelpful noise here, but when I have seen this type of issue within apps that use "fancy" threading, I add an arbitrary and very early exercise of the offending python API, so that the c module is called before any threading stuff gets loaded. For example if you are using from zoneinfo import ZoneInfo
ZoneInfo("UTC")
import os
import sys ... etc |
Thank you Daryl, this is useful indeed.
To the OP: as far as I see, this is a Python bug, between zoneinfo and
threading, and it should be reported to python devs. I don't have a repro
of "fancy threading" to propose as repro upstream, so I will leave that to
you.
This is troubling me, please let me know if any additional information is
required. I would request to consider this for fixing.
This is no psycopg bug and will be closed as soon as I have web access to
GitHub, in a couple of days. If you want us to fix it I would request you
to consider sponsoring the work.
|
This is a segfault on a Python statement, so it is a Python bug. It's an issue I have never found in development, which happened on Ubuntu too. I can only work on it if a proper way to reproduce the issue is provided. |
Thanks @akrherz, your unhelpful noise was rather very helpful. I'm no longer getting |
I'm using psycopg3 pool. I fetch data from database using the following code.
There is no way I can catch this in python itself (or atleast I don't know any way to catch it in python itself). Have anyone faced similar thing?
Here is my verion of psycopg.
Till the time it is closed, is there any other version that is known to not have this issue?
The text was updated successfully, but these errors were encountered: