Fix vitastor-cli osd-tree crash when the etcd request fails #100

Merged
vitalif merged 1 commits from koolkhel/vitastor:cli-osd-tree-etcd-error into master 2026-10-25 17:15:15 +03:00
Contributor

Description

load_osd_tree() stored the etcd error, but loop() still called
format_tree() which dereferenced the placement tree that was never
built, so osd-tree and ls-osd died with SIGSEGV. Return the error
instead.

Tested: no automated test, the test harness cannot fail just this one etcd request. Reproduced with a failure-injecting HTTP proxy in front of etcd: osd-tree and ls-osd exit with 139 (SIGSEGV) before the fix and print the etcd error with EIO after it.

Contributor Name

Yury Luneff (MIND Software LLC, https://mindsw.io)

CLA

### Description load_osd_tree() stored the etcd error, but loop() still called format_tree() which dereferenced the placement tree that was never built, so osd-tree and ls-osd died with SIGSEGV. Return the error instead. Tested: no automated test, the test harness cannot fail just this one etcd request. Reproduced with a failure-injecting HTTP proxy in front of etcd: osd-tree and ls-osd exit with 139 (SIGSEGV) before the fix and print the etcd error with EIO after it. ### Contributor Name Yury Luneff (MIND Software LLC, https://mindsw.io) ### CLA - [x] I accept Vitastor CLA agreement: https://git.yourcmc.ru/vitalif/vitastor/src/branch/master/CLA-en.md
koolkhel added 1 commit 2026-10-25 16:14:55 +03:00
load_osd_tree() stored the etcd error, but loop() still called
format_tree() which dereferenced the placement tree that was never
built, so osd-tree and ls-osd died with SIGSEGV. Return the error
instead.
vitalif merged commit 3c6496eb3e into master 2026-10-25 17:15:15 +03:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vitalif/vitastor#100
No description provided.