Develop

Ticket #1742 (closed defect: fixed)

Opened 17 months ago

Last modified 16 months ago

valgrind: Use of unintialized values (reach rendering, abort task)

Reported by: apf Owned by: max
Priority: normal Milestone: XCSoar 6.3
Component: Task Version: 6.3
Keywords: Cc:

Description

Introduced to master branch with commit d4dfe145dccb33a714d38ff1252b5ab95cb313e4 (Merge commit 'v6.2.5'). 6.2.5 not tested yet.

==17527== Thread 4:
==17527== Conditional jump or move depends on uninitialised value(s)
==17527==    at 0x59BF81: void std::__push_heap<__gnu_cxx::__normal_iterator<AbortTask::Alternate*, std::vector<AbortTask::Alternate, std::allocator<AbortTask::Alternate> > >, long, AbortTask::Alternate, AbortRank>(__gnu_cxx::__normal_iterator<AbortTask::Alternate*, std::vector<AbortTask::Alternate, std::allocator<AbortTask::Alternate> > >, long, long, AbortTask::Alternate, AbortRank) (stl_heap.h:182)
==17527==    by 0x59B679: void std::push_heap<__gnu_cxx::__normal_iterator<AbortTask::Alternate*, std::vector<AbortTask::Alternate, std::allocator<AbortTask::Alternate> > >, AbortRank>(__gnu_cxx::__normal_iterator<AbortTask::Alternate*, std::vector<AbortTask::Alternate, std::allocator<AbortTask::Alternate> > >, __gnu_cxx::__normal_iterator<AbortTask::Alternate*, std::vector<AbortTask::Alternate, std::allocator<AbortTask::Alternate> > >, AbortRank) (stl_heap.h:220)
==17527==    by 0x59ACCE: std::priority_queue<AbortTask::Alternate, std::vector<AbortTask::Alternate, std::allocator<AbortTask::Alternate> >, AbortRank>::push(AbortTask::Alternate&&) (stl_queue.h:499)
==17527==    by 0x599B3D: AbortTask::FillReachable(AircraftState const&, std::vector<AbortTask::Alternate, std::allocator<AbortTask::Alternate> >&, GlidePolar const&, bool, bool, bool) (AbortTask.cpp:171)
==17527==    by 0x599F16: AbortTask::UpdateSample(AircraftState const&, GlidePolar const&, bool) (AbortTask.cpp:271)
==17527==    by 0x5A120A: AbstractTask::Update(AircraftState const&, AircraftState const&, GlidePolar const&) (AbstractTask.cpp:244)
==17527==    by 0x592094: TaskManager::Update(AircraftState const&, AircraftState const&) (TaskManager.cpp:310)
==17527==    by 0x42D6BB: GlideComputerTask::ProcessBasicTask(MoreData const&, MoreData const&, DerivedInfo&, DerivedInfo const&, ComputerSettings const&) (GlideComputerTask.cpp:76)
==17527==    by 0x425FEE: GlideComputer::ProcessGPS() (GlideComputer.cpp:103)
==17527==    by 0x492460: CalculationThread::Tick() (CalculationThread.cpp:84)
==17527==    by 0x4B5992: WorkerThread::Run() (WorkerThread.cpp:66)
==17527==    by 0x4B500E: Thread::ThreadProc(void*) (Thread.cpp:118)
==17527==  Uninitialised value was created by a stack allocation
==17527==    at 0x59984D: AbortTask::FillReachable(AircraftState const&, std::vector<AbortTask::Alternate, std::allocator<AbortTask::Alternate> >&, GlidePolar const&, bool, bool, bool) (AbortTask.cpp:141)

Change History

comment:1 Changed 17 months ago by apf

v6.2.5 does not show the issue so this is a merge problem.

comment:2 Changed 17 months ago by apf

  • Owner set to max
  • Status changed from new to assigned

The problem is the removal of GlideResult::CalcVInvSpeed() and it's call in AbortTask::FillReachable?().
Due to this GlideResult::time_virtual is not initialized.

comment:3 Changed 16 months ago by apf

  • Status changed from assigned to closed
  • Resolution set to fixed

Fixed in 0c971d3d4bed635513f9ac8f02f82ea038d6d2bb

Note: See TracTickets for help on using tickets.