-
Notifications
You must be signed in to change notification settings - Fork 419
OverflowError: can't convert negative value to uint32_t #279
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
Labels
Comments
Good catch. This should be easy to fix. That said, once you hit the 4 billion OIDs mark, the OID generator will wrap around, and you'll start at 1 again, which may cause other issues. |
elprans
added a commit
that referenced
this issue
May 31, 2018
Currently asyncpg (incorrectly) assumes OIDs to be signed 32-bit integers, whereas in reality they are unsigned. As a result, things would crash once the OID sequence reaches 2**31. Fix this by decoding OID values as unsigned longs. Fixes: #279
elprans
added a commit
that referenced
this issue
May 31, 2018
Currently asyncpg (incorrectly) assumes OIDs to be signed 32-bit integers, whereas in reality they are unsigned. As a result, things would crash once the OID sequence reaches 2**31. Fix this by decoding OID values as unsigned longs. Fixes: #279
elprans
added a commit
that referenced
this issue
May 31, 2018
Currently asyncpg (incorrectly) assumes OIDs to be signed 32-bit integers, whereas in reality they are unsigned. As a result, things would crash once the OID sequence reaches 2**31. Fix this by decoding OID values as unsigned longs. Fixes: #279
elprans
added a commit
that referenced
this issue
May 31, 2018
Currently asyncpg (incorrectly) assumes OIDs to be signed 32-bit integers, whereas in reality they are unsigned. As a result, things would crash once the OID sequence reaches 2**31. Fix this by decoding OID values as unsigned longs. Fixes: #279
@elprans Thank you very much for the fix! Do you know roughly when this will be put in a release? |
I'm hoping to do a release over the weekend or early next week. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
PostgreSQL 9.5.2 on x86_64-pc-linux-gnu, compiled by gcc (Alpine 6.3.0) 6.3.0, 64-bit (local)
the issue with a local PostgreSQL install?: Yes, AWS RDS. Local install of PostgreSQL does not have the problem.
uvloop?: did not try
We constantly create and tear down test DBs, and I believe the problem is that OIDs constantly increase. With the type introspection query on namespace
public
and typegeometry
I get the following in the local DB:7124428 0 b
and the following in the DB that has the failure:
2573727724 0 b
You can see the second OID will overflow to negative if cast as an int. I'm not sure what the solution is, but I'm pretty sure this is the cause of the failure.
The text was updated successfully, but these errors were encountered: