-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Today I analyzed the following branch:
https://github.com/rokopt/stellar-core/tree/muse-dev-experiments
With the following results:
https://console.muse.dev/result/rokopt/stellar-core/01EKJR98Y8YSJBQDV5J6PGRHBN?tab=results
There are many "Uninitialized_value" errors, of which the ones I've examined so far all appear spurious to me. I expect some spurious errors to be inevitable, but I'll note these for your consideration even if they end up being no-action ones.
In some cases, it appears not to have realized that a variable was being declared and initialized at the same time:
Uninitialized_value
The value read from trimmed was never initialized.
src/.../Scheduler.cpp 178:5
void
Scheduler::trimSingleActionQueue(Qptr q, VirtualClock::time_point now)
{
size_t trimmed = q->tryTrim(mLatencyWindow, now);
mStats.mActionsDroppedDueToOverload += trimmed;
mSize -= trimmed;
}
In some, it doesn't notice that a variable is initialized in both branches of an if:
Uninitialized_value
The value read from res was never initialized.
src/.../SponsorshipUtils.cpp 814:5
if (sponsorship)
{
auto const& se = sponsorship.currentGeneralized().sponsorshipEntry();
auto sponsoringAcc = loadAccount(ltx, se.sponsoringID);
res = canCreateSignerWithSponsorship(
header.current(), signerIt, sponsoringAcc.current(), acc.current());
if (res == SponsorshipResult::SUCCESS)
{
createSignerWithSponsorship(signerIt, sponsoringAcc.current(),
acc.current());
}
}
else
{
res =
canCreateSignerWithoutSponsorship(header.current(), acc.current());
if (res == SponsorshipResult::SUCCESS)
{
createSignerWithoutSponsorship(acc.current());
}
}
return res;
And similarly with a case:
Uninitialized_value
The value read from res was never initialized.
src/.../BallotProtocol.cpp 1578:5
{
bool res;
switch (st.pledges.type())
{
case SCP_ST_PREPARE:
{
auto const& p = st.pledges.prepare();
res =
(p.prepared && areBallotsLessAndCompatible(ballot, *p.prepared)) ||
(p.preparedPrime &&
areBallotsLessAndCompatible(ballot, *p.preparedPrime));
}
break;
case SCP_ST_CONFIRM:
{
auto const& c = st.pledges.confirm();
SCPBallot prepared(c.nPrepared, c.ballot.value);
res = areBallotsLessAndCompatible(ballot, prepared);
}
break;
case SCP_ST_EXTERNALIZE:
{
auto const& e = st.pledges.externalize();
res = areBallotsCompatible(ballot, e.commit);
}
break;
default:
res = false;
dbgAbort();
}
return res;
}
Metadata
Metadata
Assignees
Labels
No labels