Ubuntu 16.04 LTS - Python 3.5 - Segmentation fault (core dumped)
Problem:
I ran a simple code (eg_sq_serial.py) on command line and it caused a "Segmentation fault (core dumped)" error. The code could be executed successfully when the value 40000000 was reduced to 1,000,000. However, Segmentation fault (core dumped) persisted with a higher value like 2,000,000.
I rebooted Ubuntu 16.04 LTS and executed the same code on command line with a value of 10,000,000 and it could complete. However, when a value of 40,000,000 was used, Segmentation fault (core dumped) occurred again. Thereafter, using the earlier value of 10,000,000 also lead to Segmentation fault (core dumped). The code could be executed successfully for a value of 1,000,000 or less.
Expectations:
The code should be able to execute successfully with a value of 40000000.
Question:
How can I resolve/overcome the "Segmentation fault (core dumped)" error? This error should not happen.
System info:
$ uname -a
Linux Eliot 4.4.0-22-generic #39-Ubuntu SMP Thu May 5 16:53:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -crid
Distributor ID: Ubuntu
Description: Ubuntu 16.04 LTS
Release: 16.04
Codename: xenial
$ dmidecode | grep -e Date -e Vendor -e Version -e Product | head -n 4
Vendor: American Megatrends Inc.
Version: 0504
Release Date: 10/19/2015
Product Name: System Product Name
$ dpkg -l python3
Desired=
| Status=
|/ Err?=(none)
||/ Name Version Architecture Description
+++-===
ii python3 3.5.1-3 amd64 interactive high-level object-ori
Physical memory available 32GB
Python code "eg_sq_serial.py" :
=================
def f(x): # Function that returns the square of x.
return x*x
if __name__ == '__main__':
i = 0
result=[]
while i < 40000000:
aa=[]
for x in range(1,5):
i += 1
print(result)
print(i)
Question information
- Language:
- English Edit question
- Status:
- Expired
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: