ISISComputingGroup / ISISComputingGroup/IBEX

CaChannel: investigate behaviour with multiple threads

Open
#4,276 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
6
Forks
2
Avg merge
16h 40m
Merged PRs (30d)
2

Description

As a developer I believe I have seen a segmentation fault / heap corruption issue while running python code which looks like:

```
from CaChannel import CaChannel, ca
import threading

c = CaChannel("TE:NDW1799:DAE:RUNSTATE") # A string PV
c.search_and_connect(None, lambda *a, **k: None, None)

threads = [threading.Thread(target=c.getw, args=(ca.DBR_STRING, )) for _ in range(1000)]

for thread in threads:
thread.start()

for thread in threads:
thread.join()

print("Exited normally, crash did not occur.")
```

My suspicion is that this is a bug in CaChannel but I'm not completely sure. This caused an issue for LET (see https://github.com/ISISComputingGroup/IBEX/issues/4102 ).

Acceptance criteria:
- [ ] Cause of bug is understood
- [ ] Bug is fixed (or raised to the author of CaChannel if appropriate)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.