Closed as not planned
Description
Bug report
Bug description:
The following code snippet results in a segmentation fault in Python 3.8 and 3.9, but not 3.10 and newer:
#!/usr/bin/env python3.9
# pip install opentelemetry-sdk
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import (
BatchSpanProcessor,
ConsoleSpanExporter,
)
fd = open("foo.txt", "w")
tracer_provider = TracerProvider()
processor = BatchSpanProcessor(ConsoleSpanExporter(out=fd))
tracer_provider.add_span_processor(processor)
The following conditions need to be met for the segmentation fault to happen:
- Python 3.9.18 or older (does not happen with Python 3.10 or newer)
fd
must not be closed (does not happen iffd.close()
is run at the end)
I could reproduce this segfault on both macOS Sonoma 14.3.1 and Ubuntu Linux 23.10.
I realize that 3.8 and 3.9 are no longer in the "bugfix" phase but the segfault may have security implications, which is why I decided to open this issue. Please feel free to close if it's not helpful.
CPython versions tested on:
3.8, 3.9, 3.10, 3.13
Operating systems tested on:
Linux, macOS