question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Segmentation fault - double free or corruption (!prev)

See original GitHub issue

So my test script simply does ep.write(b'\x88' * 1) inside a while True loop (iso transfer).

Crash usually occurs at exit, but the program may crash at its own will. Most of the time it’s SIGSEGV or SIGBUS, and no stack trace is printed.

Traceback (most recent call last):
  File "./debug_client.py", line 34, in <module>
    main()
  File "./debug_client.py", line 30, in main
    ep.write(b'\x88' * 1)
  File "/usr/lib64/python3.4/site-packages/usb/core.py", line 387, in write
    return self.device.write(self, data, timeout)
  File "/usr/lib64/python3.4/site-packages/usb/core.py", line 948, in write
    self.__get_timeout(timeout)
  File "/usr/lib64/python3.4/site-packages/usb/backend/libusb1.py", line 856, in iso_write
    return handler.submit(self.ctx)
  File "/usr/lib64/python3.4/site-packages/usb/backend/libusb1.py", line 674, in submit
    _check(_lib.libusb_handle_events(ctx))
KeyboardInterrupt
*** Error in `python3': double free or corruption (!prev): 0x0000000000ff8900 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x72443)[0x7f5e79243443]
/lib64/libc.so.6(+0x77d36)[0x7f5e79248d36]
/lib64/libc.so.6(+0x7853e)[0x7f5e7924953e]
/usr/lib64/libpython3.4.so.1.0(+0x99740)[0x7f5e79822740]
/usr/lib64/python3.4/lib-dynload/_ctypes.cpython-34.so(+0x7417)[0x7f5e77e42417]
/usr/lib64/python3.4/lib-dynload/_ctypes.cpython-34.so(+0x7429)[0x7f5e77e42429]
/usr/lib64/libpython3.4.so.1.0(+0xb20ff)[0x7f5e7983b0ff]
/usr/lib64/libpython3.4.so.1.0(+0x99717)[0x7f5e79822717]
/usr/lib64/libpython3.4.so.1.0(+0xb1b92)[0x7f5e7983ab92]
/usr/lib64/libpython3.4.so.1.0(+0x14a142)[0x7f5e798d3142]
/usr/lib64/libpython3.4.so.1.0(+0x14a89b)[0x7f5e798d389b]
/usr/lib64/libpython3.4.so.1.0(PyGC_Collect+0x28)[0x7f5e798d3d18]
/usr/lib64/libpython3.4.so.1.0(Py_Finalize+0x5f)[0x7f5e798bb1df]
/usr/lib64/libpython3.4.so.1.0(Py_Main+0x694)[0x7f5e798d1cf4]
python3(main+0x166)[0x400b06]
/lib64/libc.so.6(__libc_start_main+0xf0)[0x7f5e791f1630]
python3(_start+0x29)[0x400ba9]
======= Memory map: ========
00400000-00401000 r-xp 00000000 08:02 1998574                            /usr/bin/python3.4
00601000-00602000 r--p 00001000 08:02 1998574                            /usr/bin/python3.4
00602000-00603000 rw-p 00002000 08:02 1998574                            /usr/bin/python3.4
00d7d000-0101a000 rw-p 00000000 00:00 0                                  [heap]
7f5e70000000-7f5e70021000 rw-p 00000000 00:00 0 
7f5e70021000-7f5e74000000 ---p 00000000 00:00 0 
7f5e75854000-7f5e75869000 r-xp 00000000 08:02 13780942                   /usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.3/libgcc_s.so.1
7f5e75869000-7f5e75a69000 ---p 00015000 08:02 13780942                   /usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.3/libgcc_s.so.1
7f5e75a69000-7f5e75a6a000 r--p 00015000 08:02 13780942                   /usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.3/libgcc_s.so.1
7f5e75a6a000-7f5e75a6b000 rw-p 00016000 08:02 13780942                   /usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.3/libgcc_s.so.1
7f5e75a6b000-7f5e75a6c000 ---p 00000000 00:00 0 
7f5e75a6c000-7f5e7626c000 rw-p 00000000 00:00 0 
7f5e7626c000-7f5e76282000 r-xp 00000000 08:02 13279367                   /lib64/libusb-1.0.so.0.1.0
7f5e76282000-7f5e76482000 ---p 00016000 08:02 13279367                   /lib64/libusb-1.0.so.0.1.0
7f5e76482000-7f5e76483000 r--p 00016000 08:02 13279367                   /lib64/libusb-1.0.so.0.1.0
7f5e76483000-7f5e76484000 rw-p 00017000 08:02 13279367                   /lib64/libusb-1.0.so.0.1.0
7f5e764d1000-7f5e764d3000 r-xp 00000000 08:02 1992911                    /usr/lib64/python3.4/lib-dynload/_random.cpython-34.so
7f5e764d3000-7f5e766d3000 ---p 00002000 08:02 1992911                    /usr/lib64/python3.4/lib-dynload/_random.cpython-34.so
7f5e766d3000-7f5e766d4000 r--p 00002000 08:02 1992911                    /usr/lib64/python3.4/lib-dynload/_random.cpython-34.so
7f5e766d4000-7f5e766d5000 rw-p 00003000 08:02 1992911                    /usr/lib64/python3.4/lib-dynload/_random.cpython-34.so
7f5e766d5000-7f5e766ea000 r-xp 00000000 08:02 3146151                    /lib64/libz.so.1.2.8
7f5e766ea000-7f5e768e9000 ---p 00015000 08:02 3146151                    /lib64/libz.so.1.2.8
7f5e768e9000-7f5e768ea000 r--p 00014000 08:02 3146151                    /lib64/libz.so.1.2.8
7f5e768ea000-7f5e768eb000 rw-p 00015000 08:02 3146151                    /lib64/libz.so.1.2.8
7f5e768eb000-7f5e76afe000 r-xp 00000000 08:02 14177224                   /usr/lib64/libcrypto.so.1.0.0
7f5e76afe000-7f5e76cfd000 ---p 00213000 08:02 14177224                   /usr/lib64/libcrypto.so.1.0.0
7f5e76cfd000-7f5e76d1b000 r--p 00212000 08:02 14177224                   /usr/lib64/libcrypto.so.1.0.0
7f5e76d1b000-7f5e76d27000 rw-p 00230000 08:02 14177224                   /usr/lib64/libcrypto.so.1.0.0
7f5e76d27000-7f5e76d2b000 rw-p 00000000 00:00 0 
7f5e76d38000-7f5e76d78000 rw-p 00000000 00:00 0 
7f5e76d78000-7f5e76d7d000 r-xp 00000000 08:02 1992966                    /usr/lib64/python3.4/lib-dynload/_hashlib.cpython-34.so
7f5e76d7d000-7f5e76f7c000 ---p 00005000 08:02 1992966                    /usr/lib64/python3.4/lib-dynload/_hashlib.cpython-34.so
7f5e76f7c000-7f5e76f7d000 r--p 00004000 08:02 1992966                    /usr/lib64/python3.4/lib-dynload/_hashlib.cpython-34.so
7f5e76f7d000-7f5e76f7e000 rw-p 00005000 08:02 1992966                    /usr/lib64/python3.4/lib-dynload/_hashlib.cpython-34.so
7f5e76f7e000-7f5e76f81000 r-xp 00000000 08:02 1992906                    /usr/lib64/python3.4/lib-dynload/_bz2.cpython-34.so
7f5e76f81000-7f5e77180000 ---p 00003000 08:02 1992906                    /usr/lib64/python3.4/lib-dynload/_bz2.cpython-34.so
7f5e77180000-7f5e77181000 r--p 00002000 08:02 1992906                    /usr/lib64/python3.4/lib-dynload/_bz2.cpython-34.so
7f5e77181000-7f5e77182000 rw-p 00003000 08:02 1992906                    /usr/lib64/python3.4/lib-dynload/_bz2.cpython-34.so
7f5e77182000-7f5e77184000 r-xp 00000000 08:02 1998575                    /usr/lib64/python3.4/lib-dynload/grp.cpython-34.so
7f5e77184000-7f5e77383000 ---p 00002000 08:02 1998575                    /usr/lib64/python3.4/lib-dynload/grp.cpython-34.so
7f5e77383000-7f5e77384000 r--p 00001000 08:02 1998575                    /usr/lib64/python3.4/lib-dynload/grp.cpython-34.so
7f5e77384000-7f5e77385000 rw-p 00002000 08:02 1998575                    /usr/lib64/python3.4/lib-dynload/grp.cpython-34.so
7f5e77385000-7f5e773c5000 rw-p 00000000 00:00 0 
7f5e773c5000-7f5e773ca000 r-xp 00000000 08:02 1992917                    /usr/lib64/python3.4/lib-dynload/select.cpython-34.so
7f5e773ca000-7f5e775c9000 ---p 00005000 08:02 1992917                    /usr/lib64/python3.4/lib-dynload/select.cpython-34.so
7f5e775c9000-7f5e775ca000 r--p 00004000 08:02 1992917                    /usr/lib64/python3.4/lib-dynload/select.cpython-34.so
7f5e775ca000-7f5e775cc000 rw-p 00005000 08:02 1992917                    /usr/lib64/python3.4/lib-dynload/select.cpython-34.so
7f5e775cc000-7f5e775cf000 r-xp 00000000 08:02 1992950                    /usr/lib64/python3.4/lib-dynload/_posixsubprocess.cpython-34.so
7f5e775cf000-7f5e777ce000 ---p 00003000 08:02 1992950                    /usr/lib64/python3.4/lib-dynload/_posixsubprocess.cpython-34.so
7f5e777ce000-7f5e777cf000 r--p 00002000 08:02 1992950                    /usr/lib64/python3.4/lib-dynload/_posixsubprocess.cpython-34.so
7f5e777cf000-7f5e777d0000 rw-p 00003000 08:02 1992950                    /usr/lib64/python3.4/lib-dynload/_posixsubprocess.cpython-34.so
7f5e777d0000-7f5e777d8000 r-xp 00000000 08:02 1992914                    /usr/lib64/python3.4/lib-dynload/math.cpython-34.so
7f5e777d8000-7f5e779d7000 ---p 00008000 08:02 1992914                    /usr/lib64/python3.4/lib-dynload/math.cpython-34.so
7f5e779d7000-7f5e779d8000 r--p 00007000 08:02 1992914                    /usr/lib64/python3.4/lib-dynload/math.cpython-34.so
7f5e779d8000-7f5e779da000 rw-p 00008000 08:02 1992914                    /usr/lib64/python3.4/lib-dynload/math.cpython-34.so
7f5e779da000-7f5e779e1000 r-xp 00000000 08:02 1992943                    /usr/lib64/python3.4/lib-dynload/_struct.cpython-34.so
7f5e779e1000-7f5e77be1000 ---p 00007000 08:02 1992943                    /usr/lib64/python3.4/lib-dynload/_struct.cpython-34.so
7f5e77be1000-7f5e77be2000 r--p 00007000 08:02 1992943                    /usr/lib64/python3.4/lib-dynload/_struct.cpython-34.so
7f5e77be2000-7f5e77be5000 rw-p 00008000 08:02 1992943                    /usr/lib64/python3.4/lib-dynload/_struct.cpython-34.so
7f5e77be5000-7f5e77bec000 r-xp 00000000 08:02 12467146                   /usr/lib64/libffi.so.6.0.4
7f5e77bec000-7f5e77dec000 ---p 00007000 08:02 12467146                   /usr/lib64/libffi.so.6.0.4
7f5e77dec000-7f5e77ded000 r--p 00007000 08:02 12467146                   /usr/lib64/libffi.so.6.0.4
7f5e77ded000-7f5e77dee000 rw-p 00008000 08:02 12467146                   /usr/lib64/libffi.so.6.0.4
7f5e77dfb000-7f5e77e3b000 rw-p 00000000 00:00 0 
7f5e77e3b000-7f5e77e54000 r-xp 00000000 08:02 1992939                    /usr/lib64/python3.4/lib-dynload/_ctypes.cpython-34.so
7f5e77e54000-7f5e78053000 ---p 00019000 08:02 1992939                    /usr/lib64/python3.4/lib-dynload/_ctypes.cpython-34.so
7f5e78053000-7f5e78054000 r--p 00018000 08:02 1992939                    /usr/lib64/python3.4/lib-dynload/_ctypes.cpython-34.so
7f5e78054000-7f5e78059000 rw-p 00019000 08:02 1992939                    /usr/lib64/python3.4/lib-dynload/_ctypes.cpython-34.so
7f5e78059000-7f5e7813a000 rw-p 00000000 00:00 0 
7f5e7813a000-7f5e78144000 r-xp 00000000 08:02 1992913                    /usr/lib64/python3.4/lib-dynload/array.cpython-34.so
7f5e78144000-7f5e78343000 ---p 0000a000 08:02 1992913                    /usr/lib64/python3.4/lib-dynload/array.cpython-34.so
7f5e78343000-7f5e78344000 r--p 00009000 08:02 1992913                    /usr/lib64/python3.4/lib-dynload/array.cpython-34.so
7f5e78344000-7f5e78347000 rw-p 0000a000 08:02 1992913                    /usr/lib64/python3.4/lib-dynload/array.cpython-34.so
7f5e78347000-7f5e78387000 rw-p 00000000 00:00 0 
7f5e78387000-7f5e7838a000 r-xp 00000000 08:02 1992956                    /usr/lib64/python3.4/lib-dynload/_heapq.cpython-34.so
7f5e7838a000-7f5e78589000 ---p 00003000 08:02 1992956                    /usr/lib64/python3.4/lib-dynload/_heapq.cpython-34.so
7f5e78589000-7f5e7858a000 r--p 00002000 08:02 1992956                    /usr/lib64/python3.4/lib-dynload/_heapq.cpython-34.so
7f5e7858a000-7f5e7858c000 rw-p 00003000 08:02 1992956                    /usr/lib64/python3.4/lib-dynload/_heapq.cpython-34.so
7f5e7858c000-7f5e7860c000 rw-p 00000000 00:00 0 
7f5e7860c000-7f5e78611000 r-xp 00000000 08:02 1992912                    /usr/lib64/python3.4/lib-dynload/time.cpython-34.so
7f5e78611000-7f5e78810000 ---p 00005000 08:02 1992912                    /usr/lib64/python3.4/lib-dynload/time.cpython-34.so
7f5e78810000-7f5e78811000 r--p 00004000 08:02 1992912                    /usr/lib64/python3.4/lib-dynload/time.cpython-34.so
7f5e78811000-7f5e78814000 rw-p 00005000 08:02 1992912                    /usr/lib64/python3.4/lib-dynload/time.cpython-34.so
7f5e78814000-7f5e78ad4000 r--p 00000000 08:02 12848948                   /usr/lib64/locale/locale-archive
7f5e78ad4000-7f5e78bc8000 r-xp 00000000 08:02 13332192                   /lib64/libm-2.22.so
7f5e78bc8000-7f5e78dc8000 ---p 000f4000 08:02 13332192                   /lib64/libm-2.22.so
7f5e78dc8000-7f5e78dc9000 r--p 000f4000 08:02 13332192                   /lib64/libm-2.22.so
7f5e78dc9000-7f5e78dca000 rw-p 000f5000 08:02 13332192                   /lib64/libm-2.22.so
7f5e78dca000-7f5e78dcc000 r-xp 00000000 08:02 13332359                   /lib64/libutil-2.22.so
7f5e78dcc000-7f5e78fcb000 ---p 00002000 08:02 13332359                   /lib64/libutil-2.22.so
7f5e78fcb000-7f5e78fcc000 r--p 00001000 08:02 13332359                   /lib64/libutil-2.22.so
7f5e78fcc000-7f5e78fcd000 rw-p 00002000 08:02 13332359                   /lib64/libutil-2.22.so
7f5e78fcd000-7f5e78fcf000 r-xp 00000000 08:02 13335254                   /lib64/libdl-2.22.so
7f5e78fcf000-7f5e791cf000 ---p 00002000 08:02 13335254                   /lib64/libdl-2.22.so
7f5e791cf000-7f5e791d0000 r--p 00002000 08:02 13335254                   /lib64/libdl-2.22.so
7f5e791d0000-7f5e791d1000 rw-p 00003000 08:02 13335254                   /lib64/libdl-2.22.so
7f5e791d1000-7f5e79364000 r-xp 00000000 08:02 13334161                   /lib64/libc-2.22.so
7f5e79364000-7f5e79563000 ---p 00193000 08:02 13334161                   /lib64/libc-2.22.so
7f5e79563000-7f5e79567000 r--p 00192000 08:02 13334161                   /lib64/libc-2.22.so
7f5e79567000-7f5e79569000 rw-p 00196000 08:02 13334161                   /lib64/libc-2.22.so
7f5e79569000-7f5e7956d000 rw-p 00000000 00:00 0 
7f5e7956d000-7f5e79584000 r-xp 00000000 08:02 13332308                   /lib64/libpthread-2.22.so
7f5e79584000-7f5e79783000 ---p 00017000 08:02 13332308                   /lib64/libpthread-2.22.so
7f5e79783000-7f5e79784000 r--p 00016000 08:02 13332308                   /lib64/libpthread-2.22.so
7f5e79784000-7f5e79785000 rw-p 00017000 08:02 13332308                   /lib64/libpthread-2.22.so
7f5e79785000-7f5e79789000 rw-p 00000000 00:00 0 
7f5e79789000-7f5e7999a000 r-xp 00000000 08:02 1992809                    /usr/lib64/libpython3.4.so.1.0
7f5e7999a000-7f5e79b9a000 ---p 00211000 08:02 1992809                    /usr/lib64/libpython3.4.so.1.0
7f5e79b9a000-7f5e79b9c000 r--p 00211000 08:02 1992809                    /usr/lib64/libpython3.4.so.1.0
7f5e79b9c000-7f5e79bfe000 rw-p 00213000 08:02 1992809                    /usr/lib64/libpython3.4.so.1.0
7f5e79bfe000-7f5e79c19000 rw-p 00000000 00:00 0 
7f5e79c19000-7f5e79c3b000 r-xp 00000000 08:02 13334431                   /lib64/ld-2.22.so
7f5e79c76000-7f5e79cb6000 rw-p 00000000 00:00 0 
7f5e79cd6000-7f5e79ce5000 r-xp 00000000 08:02 13509247                   /lib64/libbz2.so.1.0.6
7f5e79ce5000-7f5e79ce7000 rw-p 0000e000 08:02 13509247                   /lib64/libbz2.so.1.0.6
7f5e79ce7000-7f5e79dec000 rw-p 00000000 00:00 0 
7f5e79def000-7f5e79df0000 rw-p 00000000 00:00 0 
7f5e79df0000-7f5e79df2000 rwxp 00000000 00:00 0 
7f5e79df2000-7f5e79e32000 rw-p 00000000 00:00 0 
7f5e79e32000-7f5e79e39000 r--s 00000000 08:02 12583044                   /usr/lib64/gconv/gconv-modules.cache
7f5e79e39000-7f5e79e3a000 rw-p 00000000 00:00 0 
7f5e79e3a000-7f5e79e3b000 r--p 00021000 08:02 13334431                   /lib64/ld-2.22.so
7f5e79e3b000-7f5e79e3c000 rw-p 00022000 08:02 13334431                   /lib64/ld-2.22.so
7f5e79e3c000-7f5e79e3d000 rw-p 00000000 00:00 0 
7ffdec467000-7ffdec488000 rw-p 00000000 00:00 0                          [stack]
7ffdec5b6000-7ffdec5b8000 r--p 00000000 00:00 0                          [vvar]
7ffdec5b8000-7ffdec5ba000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:14 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
mcueecommented, Aug 3, 2021

My own testing results in #380 actually show that pyusb isoc codes seem to work well, provides that the FW is working, and provided it is not under Windows since libusb-1.0 Windows does not seem to work well with isoc transfer.

1reaction
jonasmalacofilhocommented, Jul 30, 2021

Unless I’m missing something, I agree that

the pyusb issue is about completely different problem, though.

By this I mean: it’s not the segfault this issue was originally about.

So a new issue would be more appropriate… or maybe don’t need to track it at all?

In general, every upstream issue has a high probably of affecting us anyway. And unless the problem specifically affects PyUSB (e.g. requires a fix or workaround in PyUSB) or PyUSB users (e.g. not generally hit by other users), I don’t think we need to track it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

double free or corruption (!prev) Segmentation fault (core ...
When I try to use the find_region function, I get the following error trace. double free or corruption (!prev) Aborted (core dumped) ...
Read more >
Numba: double free or corruption (!prev) Aborted (core dumped)
I'm getting double free or corruption (!prev)Segmentation fault (core dumped) for all runs. My numba version is 0.48.0 . – papabiceps.
Read more >
Error: Double Free or Corruption - Linux Hint
The error of double free or corruption in C++ means that our program somehow invokes the free() C++ object with an illegal pointer...
Read more >
double free or corruption (!prev) / Segmentation violation
I use virtual terminal (gnu's screen) to run my process in MATLAB in our server but I faces with a problem newly. Matlab...
Read more >
double free or corruption (!prev) Segmentation fault (core ...
Code to reproduce the error. import numpy as np from numba import jit, prange import itertools def generate_curr(size): curr ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found