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

Rockblock4 #2

Open
wants to merge 85 commits into
base: master
Choose a base branch
from
Open

Rockblock4 #2

wants to merge 85 commits into from

Conversation

stephendade
Copy link
Owner

No description provided.

shiv-tyagi and others added 30 commits January 31, 2025 08:24
This one is line noise before this patch:
Failed to create log directory /APM/LOGS : ENOSPC
... so we don't try to buld bootloaders for it
these would be leaked if the "new" call for the ModeGuidedCustom object failed.

Since resgister_custom_mode may be called multiple times we could leak memory continuously
the third argument is space remaining in buffer, not size of buffer...

../../libraries/AP_AIS/AP_AIS.cpp:183:71: warning: Potential buffer overflow. Replace with 'sizeof(multi) - strlen(multi) - 1' or use a safer 'strlcat' API [unix.cstring.BadSizeArg]
                    strncat(multi,_AIVDM_buffer[msg_parts[i]].payload,sizeof(multi));
                                                                      ^~~~~~~~~~~~~
../../libraries/AP_AIS/AP_AIS.cpp:185:49: warning: Potential buffer overflow. Replace with 'sizeof(multi) - strlen(multi) - 1' or use a safer 'strlcat' API [unix.cstring.BadSizeArg]
                strncat(multi,_incoming.payload,sizeof(multi));
Lua opens scripts to load them into memory, then the logger opens them
after to stream them into the dataflash log. When loading multiple large
Lua scripts from ROMFS, decompression takes a significant amount of
time. This creates the opportunity for the Lua interpreter and logging
threads to both be inside `AP_Filesystem_ROMFS::open()` decompressing a
file.

If this happens, the function can return the same `fd` for two different
calls as the `fd` is chosen before decompression starts, but only marked
as being used after that finishes. The read pointers then stomp on each
other, so Lua loads garbled scripts (usually resulting in a syntax
error) and the logger dumps garbled data.

Fix the issue by locking before searching for a free record (or marking
a record as free). Apply the same fix to directories as well. This
doesn't protect against using the same `fd`/`dirp` from multiple
threads, but that behavior is to be discouraged anyway and is not the
root cause here.
... if the driver ever asked for prom0 then we would do Very Bad Things here.

File:	build/sitl/../../libraries/SITL/SIM_Temperature_TSYS01.cpp
Warning:	line 38, column 13
Assigned value is garbage or undefined
this allows for lower pin count devices with CAN
this allows for hwdef entries like this:

PB1 GPIO_CAN1_TERM OUTPUT PUSHPULL SPEED_LOW LOW
PB3 GPIO_CAN1_TERM_LED OUTPUT PUSHPULL SPEED_LOW LOW
PB0 GPIO_CAN1_TERM_SWITCH INPUT FLOAT

that specifies a termination pin controllable by either a parameter or
a hardware switch, with an LED to indicate if termination is active
Co-authored-by: Bob Long <[email protected]>
Co-authored-by: Michelle Rossouw <[email protected]>

another one of our "do nasty thing to autopilot" commands, useful for testing what ground control stations do when the autopilot is in this state
@stephendade stephendade force-pushed the rockblock4 branch 3 times, most recently from 6bfe458 to 50cdc29 Compare February 4, 2025 10:00
Tuxliri and others added 21 commits February 5, 2025 10:03
also change to IsForwardedFrame from IsMAVCAN
also add option to enable multicast with bridging to CAN bus in application
and disabled in bootloader
as we do ESP32 and ChibiOS when running SITL
The timeout for non-RPM telemetry is vulnerable to a similar race as the
RPM. This change makes the timeout logic consistent between the two.
../../libraries/SITL/SIM_XPlane.cpp:209:16: warning: Potential leak of memory pointed to by 'fname' [unix.Malloc]
        return false;
               ^~~~~
c_str points to a member of .str(), so we have to make sure that object persists

../../libraries/SITL/SIM_XPlane.cpp:239:34: warning: object backing the pointer will be destroyed at the end of the full-expression [-Wdangling-gsl]
  239 |             const char *type_s = d.get("type").to_str().c_str();
stop passing through _link and the original msg, move use to the base class instead.

starts fence and rally also using the "correct the GCS's count" code.

This also corrects the error code when correcting the GCS's count to INVALID_SEQUENCE rather than just ERROR
seems to have changed between versions
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.