peadar / pstack

Print stack traces from running processes, or core files. Supports aarch64, x86_64, and i386
BSD 2-Clause "Simplified" License
128 stars 30 forks source link

[Python] Negative longs are skipped #14

Closed nskobelevs closed 3 years ago

nskobelevs commented 3 years ago

When using the -a flag to show locals, negative longs aren't printed correctly

def func(a):
    sleep(1000000)

func(-1L) # L not needed for Python 3

Output:

---- interpreter @55e9fb6742a0 -----
pthread: 0x7fc8df07c740, lwp 17975
    func in test/negativeLong.py:4
        fastlocals:
            "a"=(skip massive object -1)
    <module> in test/negativeLong.py.py:6
...

Issue occurs in both versions of python but more prevalent in Python 3 as PyIntObject was removed and all numbers are longs by default.