| bug | <ul><li>"A global-buffer-overflow error in BufferQueueTest.cpp line 126\n | | | \r\n | :--- | :--- | \r\n | _F´ Version_ | 1.5 | \r\n | _Affected Component_ | Os/Pthreads | \r\n---\r\n## Problem Description\r\n\r\nA global-buffer-overflow error in BufferQueueTest.cpp line 126\r\n\r\n``\r\nzyh@virtual:~/fprime$ ./build-fprime-automatic-native-ut/bin/Linux/Os_pthreads\r\nCreating queue.\r\nTest empty queue...\r\nPassed.\r\nTest full queue...\r\nPushing 0.\r\nPushing 1.\r\nPushing 2.\r\nPushing 3.\r\nPushing 4.\r\nPassed.\r\nTest weird size...\r\nPassed.\r\nTest pop...\r\nPopping 5.\r\nPopping 4.\r\nPopping 3.\r\nPopping 2.\r\nPopping 1.\r\nPassed.\r\nTest priorities...\r\nPushing 'hello' at priority 9.\r\nPushing 'how are you' at priority 4.\r\nPushing 'pretty good' at priority 100.\r\nPushing 'cosmic bro' at priority 4.\r\nPushing 'kthxbye' at priority 9.\r\nPopped 'pretty good' at priority 100. Expected 'pretty good' at priority 100.\r\nPopped 'hello' at priority 9. Expected 'hello' at priority 9.\r\n=================================================================\r\n==17078==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000550bc6 at pc 0x0000004b3f6b bp 0x7ffd804c4c90 sp 0x7ffd804c4440\r\nREAD of size 8 at 0x000000550bc6 thread T0\r\n #0 0x4b3f6a in __interceptor_memcmp.part.283 (/home/zyh/fprime/build-fprime-automatic-native-ut/bin/Linux/Os_pthreads+0x4b3f6a)\r\n #1 0x51d718 in main /home/zyh/fprime/Os/Pthreads/test/ut/BufferQueueTest.cpp:126:5\r\n #2 0x7f976cdadbf6 in __libc_start_main /build/glibc-S9d2JN/glibc-2.27/csu/../csu/libc-start.c:310\r\n #3 0x41ab89 in _start (/home/zyh/fprime/build-fprime-automatic-native-ut/bin/Linux/Os_pthreads+0x41ab89)\r\n\r\n0x000000550bc6 is located 58 bytes to the left of global variable '<string literal>' defined in '/home/zyh/fprime/Os/Pthreads/test/ut/BufferQueueTest.cpp:98:43' (0x550c00) of size 12\r\n '<string literal>' is ascii string 'how are you'\r\n0x000000550bc6 is located 0 bytes to the right of global variable '<string literal>' defined in '/home/zyh/fprime/Os/Pthreads/test/ut/BufferQueueTest.cpp:98:34' (0x550bc0) of size 6\r\n '<string literal>' is ascii string 'hello'\r\nSUMMARY: AddressSanitizer: global-buffer-overflow (/home/zyh/fprime/build-fprime-automatic-native-ut/bin/Linux/Os_pthreads+0x4b3f6a) in __interceptor_memcmp.part.283\r\nShadow bytes around the buggy address:\r\n 0x0000800a2120: f9 f9 f9 f9 00 00 00 00 00 00 00 01 f9 f9 f9 f9\r\n 0x0000800a2130: 00 00 05 f9 f9 f9 f9 f9 00 01 f9 f9 f9 f9 f9 f9\r\n 0x0000800a2140: 00 00 04 f9 f9 f9 f9 f9 00 05 f9 f9 f9 f9 f9 f9\r\n 0x0000800a2150: 00 00 04 f9 f9 f9 f9 f9 00 05 f9 f9 f9 f9 f9 f9\r\n 0x0000800a2160: 00 05 f9 f9 f9 f9 f9 f9 00 00 04 f9 f9 f9 f9 f9\r\n=>0x0000800a2170: 00 00 04 f9 f9 f9 f9 f9[06]f9 f9 f9 f9 f9 f9 f9\r\n 0x0000800a2180: 00 04 f9 f9 f9 f9 f9 f9 00 04 f9 f9 f9 f9 f9 f9\r\n 0x0000800a2190: 00 03 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9\r\n 0x0000800a21a0: 00 00 00 06 f9 f9 f9 f9 00 00 04 f9 f9 f9 f9 f9\r\n 0x0000800a21b0: 00 00 00 00 00 00 00 03 f9 f9 f9 f9 00 04 f9 f9\r\n 0x0000800a21c0: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00\r\nShadow byte legend (one shadow byte represents 8 application bytes):\r\n Addressable: 00\r\n Partially addressable: 01 02 03 04 05 06 07 \r\n Heap left redzone: fa\r\n Freed heap region: fd\r\n Stack left redzone: f1\r\n Stack mid redzone: f2\r\n Stack right redzone: f3\r\n Stack after return: f5\r\n Stack use after scope: f8\r\n Global redzone: f9\r\n Global init order: f6\r\n Poisoned by user: f7\r\n Container overflow: fc\r\n Array cookie: ac\r\n Intra object redzone: bb\r\n ASan internal: fe\r\n Left alloca redzone: ca\r\n Right alloca redzone: cb\r\n==17078==ABORTING\r\n``\r\n\r\n## How to Reproduce\r\n\r\n1. Compile unit test with ASAN\r\n2. Run build-fprime-automatic-native-ut/bin/Linux/Os_pthreads\r\n3. Program abort\r\n\r\n## Expected Behavior\r\n\r\nRun normally with ASAN.\r\n"</li><li>'toString doesn\'t display the last item in a struct\n | | | \r\n | :--- | :--- | \r\n | F` version v3.1.1 | | \r\n | **** | | \r\n---\r\n## Problem Description\r\n\r\nFiles generated by fpp tools doesn\'t produce the format string correctly and so the last member of a string doesn\'t show up as expected. For example \r\n\r\nThe take the following struct defined in fpp:\r\n``fpp\r\n enum CMD_STATUS : U16 {\r\n NA = 0,\r\n ACK = 0x5,\r\n NOT_ACK = 0x6,\r\n BUSY = 0x7,\r\n NCE = 0x8,\r\n STACK_FULL = 0x9,\r\n TEMP_NOT_ACC = 0x10\r\n };\r\n\r\n constant ESUP_HEADER_ID = 0x50555345\r\n\r\n# NOTE that in byte form it will be represented with LE\r\n struct EsupPacketHeader {\r\n HeaderId: U32\r\n ModuleId: U16\r\n DataLength: U16\r\n CmdStatus: CMD_STATUS\r\n } default {HeaderId = ESUP_HEADER_ID, CmdStatus=CMD_STATUS.NA}\r\n\r\n\r\n struct EsupStatusGet {\r\n Header: EsupPacketHeader\r\n CmdId: EsupCmdId\r\n TypeId: U16\r\n SystemState: U8 @< 1,2,3,4 (1 byte unsigned char value)\r\n StatusFlags: U8 @< 1 byte unsigned char value\r\n Reserved: U16 @< 2 byte unsigned short value\r\n CpuTemperature: F32 @< -40 to 125 °C (4 byte float value)\r\n FirmwareVersion: U32 @< firmware version (4 byte unsigned int value)\r\n } default {CmdId = EsupCmdId.ConfGet, TypeId = EsupCmdType.StatusRep}\r\n\r\n`\r\n\r\nI then go to print out the contents like so:\r\n\r\n`cpp\r\nstatic bool receiveEsupStatusResponse(int serialPort, EsupCmdId cmdId, boost::span<BYTE, GET_PADDED_SIZE(EsupStatusGet::SERIALIZED_SIZE)> txBuff) {\r\n // Wait for a reply\r\n EsupStatusGet cmdResult;\r\n\r\n size_t bytesRead = read(serialPort, txBuff.data(), txBuff.size());\r\n if (bytesRead > 0) {\r\n FW_CHECK(bytesRead <= txBuff.size(), "Error deserializing response", return false; );\r\n LE_ExternalDeSerializeBuffer responseBuff(txBuff.data(), bytesRead);\r\n cmdResult.deserialize(responseBuff);\r\n Fw::String ackString;\r\n cmdResult.toString(ackString);\r\n std::cout << std::string(ackString.toChar()) << std::endl;\r\n } else {\r\n std::cout << "No reply received." << std::endl;\r\n }\r\n\r\n return true;\r\n }\r\n`\r\n\r\nI get the following:\r\n\r\n`bash\r\n(Header = (HeaderId = 1347769157, ModuleId = 8203, DataLength = 0, CmdStatus = ), CmdId = ConfGet, TypeId = 0, SystemState = 162, StatusFlags = 187, Reserved = 53517, CpuTemperature = 0, FirmwareVersion = )\r\n`\r\n\r\nWhere I would normally expect to see something like this (the actual values don\'t matter for these purposes just that there is something to print):\r\n\r\n`bash\r\n(Header = (HeaderId = 1347769157, ModuleId = 8203, DataLength = 0, CmdStatus = ACK ), CmdId = ConfGet, TypeId = 0, SystemState = 162, StatusFlags = 187, Reserved = 53517, CpuTemperature = 0, FirmwareVersion = 102444)\r\n`\r\n\r\nI\'ve found this is consistent across pretty much all the fpp serializable objects and it really comes down to the last member of the struct doesn\'t have a format string generated along with it\r\n\r\nSo for example we see with the header type the following gets generated:\r\n\r\n`c++\r\nvoid EsupPacketHeader::toString(Fw::StringBase& text) const {\r\n\r\n static const char * formatString =\r\n "("\r\n "HeaderId = %u, "\r\n "ModuleId = %u, "\r\n "DataLength = %u, "\r\n "CmdStatus = "\r\n ")";\r\n\r\n // declare strings to hold any serializable toString() arguments\r\n\r\n\r\n Fw::String CmdStatusStr;\r\n this->m_CmdStatus.toString(CmdStatusStr);\r\n\r\n char outputString[FW_SERIALIZABLE_TO_STRING_BUFFER_SIZE];\r\n (void)snprintf(outputString,FW_SERIALIZABLE_TO_STRING_BUFFER_SIZE,formatString\r\n ,this->m_HeaderId\r\n ,this->m_ModuleId\r\n ,this->m_DataLength\r\n ,CmdStatusStr.toChar()\r\n );\r\n outputString[FW_SERIALIZABLE_TO_STRING_BUFFER_SIZE-1] = 0; // NULL terminate\r\n\r\n text = outputString;\r\n}\r\n`\r\n\r\nWith the CmdStatus missing the "`%s`".\r\n\r\nI\'m not really sure what the source of the error is since the xml seems to be fine:\r\n\r\n`xml\r\n<serializable namespace="FlightComputer" name="EsupPacketHeader">\r\n <import_enum_type>FlightComputer/TransmitterInterface/CMD_STATUSEnumAi.xml</import_enum_type>\r\n <members>\r\n <member name="HeaderId" type="U32" format="%u">\r\n <default>1347769157</default>\r\n </member>\r\n <member name="ModuleId" type="U16" format="%u">\r\n <default>0</default>\r\n </member>\r\n <member name="DataLength" type="U16" format="%u">\r\n <default>0</default>\r\n </member>\r\n <member name="CmdStatus" type="FlightComputer::CMD_STATUS" format="%s">\r\n <default>FlightComputer::CMD_STATUS::NA</default>\r\n </member>\r\n </members>\r\n</serializable>\r\n``\r\nI took a look in arraycpp.py and arraycpp.tmpl but couldn\'t make sense of the issue there.\r\n\r\nIf I can get some help on this that\'d be much appreciated.'</li><li>'Single quote in project parent folder causes installation errors\n | | | \r\n | :--- | :--- | \r\n | _F´ Version_ | v3.4.3 | \r\n | _Affected Component_ | Installation/Project Setup | \r\n---\r\n## Problem Description\r\n\r\nIf you name the parent directory of your project such that it has a single quote in it, you\'ll run into an error when you try to run \'fprime-util generate\' during basic project setup. \r\n\r\n## Context / Environment\r\n\r\n``\r\nOperating System: Linux\r\nCPU Architecture: x86_64\r\nPlatform: Linux-5.15.133.1-microsoft-standard-WSL2-x86_64-with-glibc2.35\r\nPython version: 3.10.12\r\nCMake version: 3.22.1\r\nPip version: 24.0\r\nPip packages:\r\n fprime-tools==3.4.4\r\n fprime-gds==3.4.3\r\n fprime-fpp-*==2.1.0a3\r\n``\r\n\r\n## How to Reproduce\r\n\r\n1. Create a parent directory containing a single quote (For instance, "F\'")\r\n2. Follow the basic project setup guide located here: https://fprime-community.github.io/fprime-tutorial-hello-world/docs/NewProject.html \r\n3. Once you hit \'fprime-util generate\', you should soon see an error about an unterminated quote from one of the fprime dependencies. \r\n\r\n## Expected Behavior\r\n\r\nIdeally, you\'d have a project set up properly in your virtual environment.\r\n'</li></ul> |
| non-bug | <ul><li>"Install Upgraded PIP in new Project\n | | | \r\n | :--- | :--- | \r\n | _F´ Version_ | | \r\n | _Affected Component_ | | \r\n---\r\n## Feature Description\r\n\r\nOlder versions of PIP may pull in non-native tools package. We should upgrade PIP during the new project setup. Note: users who don't want this can still decline venv setup entirely."</li><li>'fprime-gds: default file downlink directory can overwrite files\n | | | \r\n | :--- | :--- | \r\n | _F´ Version_ | v3.4.3 | \r\n | _Affected Component_ | n/a | \r\n---\r\n## Feature Description\r\n\r\nHave GDS created a time-tag directory for file downlinks.\r\n\r\nMake the default be logs/<time tag>/fprime-downlink to match telemetry and events.\r\n\r\nAlso, make a separate argument for uplink and downlink. It makes sense to automatically separate downlinked files, but uplink may wish to be in a common store.\r\n\r\n## Rationale\r\n\r\nThe default /tmp/username (or even overridden with --file-storage-directory) directory for file downlinks can cause new instances to overwrite older files, or cause parallel instances to clobber each other.\r\n'</li><li>'Update FileDownlink to report file progress\n | | | \r\n | :--- | :--- | \r\n | _F´ Version_ | v3.4.3 | \r\n | _Affected Component_ | Svc/FileDownlink | \r\n---\r\n## Feature Description\r\n\r\nSvc/FileDownlink currently only reports completion status back to the sender only when the file is complete. This will make re-transmitting data products inefficient since the Data Catalog has no idea how far partial transmits made it before the link dropped or the system was powered down. \r\n\r\nThis feature would report partial progress back to DP Catalog can restart transmits.\r\n\r\n## Rationale\r\n\r\nMake data product downlink management more efficient.\r\n'</li></ul> |