robotpy / robotpy/robotpy-navx

[BUG]: OffsetTracker::UpdateHistory can segfault in tests

Open
#21 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
3
Forks
4
Avg merge
7d 5h
Merged PRs (30d)
1

Description

Running pyfrc robot tests, I sometimes get these segfaults on Linux:

(gdb) bt
#0  0x00007ffff140ff10 in OffsetTracker::UpdateHistory(float) () from ~/.local/share/virtualenvs/rpy/lib/python3.10/site-packages/navx/_navx.cpython-310-x86_64-linux-gnu.so
#1  0x00007ffff140eef1 in AHRSInternal::SetAHRSPosData(AHRSProtocol::AHRSPosUpdate&, long) ()
   from ~/.local/share/virtualenvs/rpy/lib/python3.10/site-packages/navx/_navx.cpython-310-x86_64-linux-gnu.so
#2  0x00007ffff1414b34 in SimIO::UpdatePeriodicFromSimVariables(long) () from /home/seedbox/.local/share/virtualenvs/rpy/lib/python3.10/site-packages/navx/_navx.cpython-310-x86_64-linux-gnu.so
#3  0x00007ffff1414c99 in SimIO::Run() () from ~/.local/share/virtualenvs/rpy/lib/python3.10/site-packages/navx/_navx.cpython-310-x86_64-linux-gnu.so
#4  0x00007ffff140c6aa in AHRS::ThreadFunc(IIOProvider*) () from ~/.local/share/virtualenvs/rpy/lib/python3.10/site-packages/navx/_navx.cpython-310-x86_64-linux-gnu.so
#5  0x00007ffff6caf4d4 in std::execute_native_thread_routine (__p=0x7fff9801e020) at /usr/src/debug/gcc/libstdc++-v3/src/c++11/thread.cc:82
#6  0x00007ffff7a415c2 in start_thread () from /usr/lib/libc.so.6
#7  0x00007ffff7ac6584 in clone () from /usr/lib/libc.so.6

An interesting note: I seem to only be able to reproduce the segfault with my team's code if I let the operator control and disabled tests run...

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the gdb backtrace for OffsetTracker::UpdateHistory(float) in the navx extension and trace the call path through AHRSInternal::SetAHRSPosData, SimIO::UpdatePeriodicFromSimVariables, and SimIO::Run. Reproduce the failure with pyfrc robot tests on Linux, especially with operator control enabled and tests disabled; done means the intermittent segfault no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
robotics, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.