You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My code I use to run everyday started showing error after the recent update ,
It starts by showing me some warning: net time use this else it won't work in the next update and I fix as it says and update aiohttp with python, the I start encounters this bug
Fatal Python error: Segmentation fault
Current thread's C stack trace (most recent call first):
Decoding responds fails on some site and instead of it to raise Expectation it crush
Am already using try and except Exception
Most crush here
Body = await response.text(errors="ignore")
Logs/tracebacks
Fatal Python error: Segmentation fault
Thread 0x00000073033f8cb0 (most recent call first):
File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/pycares/__init__.py", line 430 in _run_safe_shutdown_loop
File "/data/data/com.termux/files/usr/lib/python3.14/threading.py", line 1024 in run
File "/data/data/com.termux/files/usr/lib/python3.14/threading.py", line 1082 in _bootstrap_inner
File "/data/data/com.termux/files/usr/lib/python3.14/threading.py", line 1044 in _bootstrap
Current thread 0x0000007395ae4098 (most recent call first):
File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/aiohttp/client_proto.py", line 326 in data_received
File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/aiohttp/base_protocol.py", line 89 in resume_reading
File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/aiohttp/client_proto.py", line 194 in resume_reading
File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/aiohttp/streams.py", line 556 in _read_nowait_chunk
File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/aiohttp/streams.py", line 568 in _read_nowait
File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/aiohttp/streams.py", line 462 in readany
File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/aiohttp/streams.py", line 437 in read
File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/aiohttp/client_reqrep.py", line 715 in read
File "/storage/emulated/0/test/test-eye/s/mycode.py", line 722 in worker4
File "/storage/emulated/0/test/test-eye/s/mycode.py", line 614 in worker2
File "/data/data/com.termux/files/usr/lib/python3.14/asyncio/events.py", line 94 in _run
File "/data/data/com.termux/files/usr/lib/python3.14/asyncio/base_events.py", line 2056 in _run_once File "/data/data/com.termux/files/usr/lib/python3.14/asyncio/base_events.py", line 677 in run_forever
File "/data/data/com.termux/files/usr/lib/python3.14/asyncio/base_events.py", line 706 in run_until_complete
File "/data/data/com.termux/files/usr/lib/python3.14/asyncio/runners.py", line 128 in run
File "/data/data/com.termux/files/usr/lib/python3.14/asyncio/runners.py", line 205 in run
File "/storage/emulated/0/test/test-eye/s/mycode.py", line 1367 in <module>
Current thread's C stack trace (most recent call first):
<cannot get C stack on this system>
Extension modules: _cffi_backend, aiohttp._http_writer, aiohttp._http_parser, aiohttp._websocket.mask, aiohttp._websocket.reader_c (total: 5)
Segmentation fault
Python Version
Python 3.14.6
aiohttp Version
$ python -m pip show aiohttpName: aiohttpVersion: 3.14.2
I think it's from aiohttp, i remove aiodns and it usage from my code still crush
Your traceback shows pycares, which is used by aiodns. Please follow the instructions and confirm the results. We can't help you if you don't give us any information...
Also verifying if it works without extensions (run with AIOHTTP_NO_EXTENSIONS=1) would help. That will tell us if it's a parser issue (we upgraded llhttp), and that's the only C code we run.
I'm unclear how your code works though, it appears to be using threading, which generally doesn't make sense in an asyncio application.. Any code to look at or reproduce the issue would obviously be very helpful.
File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/aiohttp/client_proto.py", line 326 in data_received
This line is feeding data to the parser, so it probably is related to the C parser (llhttp). But, we need more information on how to reproduce. Can you provide code that shows the problem?
File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/aiohttp/client_proto.py", line 326 in data_received
This line is feeding data to the parser, so it probably is related to the C parser (llhttp). But, we need more information on how to reproduce. Can you provide code that shows the problem?
Please I remove aiodns, uvloop completely from my code and still crash
Fatal Python error: Segmentation fault
Current thread 0x000000756c59f098 (most recent call first): File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/aiohttp/client_proto.py", line 326 in data_received File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/aiohttp/base_protocol.py", line 89 in resume_reading
File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/aiohttp/client_proto.py", line 194 in resume_reading
File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/aiohttp/streams.py", line 556 in _read_nowait_chunk File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/aiohttp/streams.py", line 569 in _read_nowait
File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/aiohttp/streams.py", line 462 in readany File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/aiohttp/streams.py", line 437 in read
File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/aiohttp/client_reqrep.py", line 715 in read
File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/aiohttp/client_reqrep.py", line 757 in text
File "/storage/emulated/0/test/test-eye/s/news.py", line 730 in sprayworker
File "/storage/emulated/0/test/test-eye/s/news.py", line 622 in worker2
File "/data/data/com.termux/files/usr/lib/python3.14/asyncio/events.py", line 94 in _run
File "/data/data/com.termux/files/usr/lib/python3.14/asyncio/base_events.py", line 2056 in _run_once
File "/data/data/com.termux/files/usr/lib/python3.14/asyncio/base_events.py", line 677 in run_forever File "/data/data/com.termux/files/usr/lib/python3.14/asyncio/base_events.py", line 706 in run_until_complete
File "/data/data/com.termux/files/usr/lib/python3.14/asyncio/runners.py", line 128 in run
File "/data/data/com.termux/files/usr/lib/python3.14/asyncio/runners.py", line 205 in run
File "/storage/emulated/0/test/test-eye/s/news.py", line 1374 in
Current thread's C stack trace (most recent call first):
The error in my code and what is found over there
1.File "/storage/emulated/0/test/test-eye/s/news.py", line 730 in sprayworker
line 730
body = await r.text(errors='ignore')
File "/storage/emulated/0/test/test-eye/s/news.py", line 622 in worker2
line 622
ex_tabl = await sprayworker(data, "table")
It's a scraper tools, scraping from many urls and it crash after few seconds after starting (sometimes it runs about 4-6sec then crash sometimes 30-40sec) it should raise expectation but it crashes, before update I use to run the same site successfully without any crash even at high Semaphore
my complete imports
Key: all # lines are commented real in my code
import faulthandler
faulthandler.enable()
import os
import re
import ssl
import ast
import json
import time
#import uvloop
import random
#import certifi
import asyncio
import aiohttp
import hashlib
from colorama import Fore, Style, init
from fake_useragent import UserAgent
#from aiohttp.resolver import AsyncResolver
from urllib.parse import urlparse, parse_qs, urlencode, urlunparse
#the below is advice use by AI to stop the crash
os.environ['AIOHTTP_NO_EXTENSIONS'] = '1'
os.environ['UVLOOP_NO_EXTENSIONS'] = '1'
Again, test with AIOHTTP_NO_EXTENSIONS (set this as the environment variable for the program, not inside the code).
And give us some code or anything (e.g. the payload that causes the failure; log each request you make so you know which request actually triggers the failure) that we can use to figure out what the problem is.
Thanks @taulantarapi for the email report, that's been really helpful.
We're still investigating the precise details, but right now it looks like a bug in brotlicffi, so I'd suggest you both uninstall that library for the moment.
Brotlicffi might be the cause of the crash because requests fail to decode the response too but raised Exception not crash so my suggestion is, add that error to aiohttp to raise Exception when such decoding fails
Because I just checked brotlicffi repo from GitHub here and it hasn't been update recently so it's possible from aiohttp, aiohttp old version was not crashing, my suggestion is if brotlicffi fails raise Exception not crash, please take a look at it
The issue appeared in 1.2. When 1.2 was released we made a security fix which was a bit of a hack, but happened to also avoid the newly broken code path in brotlicffi. aiohttp 3.14 contained our complete fix that re-enabled that code path.
So problem exists with aiohttp 3.14+ and brotlicffi 1.2. We also require 1.2+ for our security fix, so the only option currently is to uninstall brotlicffi. I'll check if the segfault can be resolved, but you still want to uninstall it, because those exceptions are still stopping you from reading legitimate responses.
Activity
Dreamsorcerer commentedon Jul 21, 2026
Can you test without aiodns installed? And if that works, then verify that you were using the latest version of both aiodns and pycares.
syteweb740-max commentedon Jul 21, 2026
I think it's from aiohttp, i remove aiodns and it usage from my code still crush
I think the best solution is to switch to httpx
Dreamsorcerer commentedon Jul 21, 2026
Your traceback shows pycares, which is used by aiodns. Please follow the instructions and confirm the results. We can't help you if you don't give us any information...
Dreamsorcerer commentedon Jul 21, 2026
If it's still failing without aiodns, then please paste the full traceback again.
Dreamsorcerer commentedon Jul 21, 2026
Also verifying if it works without extensions (run with
AIOHTTP_NO_EXTENSIONS=1) would help. That will tell us if it's a parser issue (we upgraded llhttp), and that's the only C code we run.I'm unclear how your code works though, it appears to be using threading, which generally doesn't make sense in an asyncio application.. Any code to look at or reproduce the issue would obviously be very helpful.
Dreamsorcerer commentedon Jul 21, 2026
This line is feeding data to the parser, so it probably is related to the C parser (llhttp). But, we need more information on how to reproduce. Can you provide code that shows the problem?
syteweb740-max commentedon Jul 22, 2026
Please I remove aiodns, uvloop completely from my code and still crash
Fatal Python error: Segmentation fault
Current thread 0x000000756c59f098 (most recent call first): File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/aiohttp/client_proto.py", line 326 in data_received File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/aiohttp/base_protocol.py", line 89 in resume_reading
File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/aiohttp/client_proto.py", line 194 in resume_reading
File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/aiohttp/streams.py", line 556 in _read_nowait_chunk File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/aiohttp/streams.py", line 569 in _read_nowait
File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/aiohttp/streams.py", line 462 in readany File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/aiohttp/streams.py", line 437 in read
File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/aiohttp/client_reqrep.py", line 715 in read
File "/data/data/com.termux/files/usr/lib/python3.14/site-packages/aiohttp/client_reqrep.py", line 757 in text
File "/storage/emulated/0/test/test-eye/s/news.py", line 730 in sprayworker
File "/storage/emulated/0/test/test-eye/s/news.py", line 622 in worker2
File "/data/data/com.termux/files/usr/lib/python3.14/asyncio/events.py", line 94 in _run
File "/data/data/com.termux/files/usr/lib/python3.14/asyncio/base_events.py", line 2056 in _run_once
File "/data/data/com.termux/files/usr/lib/python3.14/asyncio/base_events.py", line 677 in run_forever File "/data/data/com.termux/files/usr/lib/python3.14/asyncio/base_events.py", line 706 in run_until_complete
File "/data/data/com.termux/files/usr/lib/python3.14/asyncio/runners.py", line 128 in run
File "/data/data/com.termux/files/usr/lib/python3.14/asyncio/runners.py", line 205 in run
File "/storage/emulated/0/test/test-eye/s/news.py", line 1374 in
Current thread's C stack trace (most recent call first):
Extension modules: _cffi_backend, aiohttp._http_writer, aiohttp._http_parser, aiohttp._websocket.mask, aiohttp._websocket.reader_c (total: 5)
Segmentation fault
The error in my code and what is found over there
1.File "/storage/emulated/0/test/test-eye/s/news.py", line 730 in sprayworker
line 730
body = await r.text(errors='ignore')
File "/storage/emulated/0/test/test-eye/s/news.py", line 622 in worker2
line 622
ex_tabl = await sprayworker(data, "table")
syteweb740-max commentedon Jul 22, 2026
It's a scraper tools, scraping from many urls and it crash after few seconds after starting (sometimes it runs about 4-6sec then crash sometimes 30-40sec) it should raise expectation but it crashes, before update I use to run the same site successfully without any crash even at high Semaphore
my complete imports
Key: all # lines are commented real in my code
import faulthandler
faulthandler.enable()
import os
import re
import ssl
import ast
import json
import time
#import uvloop
import random
#import certifi
import asyncio
import aiohttp
import hashlib
from colorama import Fore, Style, init
from fake_useragent import UserAgent
#from aiohttp.resolver import AsyncResolver
from urllib.parse import urlparse, parse_qs, urlencode, urlunparse
#the below is advice use by AI to stop the crash
os.environ['AIOHTTP_NO_EXTENSIONS'] = '1'
os.environ['UVLOOP_NO_EXTENSIONS'] = '1'
And still crash
Dreamsorcerer commentedon Jul 22, 2026
Again, test with AIOHTTP_NO_EXTENSIONS (set this as the environment variable for the program, not inside the code).
And give us some code or anything (e.g. the payload that causes the failure; log each request you make so you know which request actually triggers the failure) that we can use to figure out what the problem is.
syteweb740-max commentedon Jul 22, 2026
Yes AIOHTTP_NO_EXTENSIONS=1 python your_script.py works without crashing
11 remaining items
taulantarapi commentedon Jul 22, 2026
it still segfaults on 3.14.3
syteweb740-max commentedon Jul 22, 2026
ERROR: No matching distribution found for aiohttp==3.14.3
Or aiohttp version 3.14.3 has not been release yet
taulantarapi commentedon Jul 23, 2026
i couldn't find it either in pypi, but there are whl files here on github or you can install it from source
syteweb740-max commentedon Jul 23, 2026
From github here they haven't update it yet, may be it will be update later
Dreamsorcerer commentedon Jul 23, 2026
Thanks @taulantarapi for the email report, that's been really helpful.
We're still investigating the precise details, but right now it looks like a bug in brotlicffi, so I'd suggest you both uninstall that library for the moment.
Dreamsorcerer commentedon Jul 23, 2026
python-hyper/brotlicffi#225
syteweb740-max commentedon Jul 23, 2026
Brotlicffi might be the cause of the crash because requests fail to decode the response too but raised Exception not crash so my suggestion is, add that error to aiohttp to raise Exception when such decoding fails
syteweb740-max commentedon Jul 23, 2026
Because I just checked brotlicffi repo from GitHub here and it hasn't been update recently so it's possible from aiohttp, aiohttp old version was not crashing, my suggestion is if brotlicffi fails raise Exception not crash, please take a look at it
Dreamsorcerer commentedon Jul 23, 2026
The issue appeared in 1.2. When 1.2 was released we made a security fix which was a bit of a hack, but happened to also avoid the newly broken code path in brotlicffi. aiohttp 3.14 contained our complete fix that re-enabled that code path.
So problem exists with aiohttp 3.14+ and brotlicffi 1.2. We also require 1.2+ for our security fix, so the only option currently is to uninstall brotlicffi. I'll check if the segfault can be resolved, but you still want to uninstall it, because those exceptions are still stopping you from reading legitimate responses.
Dreamsorcerer commentedon Jul 23, 2026
Note that this problem doesn't exist in brotli. I assume you're on a less common platform, where Google's brotli is not supported.
syteweb740-max commentedon Jul 23, 2026
Yes after uninstalling brotlicffi it works👍 without crashing
Dreamsorcerer commentedon Jul 26, 2026
Segfault: cython/cython#7857
Dreamsorcerer commentedon Aug 22, 2026
v1.2.0.2 is out now, you can reinstall brotlicffi