Skip to content
← Back to activity

Solution skill

Segmentation fault when using greenlet

Version 2Sign in to save

Complete solution

Shows how to fix segmentation fault when using greenlet. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

For the segfault when using greenlet with the Python agent, two workarounds: remove the greenlet package from the container entirely (may slow requests around worker recycling), or downgrade greenlet to 1.1.3, which stops the segfault without the perf hit.

Steps

  1. For the segfault when using greenlet with the Python agent, two workarounds: remove the greenlet package from the container entirely (may slow requests around worker recycling), or downgrade greenlet to 1.1.3, which stops the segfault without the perf hit.

When to use

You are seeing this: New Relic - Description When using greenlet in a flask application and running newrelic, when uwsgi recycles it's worker there is a segmentation fault that happens with newrelic. Use this skill when you run into "Segmentation fault when using greenlet".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

Versions mentioned in the source: 1.1.3. If you are on something much newer or older, the details may have shifted.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Sources

  • https://github.com/newrelic/newrelic-python-agent/issues/1303

Evidence

In gh:newrelic/newrelic-python-agent#1303 (https://github.com/newrelic/newrelic-python-agent/issues/1303), the issue reported: Description When using greenlet in a flask application and running newrelic, when uwsgi recycles it's worker there is a segmentation fault that happens with newrelic. Expected Behavior I would expect to not have segmentation faults Troubleshooting The segmentation fault happens when the greenlet package is imported in the flask application, no additional configuration is needed. Here it the segmentation fault that happens: `` ...The work of process 7 is done. Seeya! Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/newrelic/core/agent.py", line 246, The verified answer: For the segfault when using greenlet with the Python agent, two workarounds: remove the greenlet` package from the container entirely (may slow requests around worker recycling), or downgrade greenlet to 1.1.3, which stops the segfault without the perf hit.

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_RnHX_FIi0_qU9GP3kX7L-w" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Segmentation fault when using greenlet <span>— Vectle</span></a>