Skip to content

dinit-check: fix null dereference on "consumer-of: non-existent" and an igr-test for it#545

Open
mobin-2008 wants to merge 2 commits intodavmac314:masterfrom
mobin-2008:fix_nullptr_derefrence
Open

dinit-check: fix null dereference on "consumer-of: non-existent" and an igr-test for it#545
mobin-2008 wants to merge 2 commits intodavmac314:masterfrom
mobin-2008:fix_nullptr_derefrence

Conversation

@mobin-2008
Copy link
Copy Markdown
Collaborator

I was writing a service for my Dinit instance and then I saw a segfault in the output of the dinit-check command. For example:

Checking service: boot...
Checking service: non-existent...
Unable to load service 'non-existent': service description not found.
Performing secondary checks...
Warning: Service 'boot' specified as consumer of service 'Segmentation fault         dinit-check -d src/igr-tests/check-missing-consumer/sd

I fixed the null dereference issue causing the segfault, see the first commit and also included a igr-test to make sure it always works correctly.

Get the value of "consumer-of" property by using the service name
instead of using the service pointer which is null in this context.
@mobin-2008 mobin-2008 added Bug/Bugfix A-Importance: Normal C-dinit-check Things about dinitcheck C-tests Things about unit or integration tests labels May 8, 2026
Check for dinit-check output when it encounters a non-existent service
in the value of "consumer-of".
@mobin-2008 mobin-2008 force-pushed the fix_nullptr_derefrence branch from cb77e43 to 488772f Compare May 8, 2026 13:56
@mobin-2008 mobin-2008 changed the title dinit-check: fix null dereference on "consumer-of: non-existent" and a igr-test for it dinit-check: fix null dereference on "consumer-of: non-existent" and an igr-test for it May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Importance: Normal Bug/Bugfix C-dinit-check Things about dinitcheck C-tests Things about unit or integration tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant