MagicStack / MagicStack/uvloop

Segmentation fault

Ouverte
#538 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Langage dominant
Cython
Étoiles
11.9k
Forks
615
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

  • uvloop version:
    0.16.0
  • Python version:
    Python 3.7.10
  • Platform:
    Amazon Linux release 2 (Karoo)

It happens couple of times a day sometimes. And than does not happen for weeks:

Thread 2 "python3.7" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe71b3700 (LWP 31714)]
0x0000000000000000 in ?? ()
Missing separate debuginfos, use: debuginfo-install python3-3.7.10-1.amzn2.0.1.x86_64
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x00007fffe97b2a5b in uv__read (stream=stream@entry=0x7fffe01bbe40) at src/unix/stream.c:1211
#2  0x00007fffe97b2f58 in uv__stream_io (loop=<optimized out>, w=0x7fffe01bbec8, events=1) at src/unix/stream.c:1316
#3  0x00007fffe97b9e75 in uv.io_poll () at src/unix/epoll.c:374
#4  0x00007fffe97ac684 in uv_run (loop=0x9982e0, mode=mode@entry=UV_RUN_DEFAULT) at src/unix/core.c:389
#5  0x00007fffe975e1f0 in __pyx_f_6uvloop_4loop_4Loop___run (__pyx_v_self=0xa19e70, __pyx_v_mode=UV_RUN_DEFAULT) at uvloop/loop.c:14642
#6  0x00007fffe976548d in __pyx_f_6uvloop_4loop_4Loop__run (__pyx_v_self=0xa19e70, __pyx_v_mode=UV_RUN_DEFAULT) at uvloop/loop.c:15030
#7  0x00007fffe96ebbc8 in __pyx_pf_6uvloop_4loop_4Loop_24run_forever (__pyx_v_self=0xa19e70) at uvloop/loop.c:27698
#8  __pyx_pw_6uvloop_4loop_4Loop_25run_forever (__pyx_v_self=0xa19e70, unused=<optimized out>) at uvloop/loop.c:27519
#9  0x00007ffff79d9db0 in _PyMethodDef_RawFastCallKeywords () from /lib64/libpython3.7m.so.1.0
#10 0x00007ffff79f37ed in _PyMethodDescr_FastCallKeywords () from /lib64/libpython3.7m.so.1.0
#11 0x00007ffff7a37cfb in _PyEval_EvalFrameDefault () from /lib64/libpython3.7m.so.1.0
#12 0x00007ffff79cce66 in _PyFunction_FastCallKeywords () from /lib64/libpython3.7m.so.1.0
#13 0x00007ffff7a3326f in _PyEval_EvalFrameDefault () from /lib64/libpython3.7m.so.1.0
#14 0x00007ffff79cce66 in _PyFunction_FastCallKeywords () from /lib64/libpython3.7m.so.1.0
#15 0x00007ffff7a3326f in _PyEval_EvalFrameDefault () from /lib64/libpython3.7m.so.1.0
#16 0x00007ffff7995757 in _PyFunction_FastCallDict () from /lib64/libpython3.7m.so.1.0
#17 0x00007ffff79a2711 in _PyObject_Call_Prepend () from /lib64/libpython3.7m.so.1.0
#18 0x00007ffff7995baa in PyObject_Call () from /lib64/libpython3.7m.so.1.0
#19 0x00007ffff7aa0b43 in t_bootstrap () from /lib64/libpython3.7m.so.1.0
#20 0x00007ffff7a4a147 in pythread_wrapper () from /lib64/libpython3.7m.so.1.0
#21 0x00007ffff741744b in start_thread () from /lib64/libpthread.so.0
#22 0x00007ffff6a0b40f in clone () from /lib64/libc.so.6

My app is using uvloop + aiohttp to continiously poll certain websites with high frequency. There are couple of threads which a sending tasks to a single thread where uvloop loop runs.

Both processes where this reproduces run at -17 and -20 niceness. There are some other processes with niceness around -10,-12 where it never reproduced. So maybe somehow related.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par la trace arrière GDB fournie et examinez uvloop/loop.c autour de Loop.__run et Loop._run, puis comparez-la avec src/unix/stream.c et src/unix/epoll.c de libuv. Reproduisez le SIGSEGV intermittent dans les conditions indiquées pour Python, uvloop, Amazon Linux, threading et niceness ; le travail est terminé lorsque la cause du plantage est identifiée et corrigée.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python
Domaine
networking
Type d'issue
Bug
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
20/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.