Aeraf khan
Aeraf khan

Reputation: 1

Im getting this error "fatal Python error: Bus error"

I have a test script for which I'm using selenium along with pytest. Sometimes I get an error saying 'fatal Python erorr: Bus error'. I'm not using sockets, threads or anything else that requires use of memory allocation and even pointers. I've attached screenshots for reference.

I'm also using jpype so that I can use extent report for reporting purposes and the first line in the screenshot that is giving the error in the conftest.py in fin is as follows:

@pytest.fixture(scope="session")
def report_util(request):
    timestamp = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
    extent = ExtentReports()
    if not os.path.exists("../reports/"):
        os.makedirs("../reports/")
    extent_reporter = ExtentSparkReporter(f'../reports/report_{timestamp}.html')
    extent_reporter.config().thumbnailForBase64(True)
    extent_reporter.config().setCss("img {width: 400px;}")
    extent.attachReporter(extent_reporter)

    def fin():
        try:
            extent.flush()
            jp.shutdownJVM()
        except Exception as e:
            print(f"Exception during teardown: {e}")
            raise

    request.session.addfinalizer(fin)

    return extent

enter image description here

I tried mprof to see if there are any memory leaks... but the error doesn't happen always. So its quite hard to find the issue as when I was trying to do memory profiling I didn't got the same error.

Upvotes: 0

Views: 290

Answers (0)

Related Questions