Allow passing config as a fixture#78
Merged
jk-ozlabs merged 3 commits intoCodeConstruct:mainfrom Jun 3, 2025
Merged
Conversation
Contributor
Author
|
Weird, I can run and pass all the test locally. Is there anyway I can view the logs? (Or I guess another PR for printing the log file on CI? 😄) |
Member
|
I'll see if I can reproduce here; if that's also passing, maybe a CI update would be handy... |
Member
|
Yeah, all passes here too - not sure what's up with the runner environment... |
mkj
reviewed
Jun 3, 2025
On non-bus-owner modes, link->slot_busowner will be uninitialized,
leading to segmentation fault when running sd_bus_slot_unref.
==3850684== Conditional jump or move depends on uninitialised value(s)
==3850684== at 0x48FB448: sd_bus_slot_unref (in /usr/lib/aarch64-linux-gnu/libsystemd.so.0.38.0)
==3850684== by 0x1123E3: free_link (mctpd.c:3263)
==3850684== by 0x1125CB: free_links (mctpd.c:3308)
==3850684== by 0x113D63: main (mctpd.c:3900)
Simply zero initialize the link data.
Signed-off-by: Khang D Nguyen <khangng@os.amperecomputing.com>
Contributor
Author
|
Seems like ASAN caught some more bugs, I can reproduce with |
Member
|
OK, I had a run here with |
ASAN complained about this config file path memory leak. Free it on program exit. Also, there is a clangd warning on implicitly freeing const char*. Instead of casting to void* explicitly, I changed it to be char* to reflect the fact that we own the string allocation better. Signed-off-by: Khang D Nguyen <khangng@os.amperecomputing.com>
mctpd now requests a config fixture, which is None by default to ensure previous behaviour. Test authors can now override the config using pytest fixtures overriding facility. An example on overriding per file basis is included in the commit. Signed-off-by: Khang D Nguyen <khangng@os.amperecomputing.com>
6471906 to
b2463e1
Compare
Contributor
Author
|
CI passed now. There was a memory leak when we copied the config file path from CLI args. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This MR adds the capability to write tests for
mctpdas an endpoint. This caught an uninitialized read bug on link data.