Repository navigation
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review: 2
Please check the settings in the CodeRabbit UI or the
|
Segfaultd
force-pushed
the
refactor/modern-memory-5-table-extensions
branch
from
November 16, 2026 11:43
64f2cb0 to
b4a5c4e
Compare
Segfaultd
force-pushed
the
refactor/modern-memory-6-delete-ds
branch
from
November 16, 2026 11:43
e743d22 to
4624462
Compare
Delete the last ds_*.h headers (ds_list, ds_queue, ds_ordered_list, ds_map, ds_hash, ds_heap, ds_linked_list, ds_memory_pool, ds_multilist) with no forwarding headers, and drop them from the CMake header list. Convert the stragglers that still used them to std:: containers: ConsoleServer, LogCommandParser, Rackspace, UDPForwarder, VariableDeltaSerializer (receipt history on std::map, ChangedVariablesList on plain new/delete instead of a MemoryPool), VariableListDeltaTracker and the Linux _findfirst emulation. Files that got <assert.h> through the DS headers include <cassert> themselves. Remove a commented-out RakString benchmark main that was written against DataStructures::List. Delete the two legacy Xcode projects (RakNet_IOS_XCode, Samples/iOS ChatClient): every source path they list, the ds_* headers included, no longer exists. Delete docs/api/data-structures.rst and describe std:: containers in the system overview, the virtual-worlds guide and CLAUDE.md. Add VariableDeltaSerializer unit tests for receipt tracking.
ReliabilityLayer::AllocInternalPacketData(packet, numBytes, allowStack) and FreeInternalPacketData(packet) lose the file and line parameters that only fed the removed allocator tracking. Where file and line are printed (Router2 diagnostics, the CCRakNetUDT CapMinSnd debug print, the Autopatcher PostgreSQL error strings and the SQLiteClientLogger rakSqlLog/rakFnLog macros) callers now pass __FILE__, __LINE__ explicitly. The remaining uses were in comments. Remove _FILE_AND_LINE_ from defines.h together with the unused memory pool page sizes BUFFERED_PACKETS_PAGE_SIZE and INTERNAL_PACKET_PAGE_SIZE, and the commented-out Native Client ProcessChromePacket.
On Linux the deleted ds_* headers were the only source of <cstring> for the _findfirst emulation and UDPForwarder. List _FILE_AND_LINE_ and the memory pool page sizes in the removed-API section of the memory management guide.
…eference The deleted data-structures page was their only API reference. Move them to a new api/utilities page and list every remaining container helper in the system overview.
Fail the build when a removed container, allocator macro, alloca, RakNetSmartPtr, _FILE_AND_LINE_ or MAX_UNSIGNED_LONG reappears in Source, Tests, Samples, DependentExtensions or Benchmarks. The InternalPacket::NORMAL comment named rakMalloc; it now says std::malloc, which is what the code uses.
Add docs/advanced/migrating-to-std-containers.rst: the container and allocator mappings, every removed header, macro and type, the changed public signatures by subsystem, the non-copyable types, the behaviour changes and the Windows CRT/toolset rule. Add an Unreleased (breaking) section to the changelog and README.
…n guide Cover Lobby2 (Lobby2Client ignore list, Lobby2Server SendMsg/HasAdminAddress/HasRankingAddress/SendRemoteLoginNotification, PGSQL helpers, Steam, RoomsContainer/RoomTypes/RoomsPlugin), RPC3, SQLite3Plugin, Autopatcher and PostgreSQLInterface from the full header diff. Note that public headers no longer include <cstring>, <new> and friends transitively. Complete the changelog and README fix lists.
GCC 13/14 on arm64 never releases stack-use-after-return fake frames, so after ~16k calls per thread every instrumented call scans a full size class. The network thread then falls behind and Rm3ReceiveThread.ConnectionsAreServedInParallelWhileReplicasComeAndGo times out under ASan. x86-64 GCC and Clang are unaffected.
FileList::Deserialize left isAReference and the length fields uninitialised; UBSan flagged the copy of an invalid bool.
The self check compared the sender with ca->recipient before it was assigned, so it was always false: the same ConnectionAttempt went into the sender's list twice and OnClosedConnection freed it once, leaving a dangling entry. Compare the looked-up recipient instead and answer ID_NAT_TARGET_NOT_CONNECTED.
A zero-entry row is 8 bytes on the wire but one Cell per column in memory, so within the existing 10000-column and 100000-row caps under 1 MB of input could demand about 1e9 allocations. DeserializeTable now rejects a row count the unread bits cannot hold and a table above 1e6 cells, before building any row.
A one-byte ID_RPC_PLUGIN packet read data[1] past the end, and an unknown sub-identifier hit RakAssert(ID_RPC4_RETURN) and was then stored as a pending blocking call's return value. Both are now dropped.
…gths Cell::ToString built a STRING cell's RakString through the printf-style constructor, so peer-supplied text such as %n was interpreted as a format; it is now assigned verbatim. OwnedLength clamps the double before converting it to size_t (undefined for infinity or values past the range), and SetByType treats a binary length that is not a valid int as a zero-length blob instead of casting it.
ping * (usedForwardingEntries + 1) multiplied two relay-supplied 16-bit figures in int: signed overflow, and a wrapped weight could make the busiest relay look like the best one.
…ting A connected remote could send a truncated connection accept and hit RakAssert(0), aborting a Debug build. The message is now dropped.
…serting
OnStatusUpdateToNewHost, OnRequestAnyTeam and OnRequestSpecificTeam hit RakAssert("Too many members asking for teams!") when no team had room, which a remote member can cause; a Debug build aborted. The request is now dropped.
…elative GetSocketsReturnsBoundSockets owns its peer through InstancePtr so an early ASSERT return still destroys it; AcquireAfterExhaustionAllocates compares the live count with its starting value; TcpOutgoingBufferTests includes <algorithm> for std::min and std::equal.
GetLastError() text can be sent to clients. _RETAIL builds used to blank the file and line through _FILE_AND_LINE_; since that macro is gone they carried the server's build paths. The file and line are dropped from these messages.
…eeds Remove RakPeer's unused incomingQueueMutex (a leftover of the pre-LockedQueue incoming queue) and point the bufferedCommands comment at RunUpdateCycle; delete socket_layer.h's commented-out SendTo declarations that still took file/line; group udp_forwarder.h's standard includes. http_connection2, telnet_transport and udp_forwarder included <cassert> only for RakAssert, which defines.h expands to assert(); they now include mafianet/assert.h, the header that provides it.
…t quirk min and max are now value-initialised before DeserializeSingleRange fills them. A characterization test pins the merge quirk kept from DataStructures::RangeList (one past a middle range starts a new adjacent range), which must not change because it shapes the ACK/NAK bytes.
RemoveFromThreadPool called CallPatchCompleteCallback while holding LockInput. ThreadPool's queue mutexes are std::mutex now, not a recursive CRITICAL_SECTION as on Windows before, so a notifier that queued more work deadlocked. The aborted requests are counted under the lock and reported after it is released.
ThreadPool's mutexes are not recursive; Lobby2 binary buffers are std::malloc/std::free owned; the network-input list names RPC4, RakPeer and TeamBalancer as they now behave; TableSerializer limits, verbatim Table string cells, the NAT self-punch answer and Router2's 64-bit weight; Autopatcher error strings no longer carry file and line.
Segfaultd
force-pushed
the
refactor/modern-memory-6-delete-ds
branch
from
November 16, 2026 13:58
4624462 to
eab97b6
Compare
Segfaultd
force-pushed
the
refactor/modern-memory-5-table-extensions
branch
from
November 16, 2026 13:58
b4a5c4e to
d44d4d3
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ds_*header, theDataStructuresnamespace and_FILE_AND_LINE_. What remains as helpers inMafiaNet:::vector_util.h,instance_ptr.h,locked_queue.h,object_pool.h,range_list.h,table.h.DataStructures::,ds_*.h,rakMalloc/rakFree,OP_NEW/OP_DELETE,memory_override.h,alloca(,RakNetSmartPtr,_FILE_AND_LINE_orMAX_UNSIGNED_LONGreappear.docs/advanced/migrating-to-std-containers.rst), utilities API docs, and unreleased-breaking entries in the changelog and README./W4 /WX: removes 11size_tnarrowing warnings that would break that build.ID_RPC_PLUGINpacket is dropped instead of over-read and asserted on.ID_CONNECTION_REQUEST_ACCEPTEDand full TeamBalancer teams are dropped instead of asserting.splitMessageProgressIntervaland theFileListNodefields.Breaking
See
docs/advanced/migrating-to-std-containers.rst.Test plan
asanpreset 1015/1015,tsanpreset 1015/1015, FuzzCorpus 6/6 (the four extra Debug tests are only built with samples)detect_leaks=1): no leaksFollow-ups (pre-existing, not fixed here)
Router2::OnReceivereadsdata[1]without a length checkAutopatcherPostgreRepository.cpp:1013puts a server path into a string that can reach clientsdetect_leaks=1in the CI ASan jobCommits
Stack, merge in order: 1/6 safety net, 2/6 allocator, 3/6 core transport, 4/6 plugins, 5/6 Table + extensions, 6/6 delete DataStructures. Each PR targets the branch of the one before it. Breaking change for the next major version; no version bump yet.