Skip to content

The constructor left it indeterminate, so a non-static timer is linked - #865

Merged
mjp41 merged 1 commit into
microsoft:mainfrom
devnexen:pal_ds_dangling_fix
Jul 27, 2026
Merged

The constructor left it indeterminate, so a non-static timer is linked#865
mjp41 merged 1 commit into
microsoft:mainfrom
devnexen:pal_ds_dangling_fix

Conversation

@devnexen

Copy link
Copy Markdown
Collaborator

into PalTimer's list with a garbage next pointer that apply_all then dereferences. PalNotificationObject already initialises its equivalent.

@mjp41 mjp41 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, minor comment

Comment thread src/snmalloc/pal/pal_ds.h Outdated
friend class PalList;

stl::Atomic<PalTimerObject*> pal_next;
stl::Atomic<PalTimerObject*> pal_next = nullptr;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a slight preference for:

Suggested change
stl::Atomic<PalTimerObject*> pal_next = nullptr;
stl::Atomic<PalTimerObject*> pal_next{nullptr};

I found sometimes the = nullptr can prevent static constexpr working properly.

into PalTimer's list with a garbage next pointer that apply_all then
dereferences. PalNotificationObject already initialises its equivalent.
@devnexen
devnexen force-pushed the pal_ds_dangling_fix branch from 65c9893 to 05a17da Compare July 27, 2026 13:39
@mjp41
mjp41 enabled auto-merge (squash) July 27, 2026 13:43
@mjp41
mjp41 merged commit df363f9 into microsoft:main Jul 27, 2026
197 checks passed
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

Successfully merging this pull request may close these issues.

2 participants