python-zk / kazoo

Kazoo is a high-level Python library that makes it easier to use Apache Zookeeper.
https://kazoo.readthedocs.io
Apache License 2.0
1.3k stars 387 forks source link

Segfault on connection #454

Open fpietka opened 7 years ago

fpietka commented 7 years ago

I'm using kazoo 2.4.0 on Python 3.6.

I first had this issue while running, after a few days. Now I have it quickly after relaunch.

Here is the stack I have on segfault:

Fatal Python error: Segmentation fault

Thread 0x00007f4fc2911700 (most recent call first):
  File "/home/fpietka/.pyenv/versions/my_prg/lib/python3.6/site-packages/kazoo/handlers/threading.py", line 147 in select
  File "/home/fpietka/.pyenv/versions/my_prg/lib/python3.6/site-packages/kazoo/protocol/connection.py", line 529 in _connect_attempt
  File "/home/fpietka/.pyenv/versions/my_prg/lib/python3.6/site-packages/kazoo/protocol/connection.py", line 488 in _connect_loop
  File "/home/fpietka/.pyenv/versions/my_prg/lib/python3.6/site-packages/kazoo/retry.py", line 123 in __call__
  File "/home/fpietka/.pyenv/versions/my_prg/lib/python3.6/site-packages/kazoo/protocol/connection.py", line 471 in zk_loop
  File "/home/fpietka/.pyenv/versions/3.6.1/lib/python3.6/threading.py", line 864 in run
  File "/home/fpietka/.pyenv/versions/3.6.1/lib/python3.6/threading.py", line 916 in _bootstrap_inner
  File "/home/fpietka/.pyenv/versions/3.6.1/lib/python3.6/threading.py", line 884 in _bootstrap

Current thread 0x00007f4fcc146740 (most recent call first):
Segmentation fault

I can also provide the part of the stack trace where it fails:

futex(0x7f6f20075fd8, FUTEX_WAIT_PRIVATE, 2, NULL) = -1 EAGAIN (Resource temporarily unavailable)
futex(0x7f6f20075fd8, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x1394dd0, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
futex(0x7f6f18000020, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f6f180020a8, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f6f18000020, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f6f180020a8, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f6f18000020, FUTEX_WAKE_PRIVATE, 1) = 0
munmap(0x7f6f1412d000, 65875968)        = 0
open("/proc/sys/vm/overcommit_memory", O_RDONLY|O_CLOEXEC) = 4
read(4, "0", 1)                         = 1
close(4)                                = 0
madvise(0x7f6f18023000, 36450304, MADV_DONTNEED) = 0
futex(0x1394dd0, FUTEX_WAKE_PRIVATE, 1) = 1
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
rt_sigaction(SIGSEGV, {SIG_DFL, [], SA_RESTORER, 0x7f6f3ed4c330}, NULL, 8) = 0
write(2, "Fatal Python error: ", 20Fatal Python error: )    = 20
fpietka commented 7 years ago

It happens whenever something fail in my code, so it isn't closed properly.

StephenSorriaux commented 6 years ago

Hi,

Can you please add more information to this issue?