classification
Title: Segmentation fault in _PyType_Lookup
Type: crash Stage: resolved
Components: ctypes Versions: Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: Pablosky, iritkatriel, scoder, vstinner
Priority: normal Keywords:

Created on 2018-09-03 14:01 by Pablosky, last changed 2020-11-30 00:23 by iritkatriel. This issue is now closed.

Files
File name Uploaded Description Edit
segfault.txt Pablosky, 2018-09-03 14:01
python_cores.zip Pablosky, 2018-09-05 07:39
Messages (8)
msg324521 - (view) Author: Pablosky (Pablosky) Date: 2018-09-03 14:01
Platform details:
Ubuntu 16.04 LTS (64 bit)
Python 2.7.12

I am using Robot framework environment for testing. It looks segmentation fault appears when there is a lot (like 20) of pybot (Robot Framework component) instances running in the system. When the crash appears single pybot instance is killed. Rest is fine.

It happens sporadically. Like 4% of pybot executions.
msg324530 - (view) Author: Stefan Behnel (scoder) * (Python committer) Date: 2018-09-03 17:20
Thanks for the report.
Is the place where it crashes always the same?
Could it be that your system is running out of resources, e.g. RAM?
msg324562 - (view) Author: Pablosky (Pablosky) Date: 2018-09-04 07:21
My system is Hp Z4 with 128GB ram. It is not rather problem of lack of memory. When I monitored free memory it took at most 30GB when these 20 pybots were working.

I wonder if it is possible that these separate programs (pybots) interfere each other. I mean that sharing the same modules/libraries cause that situations. Maybe one instance is recompiling py module to pyc at the same time when this is used by another process. Is it possible?

I have never caught segfault when there was only one instance of pybot.

BTW I caught 3 more different cores. I consider reinstalling my whole system (maybe Ubuntu 18.04). Maybe my system is broken.
msg324563 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-09-04 07:23
You can install and enable faulthandler to get the Python traceback where the bug occurs. It is likely that the bug comes from a third party C extension.

What are the C extensions used by pybot?
msg324610 - (view) Author: Pablosky (Pablosky) Date: 2018-09-05 07:39
Victor,

I am not familiar with code of pybot and RobotFramwework. So I don't know what extensions they are using.

I am attaching more backtraces of cores I was able to catch.

I am doing now some experiments and I am trying to find maximum amount of pybot processes which can run simultaneously without crash.
msg324611 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-09-05 08:27
Core dumps are usually unusable on a different platform. You should extract informations yourself using gdb or something else. At least, I'm sure that I will be unable to use your core dump on Fedora (you are using Ubuntu). You can open a core dump using "gdb python2.7 -c coredump" and then type "where" to get the C traceback.
msg324612 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-09-05 08:27
Again, I'm 90% sure that it's a bug in a third party module and so you should report the crash to pybot, not to Python.
msg382099 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2020-11-30 00:23
Python 2.7 is no longer supported. If you are having the issue with Python 3, please open a new issue.
History
Date User Action Args
2020-11-30 00:23:30iritkatrielsetstatus: open -> closed

nosy: + iritkatriel
messages: + msg382099

resolution: out of date
stage: resolved
2018-09-05 08:27:48vstinnersetmessages: + msg324612
2018-09-05 08:27:09vstinnersetmessages: + msg324611
2018-09-05 07:39:43Pabloskysetfiles: + python_cores.zip

messages: + msg324610
2018-09-04 07:23:13vstinnersetnosy: + vstinner
messages: + msg324563
2018-09-04 07:21:29Pabloskysetmessages: + msg324562
2018-09-03 17:20:56scodersetnosy: + scoder
messages: + msg324530
2018-09-03 14:01:47Pabloskycreate