Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve Bus error (core dumped) in python?

I was running python script on EC2 instance. Due to out of storage, I had to extend the storage by 4GB. After I extended the storage of the instance. I try to run the python script, at that time I'm encountering this error.

Any thoughts or suggestions to sort this out?

like image 772
Eswar RDS Avatar asked Jan 19 '26 15:01

Eswar RDS


1 Answers

When you get error like Bus error or segmentation fault. Please,check below steps

  1. Whether Memory of instance is full or not
  2. Whether folder/code have enough permissions to run or not.

If none of above issues are occured then try running below commands in terminal to identify from where this exact issue is coming from, in the code.

gdb python
(gdb) run /path/to/script.py
## wait for segfault ##
(gdb) backtrace
## stack trace of the c code

Above commands solved my problem. Hope, this helps when someone get similar issues.

like image 57
Eswar RDS Avatar answered Jan 22 '26 05:01

Eswar RDS