Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quick_start_centralsystem segmentation fault #160

Closed
popnukem opened this issue Nov 3, 2023 · 3 comments · Fixed by #162
Closed

quick_start_centralsystem segmentation fault #160

popnukem opened this issue Nov 3, 2023 · 3 comments · Fixed by #162

Comments

@popnukem
Copy link

popnukem commented Nov 3, 2023

I have built a prototype Central System using the quick_start_centralsystem in open-ocpp-1.4.0 (please see attached code main.cpp and iccs.hpp). I have two Charging Points physically attached to the Central System running on an Orange-pi PC Plus with Armbian Linux (Ubuntu 20.04). For some reason, I don't know why at this stage, both CPs randomly disconnect themselves (software disconnect) from the CS and sometimes this causes the CS software to seg fault.
As well as the source code I have dumped the contents of the build_gcc_native/examples/quick_start_centralsystem/CMakeFiles/quick_start_centralsystem.dir directory to include the make and object files. Also in the dump is a document 'ocpp seg fault 31-oct-2023' which contains the strace output of the seg fault. Also in the attached segfault.zip
segfault.zip
is the core dump.
Are you able to tell what is causing the seg fault from these files?
From the comments in the main.cpp you can see I though I'd found the cause by checking the size of event_handler.chargePoints() - see line 317, I think this may have solved one instance, but clearly there is still an issue.
many thanks
andy

@c-jimenez
Copy link
Owner

c-jimenez commented Nov 10, 2023

Hi,
Thanks for your feedback, the quick start central system indeed contains a bug leading to crash when charging stations are connecting/disconnecting.
Note that this crash is due to an incorrect usage of smart pointers in the example, not from the code of the library itself.
I will modify the example code and keep you updated.

@c-jimenez
Copy link
Owner

Hi,

The issue is fixed by the following PR : #162.

Please note that these are examples and they are not very optimized in their way of managing simultaneous communications with a lot of charging stations. They mainly here to highlight the stack's interfaces.

@popnukem
Copy link
Author

Hi, many thanks for this. I now have it on long-term testing with multiple CPs connected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants