Skip to content

Pyswip and thread #3

@BartholomewPanda

Description

@BartholomewPanda

Hello,

I think there is a segmentation fault error when pyswip is used in a thread. Here is a simple code to reproduce the error:

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import threading
import pyswip

class MyThread(threading.Thread):

    def __init__(self):
        threading.Thread.__init__(self)

    def run(self):
        p = pyswip.Prolog()
        p.assertz('animal(dog)')
        p.query('animal(X)')


t = MyThread()
t.start()
t.join()

When I debug the program, the segmentation fault error occurs at this line (prolog.py, line 91):
swipl_fid = PL_open_foreign_frame()

Regards,
Bartholomew.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions