Failure to serialize long numbers
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Meliae |
New
|
Undecided
|
Unassigned |
Bug Description
When trying to find memory leak in my Django application, meliae fails immediately with the following traceback:
ERROR: django.request: Internal Server Error: /play/dump/
Traceback (most recent call last):
File "/usr/local/
response = get_response(
File "/usr/local/
response = self._get_
File "/usr/local/
response = self.process_
File "/usr/local/
response = wrapped_
File "/usr/local/
return self.dispatch(
File "/usr/local/
return handler(request, *args, **kwargs)
File "/opt/project/
meliae.
File "/usr/local/
dump_
File "/usr/local/
for ref in get_referents(
OverflowError: Python int too large to convert to C long
After compiling python with debug information and stepping through the code in gdb, I found out that this happens because meliae attempts to serialize Python long integers as C long. But Python long has an unlimited range and cannot be cast to C long.
I'm attaching a small patch that attempts to serialize Python long as C long long and returning -1 in case if Python long is too large for C long.
I was able to generate dump successfully after building meliae with this change.
Can you add a test case for this? It should be pretty straight forward to
add a test of dumping a long that is bigger than 32bits and probably also
one for bigger than 64 bits. I'm not really sure how to represent numbers
that are >> 64 bits but having a stable answer at least would be good.
On Sun, May 17, 2020 at 2:35 AM Eugene Morozov <email address hidden>
wrote:
> ** Patch added: "meliae.patch" /bugs.launchpad .net/meliae/ +bug/1879100/ +attachment/ 5372759/ +files/ meliae. patch /bugs.launchpad .net/bugs/ 1879100 /bugs.launchpad .net/meliae/ +bug/1879100/ +subscriptions
>
> https:/
>
> --
> You received this bug notification because you are a member of Meliae
> Development Team, which is subscribed to Meliae.
> https:/
>
> Title:
> Failure to serialize long numbers
>
> To manage notifications about this bug go to:
> https:/
>