DiamondLightSource / DiamondLightSource/pmac
Trajectory scan problems
- Dominant language
- C++
- Stars
- 31
- Forks
- 25
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
We are getting a segmentation fault error when running the IOC with the [pmacControllerTrajectory.template](https://github.com/dls-controls/pmac/blob/dls-master/pmacApp/Db/pmacControllerTrajectory.template). Using **gdb** debugger we realized that `profileUser_` and `profileVelMode_` pointer were not initialized and the `free()` functions at lines 2416 and 2421 of [pmacController.cpp](https://github.com/dls-controls/pmac/blob/dls-master/pmacApp/src/pmacController.cpp), respectively, probably deallocates forbidden memory region causing the problem. We could not find errors on our setup so we initialized those variables as `NULL` at constructor `pmacController::pmacController` at lines 223, 224 and 225:
```c
// Initialize pointer values as NULL
profileUser_=NULL;
profileVelMode=NULL;
```
Have we forget some initial configuration or is this a bug?
Another problem we are facing is that most of the times pointer can not return to buffer A after finishing buffer B at first cycle:
Buffer A -> Buffer B -> Stop here.

The GUI shows this failure immediately after I press `Execute Profile`. We generated 6000 points but we are using just 2500 to debug this buffer change problem.
I had to change manually the `Version` inside PowerPMAC to 2.0 in order to fix the incompatibility. I could not find an updated version of motion program (compatible with driver 2.0) here: [trajectory_scan_code_ppmac.pmc](https://github.com/dls-controls/pmac/blob/2-4-11/etc/LabPowerPmac/PMAC%20Script%20Language/Motion%20Programs/trajectory_scan_code_ppmac.pmc) and here [trajectory_scan_definitions_ppmac.pmh](https://github.com/dls-controls/pmac/blob/2-4-11/etc/LabPowerPmac/PMAC%20Script%20Language/Global%20Includes/trajectory_scan_definitions_ppmac.pmh).
Thanks
George
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.