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

Fatal bug when trying to validate protocols in device-sdk-c #542

Open
GabrielMonS opened this issue Feb 3, 2025 · 0 comments
Open

Fatal bug when trying to validate protocols in device-sdk-c #542

GabrielMonS opened this issue Feb 3, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@GabrielMonS
Copy link

🐞 Bug Report

Affected Services [REQUIRED]

The issue is located in: device-sdk-c

Is this a regression?

Yes, the previous version in which this bug was not present was: N/A

Description and Minimal Reproduction [REQUIRED]

When setting a address validate function (using the devsdk_callbacks_set_validate_addr() function of the sdk), the service calls the function convert_protocols() located in validate.c(line 14). This function is unable to retrieve the protocol name or properties and throws a segmentation fault when trying to assign a 'null' to the devsdk_protocols object's fields (protocol->name and protocol->properties). This segfault in turn kills the whole service.

In order to reproduce it, you can use a template for device service, add a validate_address function, compile the template and run it, and try to add a device to the service. It will crash.

🔥 Exception or Error

Last prints I get (including custom ones I have put, the ones that start with [PROTOCOLS_CONVERT]:




level=INFO ts=2025-02-03T13:59:02Z app=device-random msg="Processing Devices from ./res/devices"
[PROTOCOLS_CONVERT]: Entering protocol convert function
[PROTOCOLS_CONVERT]: Entering protocol search loop
[PROTOCOLS_CONVERT]: Protocol 0, Name: (null)
Segmentation fault

🌍 Your Environment

Deployment Environment: Ubuntu 22.04 on AMD64 system.

EdgeX Version [REQUIRED]: EdgeX version: 3.1.1 / device-sdk-c version: 4.0.0-dev1

Anything else relevant?

@GabrielMonS GabrielMonS added the bug Something isn't working label Feb 3, 2025
@github-project-automation github-project-automation bot moved this to New Issues in Technical WG Feb 4, 2025
@jumpingliu jumpingliu moved this from New Issues to Release Backlog in Technical WG Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Release Backlog
Development

No branches or pull requests

2 participants