Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AP_HAL_SITL: disable SITL stack checking due to memory corruption #13276

Merged
merged 1 commit into from
Jan 15, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion libraries/AP_HAL_SITL/Scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ using namespace HALSITL;

extern const AP_HAL::HAL& hal;

#ifndef SITL_STACK_CHECKING_ENABLED
//#define SITL_STACK_CHECKING_ENABLED !defined(__CYGWIN__) && !defined(__CYGWIN64__)
// stack checking is disabled until the memory corruption issues are
// fixed with pthread_attr_setstack. These may be due to
// changes in the way guard pages are handled.
#define SITL_STACK_CHECKING_ENABLED 0
#endif

AP_HAL::Proc Scheduler::_failsafe = nullptr;

Expand Down Expand Up @@ -233,7 +240,9 @@ void Scheduler::_run_io_procs()
hal.uartH->_timer_tick();
hal.storage->_timer_tick();

#if SITL_STACK_CHECKING_ENABLED
check_thread_stacks();
#endif

AP::RC().update();
}
Expand Down Expand Up @@ -316,7 +325,7 @@ bool Scheduler::thread_create(AP_HAL::MemberProc proc, const char *name, uint32_
a->name = name;

pthread_attr_init(&a->attr);
#if !defined(__CYGWIN__) && !defined(__CYGWIN64__)
#if SITL_STACK_CHECKING_ENABLED
if (pthread_attr_setstack(&a->attr, a->stack, alloc_stack) != 0) {
AP_HAL::panic("Failed to set stack of size %u for thread %s", alloc_stack, name);
}
Expand Down