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

Bug in "Probe" logic in Entity Manager- while parsing Probe statements from EM configs #24

Open
harsh23tyagi11 opened this issue Mar 21, 2023 · 1 comment

Comments

@harsh23tyagi11
Copy link

I recently discovered this little bug in the logic that parses the probe statement in Entity Manager, hence documenting it for visibility and can fix this later either by a creating an exclusive parser or some other parsing mechanism.

Bug Description:
The code line here in findProbeType() method call- https://github.com/openbmc/entity-manager/blob/master/src/entity_manager.cpp#L92 is
if probe.find(probeType->first) != std::string::npos) which fails if the probe statement has OR in it as it will find the first occurrence of the probeTypes in the string.

For instance: probe = xyz.openbmc_project.UsbDevice({'VENDOR_ID': '2frrr3'}) would fail to be probed and would be considered as a conjunction statement - since it has OR at 36th index (in vendOR_id).

probeType->first values are yielded from:

probeTypes{{{"FALSE", probe_type_codes::FALSE_T},
                {"TRUE", probe_type_codes::TRUE_T},
                {"AND", probe_type_codes::AND},
                {"OR", probe_type_codes::OR},
                {"FOUND", probe_type_codes::FOUND},
                {"MATCH_ONE", probe_type_codes::MATCH_ONE}}};

Now every time this function yields to true, the EM doesn't search the DBus for object paths and consider it as a conjunction statement such as OR, FOUND etc.

Current resolution:
Until this is fixed avoid having probeTypes character strings in the probe statements.

Potential fixes:

@EWE002
Copy link

EWE002 commented Jan 3, 2025

Hello, has this problem been solved?

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

No branches or pull requests

2 participants