TODO 144 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831
  1. NuttX TODO List (Last updated April 29, 2019)
  2. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  3. This file summarizes known NuttX bugs, limitations, inconsistencies with
  4. standards, things that could be improved, and ideas for enhancements. This
  5. TODO list does not include issues associated with individual board ports. See
  6. also the individual README.txt files in the configs/ sub-directories for
  7. issues related to each board port.
  8. nuttx/:
  9. (16) Task/Scheduler (sched/)
  10. (5) SMP
  11. (1) Memory Management (mm/)
  12. (0) Power Management (drivers/pm)
  13. (5) Signals (sched/signal, arch/)
  14. (2) pthreads (sched/pthread, libs/libc/pthread)
  15. (0) Message Queues (sched/mqueue)
  16. (9) Kernel/Protected Build
  17. (3) C++ Support
  18. (5) Binary loaders (binfmt/)
  19. (18) Network (net/, drivers/net)
  20. (4) USB (drivers/usbdev, drivers/usbhost)
  21. (2) Other drivers (drivers/)
  22. (9) Libraries (libs/libc/, libs/libm/)
  23. (12) File system/Generic drivers (fs/, drivers/)
  24. (10) Graphics Subsystem (graphics/)
  25. (1) Build system / Toolchains
  26. (3) Linux/Cywgin simulation (arch/sim)
  27. (5) ARM (arch/arm/)
  28. apps/ and other Add-Ons:
  29. (1) Network Utilities (apps/netutils/)
  30. (1) NuttShell (NSH) (apps/nshlib)
  31. (1) System libraries apps/system (apps/system)
  32. (1) Modbus (apps/modbus)
  33. (1) Pascal add-on (pcode/)
  34. (4) Other Applications & Tests (apps/examples/)
  35. o Task/Scheduler (sched/)
  36. ^^^^^^^^^^^^^^^^^^^^^^^
  37. Title: CHILD PTHREAD TERMINATION
  38. Description: When a tasks exits, shouldn't all of its child pthreads also be
  39. terminated?
  40. This behavior was implemented as an options controlled by the
  41. configuration setting CONFIG_SCHED_EXIT_KILL_CHILDREN. This
  42. option must be used with caution, however. It should not be
  43. used unless you are certain of what you are doing. Uninformed
  44. of this option can often lead to memory leaks since, for
  45. example, memory allocations held by threads are not
  46. automatically freed!
  47. Status: Closed. No, this behavior will not be implemented unless
  48. specifically selected.
  49. Priority: Medium, required for good emulation of process/pthread model.
  50. The current behavior allows for the main thread of a task to
  51. exit() and any child pthreads will persist. That does raise
  52. some issues: The main thread is treated much like just-another-
  53. pthread but must follow the semantics of a task or a process.
  54. That results in some inconsistencies (for example, with robust
  55. mutexes, what should happen if the main thread exits while
  56. holding a mutex?)
  57. Title: pause() NON-COMPLIANCE
  58. Description: In the POSIX description of this function the pause() function
  59. must suspend the calling thread until delivery of a signal whose
  60. action is either to execute a signal-catching function or to
  61. terminate the process. The current implementation only waits for
  62. any non-blocked signal to be received. It should only wake up if
  63. the signal is delivered to a handler.
  64. Status: Open.
  65. Priority: Medium Low.
  66. Title: ON-DEMAND PAGING INCOMPLETE
  67. Description: On-demand paging has recently been incorporated into the RTOS.
  68. The design of this feature is described here:
  69. http://www.nuttx.org/NuttXDemandPaging.html.
  70. As of this writing, the basic feature implementation is
  71. complete and much of the logic has been verified. The test
  72. harness for the feature exists only for the NXP LPC3131 (see
  73. configs/ea3131/pgnsh and locked directories). There are
  74. some limitations of this testing so I still cannot say that
  75. the feature is fully functional.
  76. Status: Open. This has been put on the shelf for some time.
  77. Priority: Medium-Low
  78. Title: GET_ENVIRON_PTR()
  79. Description: get_environ_ptr() (sched/sched_getenvironptr.c) is not implemented.
  80. The representation of the environment strings selected for
  81. NuttX is not compatible with the operation. Some significant
  82. re-design would be required to implement this function and that
  83. effort is thought to be not worth the result.
  84. Status: Open. No change is planned.
  85. Priority: Low -- There is no plan to implement this.
  86. Title: TIMER_GETOVERRUN()
  87. Description: timer_getoverrun() (sched/timer_getoverrun.c) is not implemented.
  88. Status: Open
  89. Priority: Low -- There is no plan to implement this.
  90. Title: INCOMPATIBILITIES WITH execv() AND execl()
  91. Description: Simplified 'execl()' and 'execv()' functions are provided by
  92. NuttX. NuttX does not support processes and hence the concept
  93. of overlaying a tasks process image with a new process image
  94. does not make any sense. In NuttX, these functions are
  95. wrapper functions that:
  96. 1. Call the non-standard binfmt function 'exec', and then
  97. 2. exit(0).
  98. As a result, the current implementations of 'execl()' and
  99. 'execv()' suffer from some incompatibilities, the most
  100. serious of these is that the exec'ed task will not have
  101. the same task ID as the vfork'ed function. So the parent
  102. function cannot know the ID of the exec'ed task.
  103. Status: Open
  104. Priority: Medium Low for now
  105. Title: ISSUES WITH atexit(), on_exit(), AND pthread_cleanup_pop()
  106. Description: These functions execute with the following bad properties:
  107. 1. They run with interrupts disabled,
  108. 2. They run in supervisor mode (if applicable), and
  109. 3. They do not obey any setup of PIC or address
  110. environments. Do they need to?
  111. 4. In the case of task_delete() and pthread_cancel() without
  112. deferred cancellation, these callbacks will run on the
  113. thread of execution and address context of the caller of
  114. task_delete() or pthread_cancel(). That is very bad!
  115. The fix for all of these issues it to have the callbacks
  116. run on the caller's thread as is currently done with
  117. signal handlers. Signals are delivered differently in
  118. PROTECTED and KERNEL modes: The delivery involves a
  119. signal handling trampoline function in the user address
  120. space and two signal handlers: One to call the signal
  121. handler trampoline in user mode (SYS_signal_handler) and
  122. on in with the signal handler trampoline to return to
  123. supervisor mode (SYS_signal_handler_return)
  124. The primary difference is in the location of the signal
  125. handling trampoline:
  126. - In PROTECTED mode, there is on a single user space blob
  127. with a header at the beginning of the block (at a well-
  128. known location. There is a pointer to the signal handler
  129. trampoline function in that header.
  130. - In the KERNEL mode, a special process signal handler
  131. trampoline is used at a well-known location in every
  132. process address space (ARCH_DATA_RESERVE->ar_sigtramp).
  133. Status: Open
  134. Priority: Medium Low. This is an important change to some less
  135. important interfaces. For the average user, these
  136. functions are just fine the way they are.
  137. Title: execv() AND vfork()
  138. Description: There is a problem when vfork() calls execv() (or execl()) to
  139. start a new application: When the parent thread calls vfork()
  140. it receives and gets the pid of the vforked task, and *not*
  141. the pid of the desired execv'ed application.
  142. The same tasking arrangement is used by the standard function
  143. posix_spawn(). However, posix_spawn uses the non-standard, internal
  144. NuttX interface task_reparent() to replace the child's parent task
  145. with the caller of posix_spawn(). That cannot be done with vfork()
  146. because we don't know what vfork() is going to do.
  147. Any solution to this is either very difficult or impossible without
  148. an MMU.
  149. Status: Open
  150. Priority: Low (it might as well be low since it isn't going to be fixed).
  151. Title: errno IS NOT SHARED AMONG THREADS
  152. Description: In NuttX, the errno value is unique for each thread. But for
  153. bug-for-bug compatibility, the same errno should be shared by
  154. the task and each thread that it creates. It is *very* easy
  155. to make this change: Just move the pterrno field from
  156. struct tcb_s to struct task_group_s. However, I am still not
  157. sure if this should be done or not.
  158. NOTE: glibc behaves this way unless __thread is defined then,
  159. in that case, it behaves like NuttX (using TLS to save the
  160. thread local errno).
  161. Status: Closed. The existing solution is better and compatible with
  162. thread-aware GLIBC (although its incompatibilities could show
  163. up in porting some code). I will retain this issue for
  164. reference only.
  165. Priority: N/A
  166. Title: SCALABILITY
  167. Description: Task control information is retained in simple lists. This
  168. is completely appropriate for small embedded systems where
  169. the number of tasks, N, is relatively small. Most list
  170. operations are O(N). This could become an issue if N gets
  171. very large.
  172. In that case, these simple lists should be replaced with
  173. something more performant such as a balanced tree in the
  174. case of ordered lists. Fortunately, most internal lists are
  175. hidden behind simple accessor functions and so the internal
  176. data structures can be changed if need with very little impact.
  177. Explicitly reference to the list structure are hidden behind
  178. the macro this_task().
  179. Status: Open
  180. Priority: Low. Things are just the way that we want them for the way
  181. that NuttX is used today.
  182. Title: INTERNAL VERSIONS OF USER FUNCTIONS
  183. Description: The internal NuttX logic uses the same interfaces as does
  184. the application. That sometime produces a problem because
  185. there is "overloaded" functionality in those user interfaces
  186. that are not desirable.
  187. For example, having cancellation points hidden inside of the
  188. OS can cause non-cancellation point interfaces to behave
  189. strangely.
  190. Here is another issue:  Internal OS functions should not set
  191. errno and should never have to look at the errno value to
  192. determine the cause of the failure.  The errno is provided
  193. for compatibility with POSIX application interface
  194. requirements and really doesn't need to be used within the
  195. OS.
  196. Both of these could be fixed if there were special internal
  197. versions these functions.  For example, there could be a an
  198. nxsem_wait() that does all of the same things as sem_wait()
  199. was does not create a cancellation point and does not set
  200. the errno value on failures.
  201. Everything inside the OS would use nx_sem_wait().
  202. Applications would call sem_wait() which would just be a
  203. wrapper around nx_sem_wait() that adds the cancellation point
  204. and that sets the errno value on failures.
  205. On particularly difficult issue is the use of common memory
  206. manager C, and NX libraries in the build. For the PROTECTED
  207. and KERNEL builds, this issue is resolved. In that case,
  208. The OS links with a different version of the libraries than
  209. does the application: The OS version would use the OS internal
  210. interfaces and the application would use the standard
  211. interfaces.
  212. But for the FLAT build, both the OS and the applications use
  213. the same library functions. For applications, the library
  214. functions *must* support errno's and cancellation and, hence,
  215. these are also used within the OS.
  216. But that raises yet another issue: If the application
  217. version of the libraries use the standard interfaces
  218. internally, then they may generate unexpected cancellation
  219. points. For example, the memory management would take a
  220. semaphore using sem_wait() to get exclusive access to the
  221. heap. That means that every call to malloc() and free()
  222. would be a cancellation point, a clear POSIX violation.
  223. Changes like that could clean up some of this internal
  224. craziness.
  225. UPDATE:
  226. 2017-10-03: This change has been completed for the case of
  227. semaphores used in the OS. Still need to checkout signals
  228. and messages queues that are also used in the OS. Also
  229. backed out commit b4747286b19d3b15193b2a5e8a0fe48fa0a8638c.
  230. 2017-10-06: This change has been completed for the case of
  231. signals used in the OS. Still need to checkout messages
  232. queues that are also used in the OS.
  233. 2017-10-10: This change has been completed for the case of
  234. message queue used in the OS. I am keeping this issue
  235. open because (1) there are some known remaining calls that
  236. that will modify the errno (such as dup(), dup2(),
  237. task_activate(), kthread_create(), exec(), mq_open(),
  238. mq_close(), and others) and (2) there may still be calls that
  239. create cancellation points. Need to check things like open(),
  240. close(), read(), write(), and possibly others.
  241. 2018-01-30: This change has been completed for the case of
  242. scheduler functions used within the OS: sched_getparam(),
  243. sched_setparam(), sched_getscheduler(), sched_setschedule(),
  244. and sched_setaffinity(),
  245. 2018-09-15: This change has been completed for the case of
  246. open() used within the OS. There are places under libs/ and
  247. configs/ that have not been converted. I also note cases
  248. where fopen() is called under libs/libc/netdb/.
  249. Status: Open
  250. Priority: Low. Things are working OK the way they are. But the design
  251. could be improved and made a little more efficient with this
  252. change.
  253. Task: IDLE THREAD TCB SETUP
  254. Description: There are issues with setting IDLE thread stacks:
  255. 1. One problem is stack-related data in the IDLE threads TCB.
  256. A solution might be to standardize the use of g_idle_topstack.
  257. That you could add initialization like this in nx_start:
  258. @@ -344,6 +347,11 @@ void nx_start(void)
  259. g_idleargv[1] = NULL;
  260. g_idletcb.argv = g_idleargv;
  261. + /* Set the IDLE task stack size */
  262. +
  263. + g_idletcb.cmn.adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
  264. + g_idletcb.cmn.stack_alloc_ptr = (void *)(g_idle_topstack - CONFIG_IDLETHREAD_STACKSIZE);
  265. +
  266. /* Then add the idle task's TCB to the head of the ready to run list */
  267. dq_addfirst((FAR dq_entry_t *)&g_idletcb, (FAR dq_queue_t *)&g_readytorun);
  268. The g_idle_topstack variable is available for almost all architectures:
  269. $ find . -name *.h | xargs grep g_idle_top
  270. ./arm/src/common/up_internal.h:EXTERN const uint32_t g_idle_topstack;
  271. ./avr/src/avr/avr.h:extern uint16_t g_idle_topstack;
  272. ./avr/src/avr32/avr32.h:extern uint32_t g_idle_topstack;
  273. ./hc/src/common/up_internal.h:extern uint16_t g_idle_topstack;
  274. ./mips/src/common/up_internal.h:extern uint32_t g_idle_topstack;
  275. ./misoc/src/lm32/lm32.h:extern uint32_t g_idle_topstack;
  276. ./renesas/src/common/up_internal.h:extern uint32_t g_idle_topstack;
  277. ./renesas/src/m16c/chip.h:extern uint32_t g_idle_topstack; /* Start of the heap */
  278. ./risc-v/src/common/up_internal.h:EXTERN uint32_t g_idle_topstack;
  279. ./x86/src/common/up_internal.h:extern uint32_t g_idle_topstack;
  280. That omits these architectures: sh1, sim, xtensa, z16, z80,
  281. ez80, and z8. All would have to support this common
  282. global variable.
  283. Also, the stack itself may be 8-, 16-, or 32-bits wide,
  284. depending upon the architecture and do have differing
  285. alignment requirements.
  286. 2. Another problem is colorizing that stack to use with
  287. stack usage monitoring logic. There is logic in some
  288. start functions to do this in a function called go_nx_start.
  289. It is available in these architectures:
  290. ./arm/src/efm32/efm32_start.c:static void go_nx_start(void *pv, unsigned int nbytes)
  291. ./arm/src/kinetis/kinetis_start.c:static void go_nx_start(void *pv, unsigned int nbytes)
  292. ./arm/src/sam34/sam_start.c:static void go_nx_start(void *pv, unsigned int nbytes)
  293. ./arm/src/samv7/sam_start.c:static void go_nx_start(void *pv, unsigned int nbytes)
  294. ./arm/src/stm32/stm32_start.c:static void go_nx_start(void *pv, unsigned int nbytes)
  295. ./arm/src/stm32f7/stm32_start.c:static void go_nx_start(void *pv, unsigned int nbytes)
  296. ./arm/src/stm32l4/stm32l4_start.c:static void go_nx_start(void *pv, unsigned int nbytes)
  297. ./arm/src/tms570/tms570_boot.c:static void go_nx_start(void *pv, unsigned int nbytes)
  298. ./arm/src/xmc4/xmc4_start.c:static void go_nx_start(void *pv, unsigned int nbytes)
  299. But no others.
  300. Status: Open
  301. Priority: Low, only needed for more complete debug.
  302. Title: PRIORITY INHERITANCE WITH SPORADIC SCHEDULER
  303. Description: The sporadic scheduler manages CPU utilization by a task by
  304. alternating between a high and a low priority. In either
  305. state, it may have its priority boosted. However, under
  306. some circumstances, it is impossible in the current design to
  307. switch to the correct priority if a semaphore held by the
  308. sporadic thread is participating in priority inheritance:
  309. There is an issue when switching from the high to the low
  310. priority state. If the priority was NOT boosted above the
  311. higher priority, it still may still need to boosted with
  312. respect to the lower priority. If the highest priority
  313. thread waiting on a semaphore held by the sporadic thread is
  314. higher in priority than the low priority but less than the
  315. higher priority, then new thread priority should be set to
  316. that middle priority, not to the lower priority.
  317. In order to do this we would need to know the highest
  318. priority from among all tasks waiting for the all semaphores
  319. held by the sporadic task. That information could be
  320. retained by the priority inheritance logic for use by the
  321. sporadic scheduler. The boost priority could be retained in
  322. a new field of the TCB (say, pend_priority). That
  323. pend_priority could then be used when switching from the
  324. higher to the lower priority.
  325. Status: Open
  326. Priority: Low. Does anyone actually use the sporadic scheduler?
  327. Title: SIMPLIFY SPORADIC SCHEDULER DESIGN
  328. Description: I have been planning to re-implement sporadic scheduling for
  329. some time. I believe that the current implementation is
  330. unnecessarily complex. There is no clear statement for the
  331. requirements of sporadic scheduling that I could find, so I
  332. based the design on some behaviors of another OS that I saw
  333. published (QNX as I recall).
  334. But I think that the bottom line requirement for sporadic
  335. scheduling is that is it should make a best attempt to
  336. control a fixed percentage of CPU bandwidth for a task in
  337. during an interval only by modifying it is priority between
  338. a low and a high priority. The current design involves
  339. several timers: A "budget" timer plus a variable number of
  340. "replenishment" timers and a lot of nonsense to duplicate QNX
  341. behavior that I think I not necessary.
  342. It think that the sporadic scheduler could be re-implemented
  343. with only the single "budget" timer. Instead of starting a
  344. new "replenishment" timer when the task is resumed, that
  345. single timer could just be extended.
  346. Status: Open
  347. Priority: Low. This is an enhancement. And does anyone actually use
  348. the sporadic scheduler?
  349. Title: REMOVE NESTED CANCELLATION POINT SUPPORT
  350. Description: The current implementation support nested cancellation points.
  351. The TCB field cpcount keeps track of that nesting level.
  352. However, cancellation points should not be calling other
  353. cancellation points so this design could be simplified by
  354. removing all support for nested cancellation points.
  355. Status: Open
  356. Priority: Low. No harm is being done by the current implementation.
  357. This change is primarily for aesthetic reasons. If would
  358. reduce memory usage by a very small but probably
  359. insignificant amount.
  360. Title: DAEMONIZE ELF PROGRAM
  361. Description: It is a common practice to "daemonize" to detach a task from
  362. its parent. This is used with NSH, for example, so that NSH
  363. will not stall, waiting in waitpid() for the child task to
  364. exit.
  365. Daemonization is done to creating a new task which continues
  366. to run while the original task exits (sending the SIGCHLD
  367. signal to the parent and awakening waitpid()). In a pure
  368. POSIX system, this is down with fork(), perhaps like:
  369. if (fork() != 0)
  370. {
  371. exit();
  372. }
  373. but is usually done with task_create() in NuttX. But when
  374. task_create() is called from within an ELF program, a very
  375. perverse situation is created:
  376. The basic problem involves address environments and task groups:
  377. "Task groups" are emulations of Linux processes. For the
  378. case of the FLAT, ELF module, the address environment is
  379. allocated memory that contains the ELF module.
  380. When you call task_create() from the ELF program, you now
  381. have two task groups running in the same address environment.
  382. That is a perverse situation for which there is no standard
  383. solution. There is nothing comparable to that. Even in
  384. Linux, fork() creates another address environment (although
  385. it is an exact copy of the original).
  386. When the ELF program was created, the function exec() in
  387. binfmt/binfmt_exec.c runs. It sets up a call back that will
  388. be invoked when the ELF program exits.
  389. When ELF program exits, the address environment is destroyed
  390. and the other task running in the same address environment is
  391. then running in stale memory and will eventually crash.
  392. Nothing special happens when the other created task running
  393. in the allocated address environment exits since has no such
  394. call backs.
  395. In order to make this work you would need logic like:
  396. 1. When the ELF task calls task_create(), it would need to:
  397. a. Detect that task_create() was called from an ELF program,
  398. b. increment a reference count on the address environment, and
  399. c. Set up the same exit hook for the newly created task.
  400. 2. Then when either the ELF program task or the created task
  401. in the same address environment exits, it would decrement
  402. the reference count. When the last task exits, the reference
  403. count would go to zero and the address environement could be
  404. destroyed.
  405. This is complex work and would take some effort and probably
  406. requires redesign of existing code and interfaces to get a
  407. proper, clean, modular solution.
  408. Status: Open
  409. Priority: Medium-Low. A simple work-arounds when using NSH is to use
  410. the '&' postfix to put the started ELF program into background.
  411. o SMP
  412. ^^^
  413. Title: SMP AND DATA CACHES
  414. Description: When spinlocks, semaphores, etc. are used in an SMP system with
  415. a data cache, then there may be problems with cache coherency
  416. in some CPU architectures: When one CPU modifies the shared
  417. object, the changes may not be visible to another CPU if it
  418. does not share the data cache. That would cause failure in
  419. the IPC logic.
  420. Flushing the D-cache on writes and invalidating before a read is
  421. not really an option. That would essentially effect every memory
  422. access and there may be side-effects due to cache line sizes
  423. and alignment.
  424. For the same reason a separate, non-cacheable memory region is
  425. not an option. Essentially all data would have to go in the
  426. non-cached region and you would have no benefit from the data
  427. cache.
  428. On ARM Cortex-A, each CPU has a separate data cache. However,
  429. the MPCore's Snoop Controller Unit supports coherency among
  430. the different caches. The SCU is enabled by the SCU control
  431. register and each CPU participates in the SMP coherency by
  432. setting the ACTLR_SMP bit in the auxiliary control register
  433. (ACTLR).
  434. Status: Closed
  435. Priority: High on platforms that may have the issue.
  436. Title: MISUSE OF sched_lock() IN SMP MODE
  437. Description: The OS API sched_lock() disables pre-emption and locks a
  438. task in place. In the single CPU case, it is also often
  439. used to enforce a simple critical section since not other
  440. task can run while pre-emption is locked.
  441. This, however, does not generalize to the SMP case. In the
  442. SMP case, there are multiple tasks running on multiple CPUs.
  443. The basic behavior is still correct: The task that has
  444. locked pre-emption will not be suspended. However, there
  445. is no longer any protection for use as a critical section:
  446. tasks running on other CPUs may still execute that
  447. unprotected code region.
  448. The solution is to replace the use of sched_lock() with
  449. stronger protection such as spin_lock_irqsave().
  450. Status: Open
  451. Priority: Medium for SMP system. Not critical to single CPU systems.
  452. NOTE: There are no known bugs from this potential problem.
  453. Title: CORTEX-A GIC SGI INTERRUPT MASKING
  454. Description: In the ARMv7-A GICv2 architecture, the inter-processor
  455. interrupts (SGIs) are non maskable and will occur even if
  456. interrupts are disabled. This adds a lot of complexity
  457. to the ARMV7-A critical section design.
  458. Masayuki Ishikawa has suggested the use of the GICv2 ICCMPR
  459. register to control SGI interrupts. This register (much like
  460. the ARMv7-M BASEPRI register) can be used to mask interrupts
  461. by interrupt priority. Since SGIs may be assigned priorities
  462. the ICCMPR should be able to block execution of SGIs as well.
  463. Such an implementation would be very similar to the BASEPRI
  464. (vs PRIMASK) implementation for the ARMv7-M: (1) The
  465. up_irq_save() and up_irq_restore() registers would have to
  466. set/restore the ICCMPR register, (2) register setup logic in
  467. arch/arm/src/armv7-a for task start-up and signal dispatch
  468. would have to set the ICCMPR correctly, and (3) the 'xcp'
  469. structure would have to be extended to hold the ICCMPR
  470. register; logic would have to added be save/restore the
  471. ICCMPR register in the 'xcp' structure on each interrupt and
  472. context switch.
  473. This would also be an essential part of a high priority,
  474. nested interrupt implementation (unrelated).
  475. Status: Open
  476. Priority: Low. There are no know issues with the current non-maskable
  477. SGI implementation. This change would, however, lead to
  478. simplification in the design and permit commonality with
  479. other, non-GIC implementations.
  480. Title: ISSUES WITH ACCESSING CPU INDEX
  481. Description: The CPU number is accessed usually with the macro this_cpu().
  482. The returned CPU number is then used for various things,
  483. typically as an array index. However, if pre-emption is
  484. not disabled,then it is possible that a context switch
  485. could occur and that logic could run on anothe CPU with
  486. possible fatal consequences.
  487. We need to evaluate all use of this_cpu() and assure that
  488. it is used in a way that guarantees the the code continues
  489. to execute on the same CPU.
  490. Status: Open
  491. Prioity: Medium. This is a logical problem but I have nevers seen
  492. an bugs caused by this. But I believe that failures are
  493. possible.
  494. Title: POSSIBLE FOR TWO CPUs TO HOLD A CRITICAL SECTION?
  495. Description: The SMP design includes logic that will support multiple
  496. CPUs holding a critical section. Is this necessary? How
  497. can that occur? I think it can occur in the following
  498. situation:
  499. CPU0 - Task A is running.
  500. - The CPU0 IDLE task is the only other task in the
  501. CPU0 ready-to-run list.
  502. CPU1 - Task B is running.
  503. - Task C is blocked but remains in the g_assignedtasks[]
  504. list because of a CPU affinity selection. Task C
  505. also holds the critical section which is temporarily
  506. relinquished because Task C is blocked by Task B.
  507. - The CPU1 IDLE task is at the end of the list.
  508. Actions:
  509. 1. Task A/CPU 0 takes the critical section.
  510. 2. Task B/CPU 1 suspends waiting for an event
  511. 3. Task C is restarted.
  512. Now both Task A and Task C hold the critical section.
  513. This problem has never been observed, but seems to be a
  514. possibility. I believe it could only occur if CPU affinity
  515. is used (otherwise, tasks will pend must as when pre-
  516. emption is disabled).
  517. A proper solution would probably involve re-designing how
  518. CPU affinity is implemented. The CPU1 IDLE thread should
  519. more appropriately run, but cannot because the Task C TCB
  520. is in the g_assignedtasks[] list.
  521. Status: Open
  522. Priority: Unknown. Might be high, but first we would need to confirm
  523. that this situation can occur and that is actually causes
  524. a failure.
  525. o Memory Management (mm/)
  526. ^^^^^^^^^^^^^^^^^^^^^^^
  527. Title: FREE MEMORY ON TASK EXIT
  528. Description: Add an option to free all memory allocated by a task when the
  529. task exits. This is probably not be worth the overhead for a
  530. deeply embedded system.
  531. There would be complexities with this implementation as well
  532. because often one task allocates memory and then passes the
  533. memory to another: The task that "owns" the memory may not
  534. be the same as the task that allocated the memory.
  535. Update. From the NuttX forum:
  536. ...there is a good reason why task A should never delete task B.
  537. That is because you will strand memory resources. Another feature
  538. lacking in most flat address space RTOSs is automatic memory
  539. clean-up when a task exits.
  540. That behavior just comes for free in a process-based OS like Linux:
  541. Each process has its own heap and when you tear down the process
  542. environment, you naturally destroy the heap too.
  543. But RTOSs have only a single, shared heap. I have spent some time
  544. thinking about how you could clean up memory required by a task
  545. when a task exits. It is not so simple. It is not as simple as
  546. just keeping memory allocated by a thread in a list then freeing
  547. the list of allocations when the task exists.
  548. It is not that simple because you don't know how the memory is
  549. being used. For example, if task A allocates memory that is used
  550. by task B, then when task A exits, you would not want to free that
  551. memory needed by task B. In a process-based system, you would
  552. have to explicitly map shared memory (with reference counting) in
  553. order to share memory. So the life of shared memory in that
  554. environment is easily managed.
  555. I have thought that the way that this could be solved in NuttX
  556. would be: (1) add links and reference counts to all memory allocated
  557. by a thread. This would increase the memory allocation overhead!
  558. (2) Keep the list head in the TCB, and (3) extend mmap() and munmap()
  559. to include the shared memory operations (which would only manage
  560. the reference counting and the life of the allocation).
  561. Then what about pthreads? Memory should not be freed until the last
  562. pthread in the group exists. That could be done with an additional
  563. reference count on the whole allocated memory list (just as streams
  564. and file descriptors are now shared and persist until the last
  565. pthread exits).
  566. I think that would work but to me is very unattractive and
  567. inconsistent with the NuttX "small footprint" objective. ...
  568. Other issues:
  569. - Memory free time would go up because you would have to remove
  570. the memory from that list in free().
  571. - There are special cases inside the RTOS itself. For example,
  572. if task A creates task B, then initial memory allocations for
  573. task B are created by task A. Some special allocators would
  574. be required to keep this memory on the correct list (or on
  575. no list at all).
  576. Updated 2016-06-25:
  577. For processors with an MMU (Memory Management Unit), NuttX can be
  578. built in a kernel mode. In that case, each process will have a
  579. local copy of its heap (filled with sbrk()) and when the process
  580. exits, its local heap will be destroyed and the underlying page
  581. memory is recovered.
  582. So in this case, NuttX work just link Linux or or *nix systems:
  583. All memory allocated by processes or threads in processes will
  584. be recovered when the process exits.
  585. But not for the flat memory build. In that case, the issues
  586. above do apply. There is no safe way to recover the memory in
  587. that case (and even if there were, the additional overhead would
  588. not be acceptable on most platforms).
  589. This does not prohibit anyone from creating a wrapper for malloc()
  590. and an atexit() callback that frees memory on task exit. People
  591. are free and, in fact, encouraged, to do that. However, since
  592. it is inherently unsafe, I would never incorporate anything
  593. like that into NuttX.
  594. Status: Open. No changes are planned. NOTE: This applies to the FLAT
  595. and PROTECTED builds only. There is no such leaking of memory
  596. in the KERNEL build mode.
  597. Priority: Medium/Low, a good feature to prevent memory leaks but would
  598. have negative impact on memory usage and code size.
  599. o Power Management (drivers/pm)
  600. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  601. o Signals (sched/signal, arch/)
  602. ^^^^^^^^^^^^^^^^^^^^^^^
  603. Title: STANDARD SIGNALS
  604. Description: 'Standard' signals and signal actions are not fully
  605. supported. The SIGCHLD signal is supported and, if the
  606. option CONFIG_SIG_DEFAULT=y is included, some signals will
  607. perform their default actions (dependent upon addition
  608. configuration settings):
  609. Signal Action Additional Configuration
  610. ------- -------------------- -------------------------
  611. SIGUSR1 Abnormal Termination CONFIG_SIG_SIGUSR1_ACTION
  612. SIGUSR2 Abnormal Termination CONFIG_SIG_SIGUSR2_ACTION
  613. SIGALRM Abnormal Termination CONFIG_SIG_SIGALRM_ACTION
  614. SIGPOLL Abnormal Termination CONFIG_SIG_SIGPOLL_ACTION
  615. SIGSTOP Suspend task CONFIG_SIG_SIGSTOP_ACTION
  616. SIGSTP Suspend task CONFIG_SIG_SIGSTOP_ACTION
  617. SIGCONT Resume task CONFIG_SIG_SIGSTOP_ACTION
  618. SIGINT Abnormal Termination CONFIG_SIG_SIGKILL_ACTION
  619. SIGKILL Abnormal Termination CONFIG_SIG_SIGKILL_ACTION
  620. Status: Open. No further changes are planned.
  621. Priority: Low, required by standards but not so critical for an
  622. embedded system.
  623. Title: SIGEV_THREAD
  624. Description: Implementation of support for support for SIGEV_THREAD is available
  625. only in the FLAT build mode because it uses the OS work queues to
  626. perform the callback. The alternative for the PROTECTED and KERNEL
  627. builds would be to create pthreads in the user space to perform the
  628. callbacks. That is not a very attractive solution due to performance
  629. issues. It would also require some additional logic to specify the
  630. TCB of the parent so that the pthread could be bound to the correct
  631. group.
  632. There is also some user-space logic in libs/libc/aio/lio_listio.c.
  633. That logic could use the user-space work queue for the callbacks.
  634. Status: Low, there are alternative designs. However, these features
  635. are required by the POSIX standard.
  636. Priority: Low for now
  637. Title: SIGNAL NUMBERING
  638. Description: In signal.h, the range of valid signals is listed as 0-31. However,
  639. in many interfaces, 0 is not a valid signal number. The valid
  640. signal number should be 1-32. The signal set operations would need
  641. to map bits appropriately.
  642. Status: Open
  643. Priority: Low. Even if there are only 31 usable signals, that is still a lot.
  644. Title: NO QUEUING of SIGNAL ACTIONS
  645. Description: In the architecture specific implemenation of struct xcptcontext,
  646. there are fields used by signal handling logic to pass the state
  647. information needed to dispatch signal actions to the appropriate
  648. handler.
  649. There is only one copy of this state information in the
  650. implementations of struct xcptcontext and, as a consequence,
  651. if there is a signal handler executing on a thread, then addition
  652. signal actions will be lost until that signal handler completes
  653. and releases those resources.
  654. Status: Open
  655. Priority: Low. This design flaw has been around for ages and no one has yet
  656. complained about it. Apparently the visibility of the problem is
  657. very low.
  658. Title: QUEUED SIGNAL ACTIONS ARE INAPPROPRIATELY DEFERRED
  659. Descirption: The implement of nxsig_deliver() does the followin in a loop:
  660. - It takes the next next queued signal action from a list
  661. - Calls the architecture-specific up_sigdeliver() to perform
  662. the signal action (through some sleight of hand in
  663. up_schedule_sigaction())
  664. - up_sigdeliver() is a trampoline function that performs the
  665. actual signal action as well as some housekeeping functions
  666. then
  667. - up_sigdeliver() performs a context switch back to the normal,
  668. uninterrupted thread instead of returning to nxsig_deliver().
  669. The loop in nxsig_deliver() then will have the opportunity to
  670. run until when that normal, uniterrupted thread is suspended.
  671. Then the loop will continue with the next queued signal
  672. action.
  673. Normally signals execute immediately. The is the whole reason
  674. why almost all blocking APIs return when a signal is received
  675. (with errno equal to EINTR).
  676. Status: Open
  677. Priority: Low. This design flaw has been around for ages and no one has yet
  678. complained about it. Apparently the visibility of the problem is
  679. very low.
  680. o pthreads (sched/pthreads libs/libc/pthread)
  681. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  682. Title: PTHREAD_PRIO_PROTECT
  683. Description: Extend pthread_mutexattr_setprotocol(). It should support
  684. PTHREAD_PRIO_PROTECT (and so should its non-standard counterpart
  685. sem_setproto()).
  686. "When a thread owns one or more mutexes initialized with the
  687. PTHREAD_PRIO_PROTECT protocol, it shall execute at the higher of its
  688. priority or the highest of the priority ceilings of all the mutexes
  689. owned by this thread and initialized with this attribute, regardless of
  690. whether other threads are blocked on any of these mutexes or not.
  691. "While a thread is holding a mutex which has been initialized with
  692. the PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT protocol attributes,
  693. it shall not be subject to being moved to the tail of the scheduling queue
  694. at its priority in the event that its original priority is changed,
  695. such as by a call to sched_setparam(). Likewise, when a thread unlocks
  696. a mutex that has been initialized with the PTHREAD_PRIO_INHERIT or
  697. PTHREAD_PRIO_PROTECT protocol attributes, it shall not be subject to
  698. being moved to the tail of the scheduling queue at its priority in the
  699. event that its original priority is changed."
  700. Status: Open. No changes planned.
  701. Priority: Low -- about zero, probably not that useful. Priority inheritance is
  702. already supported and is a much better solution. And it turns out
  703. that priority protection is just about as complex as priority inheritance.
  704. Excerpted from my post in a Linked-In discussion:
  705. "I started to implement this HLS/"PCP" semaphore in an RTOS that I
  706. work with (http://www.nuttx.org) and I discovered after doing the
  707. analysis and basic code framework that a complete solution for the
  708. case of a counting semaphore is still quite complex -- essentially
  709. as complex as is priority inheritance.
  710. "For example, suppose that a thread takes 3 different HLS semaphores
  711. A, B, and C. Suppose that they are prioritized in that order with
  712. A the lowest and C the highest. Suppose the thread takes 5 counts
  713. from A, 3 counts from B, and 2 counts from C. What priority should
  714. it run at? It would have to run at the priority of the highest
  715. priority semaphore C. This means that the RTOS must maintain
  716. internal information of the priority of every semaphore held by
  717. the thread.
  718. "Now suppose it releases one count on semaphore B. How does the
  719. RTOS know that it still holds 2 counts on B? With some complex
  720. internal data structure. The RTOS would have to maintain internal
  721. information about how many counts from each semaphore are held
  722. by each thread.
  723. "How does the RTOS know that it should not decrement the priority
  724. from the priority of C? Again, only with internal complexity. It
  725. would have to know the priority of every semaphore held by
  726. every thread.
  727. "Providing the HLS capability on a simple pthread mutex would not
  728. be such quite such a complex job if you allow only one mutex per
  729. thread. However, the more general case seems almost as complex
  730. as priority inheritance. I decided that the implementation does
  731. not have value to me. I only wanted it for its reduced
  732. complexity; in all other ways I believe that it is the inferior
  733. solution. So I discarded a few hours of programming. Not a
  734. big loss from the experience I gained."
  735. Title: INAPPROPRIATE USE OF sched_lock() BY pthreads
  736. Description: In implementation of standard pthread functions, the non-
  737. standard, NuttX function sched_lock() is used. This is very
  738. strong since it disables pre-emption for all threads in all
  739. task groups. I believe it is only really necessary in most
  740. cases to lock threads in the task group with a new non-
  741. standard interface, say pthread_lock().
  742. This is because the OS resources used by a thread such as
  743. mutexes, condition variable, barriers, etc. are only
  744. meaningful from within the task group. So, in order to
  745. performance exclusive operations on these resources, it is
  746. only necessary to block other threads executing within the
  747. task group.
  748. This is an easy change: pthread_lock() and pthread_unlock()
  749. would simply operate on a semaphore retained in the task
  750. group structure. I am, however, hesitant to make this change:
  751. In the FLAT build model, there is nothing that prevents people
  752. from accessing the inter-thread controls from threads in
  753. different task groups. Making this change, while correct,
  754. might introduce subtle bugs in code by people who are not
  755. using NuttX correctly.
  756. Status: Open
  757. Priority: Low. This change would improve real-time performance of the
  758. OS but is not otherwise required.
  759. o Message Queues (sched/mqueue)
  760. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  761. o Kernel/Protected Build
  762. ^^^^^^^^^^^^^^^^^^^^^^
  763. Title: NSH PARTITIONING.
  764. Description: There are issues with several NSH commands in the NuttX kernel
  765. and protected build modes (where NuttX is built as a monolithic
  766. kernel and user code must trap into the protected kernel via
  767. syscalls). The current NSH implementation has several commands
  768. that call directly into kernel internal functions for which
  769. there is no syscall available. The commands cause link failures
  770. in the kernel/protected build mode and must currently be disabled.
  771. Here are known problems that must be fixed:
  772. COMMAND KERNEL INTERFACE(s)
  773. -------- ----------------------------------------------
  774. mkrd ramdisk_register()
  775. Status: Open
  776. Priority: Medium/High -- the kernel build configuration is not fully fielded
  777. yet.
  778. Title: apps/system PARTITIONING
  779. Description: Several of the USB device helper applications in apps/system
  780. violate OS/application partitioning and will fail on a kernel
  781. or protected build. Many of these have been fixed by adding
  782. the BOARDIOC_USBDEV_CONTROL boardctl() command. But there are
  783. still issues.
  784. These functions still call directly into operating system
  785. functions:
  786. - usbmsc_configure - Called from apps/system/usbmsc and
  787. apps/system/composite
  788. - usbmsc_bindlun - Called from apps/system/usbmsc
  789. - usbmsc_exportluns - Called from apps/system/usbmsc.
  790. Status: Open
  791. Priority: Medium/High -- the kernel build configuration is not fully fielded
  792. yet.
  793. Title: C++ CONSTRUCTORS HAVE TOO MANY PRIVILEGES (PROTECTED MODE)
  794. Description: When a C++ ELF module is loaded, its C++ constructors are called
  795. via sched/task_starthook.c logic. This logic runs in protected mode.
  796. The is a security hole because the user code runs with kernel-
  797. privileges when the constructor executes.
  798. Destructors likely have the opposite problem. The probably try to
  799. execute some kernel logic in user mode? Obviously this needs to
  800. be investigated further.
  801. Status: Open
  802. Priority: Low (unless you need build a secure C++ system).
  803. Title: TOO MANY SYSCALLS
  804. Description: There are a few syscalls that operate very often in user space.
  805. Since syscalls are (relatively) time consuming this could be
  806. a performance issue. Here is some numbers that I collected
  807. in an application that was doing mostly printf output:
  808. sem_post - 18% of syscalls
  809. sem_wait - 18% of syscalls
  810. getpid - 59% of syscalls
  811. --------------------------
  812. 95% of syscalls
  813. Obviously system performance could be improved greatly by simply
  814. optimizing these functions so that they do not need to system calls
  815. so frequently. This getpid() call is part of the re-entrant
  816. semaphore logic used with printf() and other C buffered I/O.
  817. Something like TLS might be used to retain the thread's ID
  818. locally.
  819. Linux, for example, has functions call up() and down(). up()
  820. increments the semaphore count but does not call into the kernel
  821. unless incrementing the count unblocks a task; similarly, down
  822. decrements the count and does not call into the kernel unless
  823. the count becomes negative the caller must be blocked.
  824. Update:
  825. "I am thinking that there should be a "magic" global, user-
  826. accessible variable that holds the PID of the currently
  827. executing thread; basically the PID of the task at the head
  828. of the ready-to-run list. This variable would have to be reset
  829. each time the head of the ready-to-run list changes.
  830. "Then getpid() could be implemented in user space with no system call
  831. by simply reading this variable.
  832. "This one would be easy: Just a change to include/nuttx/userspace.h,
  833. configs/*/kernel/up_userspace.c, libs/libc/,
  834. sched/sched_addreadytorun.c, and sched/sched_removereadytorun.c.
  835. That would eliminate 59% of the syscalls."
  836. Update:
  837. This is probably also just a symptom of the OS test that does mostly
  838. console output. The requests for the pid() are part of the
  839. implementation of the I/O's re-entrant semaphore implementation and
  840. would not be an issue in the more general case.
  841. Update:
  842. One solution might be to used CONFIG_TLS, add the PID to struct
  843. tls_info_s. Then the PID could be obtained without a system call.
  844. TLS is not very useful in the FLAT build, however. TLS works by
  845. putting per-thread data at the bottom of an aligned stack. The
  846. current stack pointer is the ANDed with the alignment mask to
  847. obtain the per-thread data address.
  848. There are problems with this in the FLAT and PROTECTED builds:
  849. First the maximum size of the stack is limited by the number
  850. of bits in the mask. This means that you need to have a very
  851. high alignment to support tasks with large stacks. But
  852. secondly, the higher the alignment of the stacks stacks, the
  853. more memory is lost to fragmentation.
  854. In the KERNEL build, the the stack lies at a virtual address
  855. and it is possible to have highly aligned stacks with no such
  856. penalties.
  857. Status: Open
  858. Priority: Low-Medium. Right now, I do not know if these syscalls are a
  859. real performance issue or not. The above statistics were collected
  860. from a an atypical application (the OS test), and does an excessive
  861. amount of console output. There is probably no issue with more typical
  862. embedded applications.
  863. Title: SECURITY ISSUES
  864. Description: In the current designed, the kernel code calls into the user-space
  865. allocators to allocate user-space memory. It is a security risk to
  866. call into user-space in kernel-mode because that could be exploited
  867. to gain control of the system. That could be fixed by dropping to
  868. user mode before trapping into the memory allocators; the memory
  869. allocators would then need to trap in order to return (this is
  870. already done to return from signal handlers; that logic could be
  871. renamed more generally and just used for a generic return trap).
  872. Another place where the system calls into the user code in kernel
  873. mode is work_usrstart() to start the user work queue. That is
  874. another security hole that should be plugged.
  875. Status: Open
  876. Priority: Low (unless security becomes an issue).
  877. Title: MICRO-KERNEL
  878. Description: The initial kernel build cut many interfaces at a very high level.
  879. The resulting monolithic kernel is then rather large. It would
  880. not be a prohibitively large task to reorganize the interfaces so
  881. that NuttX is built as a micro-kernel, i.e., with only the core
  882. OS services within the kernel and with other OS facilities, such
  883. as the file system, message queues, etc., residing in user-space
  884. and to interfacing with those core OS facilities through traps.
  885. Status: Open
  886. Priority: Low. This is a good idea and certainly an architectural
  887. improvement. However, there is no strong motivation now do
  888. do that partitioning work.
  889. Title: USER MODE TASKS CAN MODIFY PRIVILEGED TASKS
  890. Description: Certain interfaces, such as sched_setparam(),
  891. sched_setscheduler(), etc. can be used by user mode tasks to
  892. modify the behavior of privileged kernel threads.
  893. For a truly secure system. Privileges need to be checked in
  894. every interface that permits one thread to modify the
  895. properties of another thread.
  896. NOTE: It would be a simple matter to simply disable user
  897. threads from modifying privileged threads. However, you
  898. might also want to be able to modify privileged threads from
  899. user tasks with certain permissions. Permissions is a much
  900. more complex issue.
  901. task_delete(), for example, is not permitted to kill a kernel
  902. thread. But should not a privileged user task be able to do
  903. so?
  904. Status: Open
  905. Priority: Low for most embedded systems but would be a critical need if
  906. NuttX were used in a secure system.
  907. Title: ERRNO VARIABLE in KERNEL MODE
  908. Description: In the FLAT and PROTECTED mode, the errno variable is retained
  909. within the TCB. It requires a call into the OS to access the
  910. errno variable.
  911. In the KERNEL build, TLS should be used: The errno should be
  912. stored at the base of the callers stack along with other TLS
  913. data.
  914. To do this, NuttX system calls should be reorganized. The
  915. system calls should go to the internal OS functions (like
  916. nxsem_wait() vs sem_wait()) which do not set the errno value.
  917. The implementation available to applications (sem_wait() in
  918. this example) should call the internal OS function then set the
  919. errno variable in TLS.
  920. Status: Open
  921. Priority: Low, this primarily an aesthetic issue but may also have some
  922. performance implications if the the errno variable is accessed
  923. via a system call at high rates.
  924. Title: SIGNAL ACTION VULNERABILITY
  925. Description: When a signal action is peformed, the user stack is used.
  926. Unlike Linux, applications do not have separate user and
  927. supervisor stacks; everything is done on the user stack.
  928. In the implementation of up_sigdeliver(), a copy of the
  929. register contents that will be restored is present on the
  930. stack and could be modified by the user application. Thus,
  931. if the user mucks with the return stack, problems could
  932. occur when the user task returns to supervisor mode from
  933. the the signal handler.
  934. A recent commit (3 Feb 2019) does protect the status register
  935. and return address so that a malicious task cannot change the
  936. return address or switch to supervisor mode. Other register
  937. are still modifiable so there is other possible mayhem that
  938. could be done.
  939. A better solution, in lieu of a kernel stack, would be to
  940. eliminate the stack-based register save area altogether and,
  941. instead, save the registers in another, dedicated state save
  942. area in the TCB. The only hesitation to this option is that
  943. it would significantly increase the size of the TCB structure
  944. and, hence, the per-thread memory overhead.
  945. Status: Open
  946. Priority: Medium-ish if are attempting to make a secure environment that
  947. may host malicious code. Very low for the typical FLAT build,
  948. however.
  949. o C++ Support
  950. ^^^^^^^^^^^
  951. Title: USE OF SIZE_T IN NEW OPERATOR
  952. Description: The argument of the 'new' operators should take a type of
  953. size_t (see libxx/libxx_new.cxx and libxx/libxx_newa.cxx). But
  954. size_t has an unknown underlying. In the nuttx sys/types.h
  955. header file, size_t is typed as uint32_t (which is determined by
  956. architecture-specific logic). But the C++ compiler may believe
  957. that size_t is of a different type resulting in compilation errors
  958. in the operator. Using the underlying integer type Instead of
  959. size_t seems to resolve the compilation issues.
  960. Status: Kind of open. There is a workaround. Setting CONFIG_CXX_NEWLONG=y
  961. will define the operators with argument of type unsigned long;
  962. Setting CONFIG_CXX_NEWLONG=n will define the operators with argument
  963. of type unsigned int. But this is pretty ugly! A better solution
  964. would be to get a hold of the compilers definition of size_t.
  965. Priority: Low.
  966. Title: STATIC CONSTRUCTORS AND MULTITASKING
  967. Description: The logic that calls static constructors operates on the main
  968. thread of the initial user application task. Any static
  969. constructors that cache task/thread specific information such
  970. as C streams or file descriptors will not work in other tasks.
  971. See also UCLIBC++ AND STATIC CONSTRUCTORS below.
  972. Status: Open
  973. Priority: Low and probably will not changed. In these case, there will
  974. need to be an application specific solution.
  975. Title: UCLIBC++ AND STATIC CONSTRUCTORS
  976. uClibc++ was designed to work in a Unix environment with
  977. processes and with separately linked executables. Each process
  978. has its own, separate uClibc++ state. uClibc++ would be
  979. instantiated like this in Linux:
  980. 1) When the program is built, a tiny start-up function is
  981. included at the beginning of the program. Each program has
  982. its own, separate list of C++ constructors.
  983. 2) When the program is loaded into memory, space is set aside
  984. for uClibc's static objects and then this special start-up
  985. routine is called. It initializes the C library, calls all
  986. of the constructors, and calls atexit() so that the destructors
  987. will be called when the process exits.
  988. In this way, you get a per-process uClibc++ state since there
  989. is per-process storage of uClibc++ global state and per-process
  990. initialization of uClibc++ state.
  991. Compare this to how NuttX (and most embedded RTOSs) would work:
  992. 1) The entire FLASH image is built as one big blob. All of the
  993. constructors are lumped together and all called together at
  994. one time.
  995. This, of course, does not have to be so. We could segregate
  996. constructors by some criteria and we could use a task start
  997. up routine to call constructors separately. We could even
  998. use ELF executables that are separately linked and already
  999. have their constructors separately called when the ELF
  1000. executable starts.
  1001. But this would not do you very much good in the case of
  1002. uClibc++ because:
  1003. 2) NuttX does not support processes, i.e., separate address
  1004. environments for each task. As a result, the scope of global
  1005. data is all tasks. Any change to the global state made by
  1006. one task can effect another task. There can only one
  1007. uClibc++ state and it will be shared by all tasks. uClibc++
  1008. apparently relies on global instances (at least for cin and
  1009. cout) there is no way to to have any unique state for any
  1010. "task group".
  1011. [NuttX does not support processes because in order to have
  1012. true processes, your hardware must support a memory management
  1013. unit (MMU) and I am not aware of any mainstream MCU that has
  1014. an MMU (or, at least an MMU that is capable enough to support
  1015. processes).]
  1016. NuttX does not have processes, but it does have "task groups".
  1017. See http://www.nuttx.org/doku.php?id=wiki:nxinternal:tasksnthreads.
  1018. A task group is the task plus all of the pthreads created by
  1019. the task via pthread_create(). Resources like FILE streams
  1020. are shared within a task group. Task groups are like a poor
  1021. man's process.
  1022. This means that if the uClibc++ static classes are initialized
  1023. by one member of a task group, then cin/cout should work
  1024. correctly with all threads that are members of task group. The
  1025. destructors would be called when the final member of the task
  1026. group exists (if registered via atexit()).
  1027. So if you use only pthreads, uClibc++ should work very much like
  1028. it does in Linux. If your NuttX usage model is like one process
  1029. with many threads then you have Linux compatibility.
  1030. If you wanted to have uClibc++ work across task groups, then
  1031. uClibc++ and NuttX would need some extensions. I am thinking
  1032. along the lines of the following:
  1033. 1) There is a per-task group storage are within the RTOS (see
  1034. include/nuttx/sched.h). If we add some new, non-standard APIs
  1035. then uClibc++ could get access to per-task group storage (in
  1036. the spirit of pthread_getspecific() which gives you access to
  1037. per-thread storage).
  1038. 2) Then move all of uClibc++'s global state into per-task group
  1039. storage and add a uClibc++ initialization function that would:
  1040. a) allocate per-task group storage, b) call all of the static
  1041. constructors, and c) register with atexit() to perform clean-
  1042. up when the task group exits.
  1043. That would be a fair amount of effort. I don't really know what
  1044. the scope of such an effort would be. I suspect that it is not
  1045. large but probably complex.
  1046. NOTES:
  1047. 1) See STATIC CONSTRUCTORS AND MULTITASKING
  1048. 2) To my knowledge, only some uClibc++ ofstream logic is
  1049. sensitive to this. All other statically initialized classes
  1050. seem to work OK across different task groups.
  1051. Status: Open
  1052. Priority: Low. I have no plan to change this logic now unless there is
  1053. some strong demand to do so.
  1054. o Binary loaders (binfmt/)
  1055. ^^^^^^^^^^^^^^^^^^^^^^^^
  1056. Title: NXFLAT TESTS
  1057. Description: Not all of the NXFLAT test under apps/examples/nxflat are working.
  1058. Most simply do not compile yet. tests/mutex runs okay but
  1059. outputs garbage on completion.
  1060. Update: 13-27-1, tests/mutex crashed with a memory corruption
  1061. problem the last time that I ran it.
  1062. Status: Open
  1063. Priority: High
  1064. Title: ARM UP_GETPICBASE()
  1065. Description: The ARM up_getpicbase() does not seem to work. This means
  1066. the some features like wdog's might not work in NXFLAT modules.
  1067. Status: Open
  1068. Priority: Medium-High
  1069. Title: NXFLAT READ-ONLY DATA IN RAM
  1070. Description: At present, all .rodata must be put into RAM. There is a
  1071. tentative design change that might allow .rodata to be placed
  1072. in FLASH (see Documentation/NuttXNxFlat.html).
  1073. Status: Open
  1074. Priority: Medium
  1075. Title: GOT-RELATIVE FUNCTION POINTERS
  1076. Description: If the function pointer to a statically defined function is
  1077. taken, then GCC generates a relocation that cannot be handled
  1078. by NXFLAT. There is a solution described in Documentation/NuttXNxFlat.html,
  1079. by that would require a compiler change (which we want to avoid).
  1080. The simple workaround is to make such functions global in scope.
  1081. Status: Open
  1082. Priority: Low (probably will not fix)
  1083. Title: USE A HASH INSTEAD OF A STRING IN SYMBOL TABLES
  1084. Description: In the NXFLAT symbol tables... Using a 32-bit hash value instead
  1085. of a string to identify a symbol should result in a smaller footprint.
  1086. Status: Open
  1087. Priority: Low
  1088. Title: WINDOWS-BASED TOOLCHAIN BUILD
  1089. Description: Windows build issue. Some of the configurations that use NXFLAT have
  1090. the linker script specified like this:
  1091. NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
  1092. That will not work for windows-based tools because they require Windows
  1093. style paths. The solution is to do something like this:
  1094. if ($(WINTOOL)y)
  1095. NXFLATLDSCRIPT=${cygpath -w $(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld}
  1096. else
  1097. NXFLATLDSCRIPT=$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld
  1098. endif
  1099. Then use
  1100. NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T"$(NXFLATLDSCRIPT)" -no-check-sections
  1101. Status: Open
  1102. Priority: There are too many references like the above. They will have
  1103. to get fixed as needed for Windows native tool builds.
  1104. o Network (net/, drivers/net)
  1105. ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1106. Title: LISTENING FOR UDP BROADCASTS
  1107. Description: Incoming UDP broadcast should only be accepted if listening on
  1108. INADDR_ANY(?)
  1109. Status: Open
  1110. Priority: Low
  1111. Title: CONCURRENT, UNBUFFERED TCP SEND OPERATIONS
  1112. Description: At present, there cannot be two concurrent active TCP send
  1113. operations in progress using the same socket *unless*
  1114. CONFIG_TCP_WRITE_BUFFER. This is because the uIP ACK logic
  1115. will support only one transfer at a time.
  1116. Such a situation could occur if explicit TCP send operations
  1117. are performed using the same socket (or dup's of the same)
  1118. socket on two different threads. It can also occur implicitly
  1119. when you execute more than one thread over and NSH Telenet
  1120. session.
  1121. There are two possible solutions:
  1122. 1. Remove option to build the network without write buffering
  1123. enabled. This is is simplest and perhaps the best option.
  1124. Certainly a system can be produced with a smaller RAM
  1125. footprint without write buffering. However, that probably
  1126. does not justify permitted a crippled system.
  1127. 2. Another option is to serialize the non-buffered writes for
  1128. a socket with a mutex. i.e., add a mutex to make sure that
  1129. each send that is started is able to be the exclusive
  1130. sender until all of the data to be sent has been ACKed.
  1131. That can be a very significant delay involving the send,
  1132. waiting for the ACK or a timeout and possible retransmissions!
  1133. Although it uses more memory, I believe that option 1 is the
  1134. better solution and will avoid difficult TCP bugs in the future.
  1135. Status: Open.
  1136. Priority: Medium-Low. This is only an important issue for people who
  1137. use multi-threaded, unbuffered TCP networking without a full
  1138. understanding of the issues.
  1139. Title: POLL/SELECT ON TCP/UDP SOCKETS NEEDS READ-AHEAD
  1140. Description: poll()/select() only works for availability of buffered TCP/UDP
  1141. read data (when read-ahead is enabled). The way writing is
  1142. handled in the network layer, either (1) If CONFIG_UDP/TCP_WRITE_BUFFERS=y
  1143. then we never have to wait to send; otherwise, we always have
  1144. to wait to send. So it is impossible to notify the caller
  1145. when it can send without waiting.
  1146. An exception "never having to wait" is the case where we are
  1147. out of memory for use in write buffering. In that case, the
  1148. blocking send()/sendto() would have to wait for the memory
  1149. to become available.
  1150. Status: Open, probably will not be fixed.
  1151. Priority: Medium... this does effect porting of applications that expect
  1152. different behavior from poll()/select()
  1153. Title: INTERFACES TO LEAVE/JOIN IGMP MULTICAST GROUP
  1154. Description: The interfaces used to leave/join IGMP multicast groups is non-standard.
  1155. RFC3678 (IGMPv3) suggests ioctl() commands to do this (SIOCSIPMSFILTER) but
  1156. also status that those APIs are historic. NuttX implements these ioctl
  1157. commands, but is non-standard because: (1) It does not support IGMPv3, and
  1158. (2) it looks up drivers by their device name (e.g., "eth0") vs IP address.
  1159. Linux uses setsockopt() to control multicast group membership using the
  1160. IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP options. It also looks up drivers
  1161. using IP addresses (It would require additional logic in NuttX to look up
  1162. drivers by IP address). See http://tldp.org/HOWTO/Multicast-HOWTO-6.html
  1163. Status: Open
  1164. Priority: Medium. All standards compatibility is important to NuttX. However, most
  1165. the mechanism for leaving and joining groups is hidden behind a wrapper
  1166. function so that little of this incompatibilities need be exposed.
  1167. Title: CLOSED CONNECTIONS IN THE BACKLOG
  1168. If a connection is backlogged but accept() is not called quickly, then
  1169. that connection may time out. How should this be handled? Should the
  1170. connection be removed from the backlog if it is times out or is closed?
  1171. Or should it remain in the backlog with a status indication so that accept()
  1172. can fail when it encounters the invalid connection?
  1173. Status: Open
  1174. Priority: Medium. Important on slow applications that will not accept
  1175. connections promptly.
  1176. Title: IPv6 REQUIRES ADDRESS FILTER SUPPORT
  1177. Description: IPv6 requires that the Ethernet driver support NuttX address
  1178. filter interfaces. Several Ethernet drivers do support there,
  1179. however. Others support the address filtering interfaces but
  1180. have never been verified:
  1181. C5471, LM3S, ez80, DM0x90 NIC, PIC, LPC54: Do not support
  1182. address filtering.
  1183. Kinetis, LPC17xx, LPC43xx: Untested address filter support
  1184. Status: Open
  1185. Priority: Pretty high if you want a to use IPv6 on these platforms.
  1186. Title: UDP MULTICAST RECEPTION
  1187. Description: The logic in udp_input() expects either a single receive socket or
  1188. none at all. However, multiple sockets should be capable of
  1189. receiving a UDP datagram (multicast reception). This could be
  1190. handled easily by something like:
  1191. for (conn = NULL; conn = udp_active (pbuf, conn); )
  1192. If the callback logic that receives a packet responds with an
  1193. outgoing packet, then it will over-write the received buffer,
  1194. however. recvfrom() will not do that, however. We would have
  1195. to make that the rule: Recipients of a UDP packet must treat
  1196. the packet as read-only.
  1197. Status: Open
  1198. Priority: Low, unless your logic depends on that behavior.
  1199. Title: NETWORK WON'T STAY DOWN
  1200. Description: If you enable the NSH network monitor (CONFIG_NSH_NETINIT_MONITOR)
  1201. then the NSH 'ifdown' command is broken. Doing 'nsh> ifconfig eth0'
  1202. will, indeed, bring the network down. However, the network monitor
  1203. notices the change in the link status and will bring the network
  1204. back up. There needs to be some kind of interlock between
  1205. cmd_ifdown() and the network monitor thread to prevent this.
  1206. Status: Open
  1207. Priority: Low, this is just a nuisance in most cases.
  1208. Title: FIFO CLEAN-UP AFTER CLOSING UNIX DOMAIN DATAGRAM SOCKET
  1209. Description: FIFOs are used as the IPC underlying all local Unix domain
  1210. sockets. In NuttX, FIFOs are implemented as device drivers
  1211. (not as a special FIFO files). The FIFO device driver is
  1212. instantiated when the Unix domain socket communications begin
  1213. and will automatically be released when (1) the driver is
  1214. unlinked and (2) all open references to the driver have been
  1215. closed. But there is no mechanism in place now to unlink the
  1216. FIFO when the Unix domain datagram socket is no longer used.
  1217. The primary issue is timing.. the FIFO should persist until
  1218. it is no longer needed. Perhaps there should be a delayed
  1219. call to unlink() (using a watchdog or the work queue). If
  1220. the driver is re-opened, the delayed unlink could be
  1221. canceled? Needs more thought.
  1222. NOTE: This is not an issue for Unix domain streams sockets:
  1223. The end-of-life of the FIFO is well determined when sockets
  1224. are disconnected and support for that case is fully implemented.
  1225. Status: Open
  1226. Priority: Low for now because I don't have a situation where this is a
  1227. problem for me. If you use the same Unix domain paths, then
  1228. it is not a issue; in fact it is more efficient if the FIFO
  1229. devices persist. But this would be a serious problem if,
  1230. for example, you create new Unix domain paths dynamically.
  1231. In that case you would effectively have a memory leak and the
  1232. number of FIFO instances grow.
  1233. Title: TCP IPv4-MAPPED IPv6 ADDRESSES
  1234. Description: The UDP implementation in net/udp contains support for Hybrid
  1235. dual-stack IPv6/IPv4 implementations that utilize a special
  1236. class of addresses, the IPv4-mapped IPv6 addresses. You can
  1237. see that UDP implementation in:
  1238. udp_callback.c:
  1239. ip6_map_ipv4addr(ipv4addr,
  1240. udp_send.c:
  1241. ip6_is_ipv4addr((FAR struct in6_addr*)conn->u.ipv6.raddr)))
  1242. ip6_is_ipv4addr((FAR struct in6_addr*)conn->u.ipv6.raddr))
  1243. in_addr_t raddr = ip6_get_ipv4addr((FAR struct in6_addr*)conn->u.ipv6.raddr);
  1244. There is no corresponding support for TCP sockets.
  1245. Status: Open
  1246. Priority: Low. I don't know of any issues now, but I am sure that
  1247. someone will encounter this in the future.
  1248. Title: MISSING netdb INTERFACES
  1249. Description: There is no implementation for many netdb interfaces such as
  1250. getnetbyname(), getprotobyname(), getnameinfo(), etc.
  1251. Status: Open
  1252. Priority: Low
  1253. Title: ETHERNET WITH MULTIPLE LPWORK THREADS
  1254. Description: Recently, Ethernet drivers were modified to support multiple
  1255. work queue structures. The question was raised: "My only
  1256. reservation would be, how would this interact in the case of
  1257. having CONFIG_STM32_ETHMAC_LPWORK and CONFIG_SCHED_LPNTHREADS
  1258. > 1? Can it be guaranteed that one work item won't be
  1259. interrupted and execution switched to another? I think so but
  1260. am not 100% confident."
  1261. I suspect that you right. There are probably vulnerabilities
  1262. in the CONFIG_STM32_ETHMAC_LPWORK with CONFIG_SCHED_LPNTHREADS
  1263. > 1 case. But that really doesn't depend entirely upon the
  1264. change to add more work queue structures. Certainly with only
  1265. work queue structure you would have concurrent Ethernet
  1266. operations in that multiple LP threads; just because the work
  1267. structure is available, does not mean that there is not dequeued
  1268. work in progress. The multiple structures probably widens the
  1269. window for that concurrency, but does not create it.
  1270. The current Ethernet designs depend upon a single work queue to
  1271. serialize data. In the case of multiple LP threads, some
  1272. additional mechanism would have to be added to enforce that
  1273. serialization.
  1274. NOTE: Most drivers will call net_lock() and net_unlock() around
  1275. the critical portions of the driver work. In that case, all work
  1276. will be properly serialized. This issue only applies to drivers
  1277. that may perform operations that require protection outside of
  1278. the net_lock'ed region. Sometimes, this may require extending
  1279. the netlock() to be beginning of the driver work function.
  1280. Status: Open
  1281. Priority: High if you happen to be using Ethernet in this configuration.
  1282. Title: NETWORK DRIVERS USING HIGH PRIORITY WORK QUEUE
  1283. Description: Many network drivers run the network on the high priority work
  1284. queue thread (or support an option to do so). Networking should
  1285. not be done on the high priority work thread because it interferes
  1286. with real-time behavior. Fix by forcing all network drivers to
  1287. run on the low priority work queue.
  1288. Status: Open
  1289. Priority: Low. Not such big deal for demo network test and demo
  1290. configurations except that it provides a bad example for a product
  1291. OS configuration.
  1292. Title: REPARTITION DRIVER FUNCTIONALITY
  1293. Description: Every network driver performs the first level of packet decoding.
  1294. It examines the packet header and calls ipv4_input(), ipv6_input().
  1295. icmp_input(), etc. as appropriate. This is a maintenance problem
  1296. because it means that any changes to the network input interfaces
  1297. affects all drivers.
  1298. A better, more maintainable solution would use a single net_input()
  1299. function that would receive all incoming packets. This function
  1300. would then perform that common packet decoding logic that is
  1301. currently implemented in every network driver.
  1302. Status: Open
  1303. Priority: Low. Really just as aesthetic maintainability issue.
  1304. Title: BROADCAST WITH MULTIPLE NETWORK INTERFACES
  1305. Description: There is currently no mechanism to send a broadcast packet
  1306. out through several network interfaces. Currently packets
  1307. can be sent to only one device. Logic in netdev_findby_ipvXaddr()
  1308. currently just selects the first device in the list of
  1309. devices; only that device will receive broadcast packets.
  1310. Status: Open
  1311. Priority: High if you require broadcast on multiple networks. There is
  1312. no simple solution known at this time, however. Perhaps
  1313. netdev_findby_ipvXaddr() should return a list of devices rather
  1314. than a single device? All upstream logic would then have to
  1315. deal with a list of devices. That would be a huge effect and
  1316. certainly doesn't dount as a "simple solution".
  1317. Title: ICMPv6 FOR 6LoWPAN
  1318. Description: The current ICMPv6 and neighbor-related logic only works with
  1319. Ethernet MAC. For 6LoWPAN, a new more conservative IPv6
  1320. neighbour discovery is provided by RFC 6775. This RFC needs to
  1321. be supported in order to support ping6 on a 6LoWPAN network.
  1322. If RFC 6775 were implemented, then arbitrary IPv6 addresses,
  1323. including addresses from DHCPv6 could be used.
  1324. UPDATE: With IPv6 neighbor discovery, any IPv6 address may
  1325. be associated with any short or extended address. In fact,
  1326. that is the whole purpose of the neighbor discover logic: It
  1327. plays the same role as ARP in IPv4; it ultimately just manages
  1328. a neighbor table that, like the arp table, provides the
  1329. mapping between IP addresses and node addresses.
  1330. The NuttX, Contiki-based 6LoWPAN implementation circumvented
  1331. the need for the neighbor discovery logic by using only MAC-
  1332. based addressing, i.e., the lower two or eight bytes of the
  1333. IP address are the node address.
  1334. Most of the 6LoWPAN compression algorithms exploit this to
  1335. compress the IPv6 address to nothing but a bit indicating
  1336. that the IP address derives from the node address. So I
  1337. think IPv6 neighbor discover is useless in the current
  1338. implementation.
  1339. If we want to use IPv6 neighbor discovery, we could dispense
  1340. with the all MAC based addressing. But if we want to retain
  1341. the more compact MAC-based addressing, then we don't need
  1342. IPv6 neighbor discovery.
  1343. So, the full neighbor discovery logic is not currently useful,
  1344. but it would still be nice to have enough in place to support
  1345. ping6. Full neighbor support would probably be necessary if we
  1346. wanted to route 6LoWPAN frames outside of the WPAN.
  1347. Status: Open
  1348. Priority: Low for now. I don't plan on implementing this. It would
  1349. only be relevant if we were to decide to abandon the use of
  1350. MAC-based addressing in the 6LoWPAN implementation.
  1351. Title: ETHERNET LOCAL BROADCAST DOES NOT WORK
  1352. Description: In case of "local broadcast" the system still send ARP
  1353. request to the destination, but it shouldn't, it should
  1354. broadcast. For Example, the system has network with IP
  1355. 10.0.0.88, netmask of 255.255.255.0, it should send
  1356. messages for 10.0.0.255 as broadcast, and not send ARP
  1357. for 10.0.0.255
  1358. For more easier networking, the next line should have give
  1359. me the broadcast address of the network, but it doesn't:
  1360. ioctl(_socket_fd, SIOCGIFBRDADDR, &bc_addr);
  1361. Status: Open
  1362. Priority: Medium
  1363. Title: TCP ISSUES WITH QUICK CLOSE
  1364. Description: This failure has been reported in the accept() logic:
  1365. - psock_tcp_accept() waits on net_lockedwait() below
  1366. - The accept operation completes, the socket is in the connected
  1367. state and psock_accept() is awakened. It cannot run,
  1368. however, because its priority is low and so it is blocked
  1369. from execution.
  1370. - In the mean time, the remote host sends a
  1371. packet which is presumably caught in the read-ahead buffer.
  1372. - Then the remote host closes the socket. Nothing happens on
  1373. the target side because net_start_monitor() has not yet been
  1374. called.
  1375. - Then accept() finally runs, but not with a connected but
  1376. rather with a disconnected socket. This fails when it
  1377. attempts to start the network monitor on the disconnected
  1378. socket below.
  1379. - It is also impossible to read the buffered TCP data from a
  1380. disconnected socket. The TCP recvfrom() logic would also
  1381. need to permit reading buffered data from a disconnected
  1382. socket.
  1383. This problem was report when the target hosted an FTP server
  1384. and files were being accessed by FileZilla.
  1385. connect() most likely has this same issue.
  1386. A work-around might be to raise the priority of the thread
  1387. that calls accept(). accept() might also need to check the
  1388. tcpstateflags in the connection structure before returning
  1389. in order to assure that the socket truly is connected.
  1390. Status: Open
  1391. Priority: Medium. I have never heard of this problem being reported
  1392. before, so I suspect it might not be so prevalent as one
  1393. might expect.
  1394. Title: TCP SOCKETS CLOSED TOO QUICKLY
  1395. Description: When a socket is closed, the resources are torn down
  1396. immediately (unless the SO_LINGER option is selected). As a
  1397. result, the socket does not send the FIN and this looks like
  1398. an unexpected, abnormal loss of connection to the remote peer.
  1399. Actually, it is worse than this: The is NO logic to send
  1400. FIN in when the file is close. This is pretty easy to do,
  1401. however:
  1402. - Wait for a TCP poll, then
  1403. - Call tcp_append with TCP_CLOSE in the flags. There is
  1404. already logic in tcp_appsend to send the FIN in this case,
  1405. it is just not being use.
  1406. Status: Open
  1407. Priority: Medium-Low.
  1408. Title: LOCAL DATAGRAM RECVFROM RETURNS WRONG SENDER ADDRESS
  1409. Description: The recvfrom logic for local datagram sockets returns the
  1410. incorrect sender "from" address. Instead, it returns the
  1411. receiver's "to" address. This means that returning a reply
  1412. to the "from" address receiver sending a packet to itself.
  1413. Status: Open
  1414. Priority: Medium High. This makes using local datagram sockets in
  1415. anything but a well-known point-to-point configuration
  1416. impossible.
  1417. o USB (drivers/usbdev, drivers/usbhost)
  1418. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1419. Title: USB STORAGE DRIVER DELAYS
  1420. Description: There is a workaround for a bug in drivers/usbdev/usbdev_storage.c.
  1421. that involves delays. This needs to be redesigned to eliminate these
  1422. delays. See logic conditioned on CONFIG_USBMSC_RACEWAR.
  1423. If queuing of stall requests is supported by the DCD then this workaround
  1424. is not required. In this case, (1) the stall is not sent until all
  1425. write requests preceding the stall request are sent, (2) the stall is
  1426. sent, and then after the stall is cleared, (3) all write requests
  1427. queued after the stall are sent.
  1428. See, for example, the queuing of pending stall requests in the SAM3/4
  1429. UDP driver at arch/arm/src/sam34/sam_udp.c. There the logic is do this
  1430. is implemented with a normal request queue, a pending request queue, a
  1431. stall flag and a stall pending flag:
  1432. 1) If the normal request queue is not empty when the STALL request is
  1433. received, the stall pending flag is set.
  1434. 2) If addition write requests are received while the stall pending flag
  1435. is set (or while waiting for the stall to be sent), those write requests
  1436. go into the pending queue.
  1437. 3) When the normal request queue empties successful and all of the write
  1438. transfers complete, the STALL is sent. The stall pending flag is
  1439. cleared and the stall flag is set. Now the endpoint is really stalled.
  1440. 4) After the STALL is cleared (via the Clear Feature SETUP), the pending
  1441. request queue is copied to the normal request queue, the stall flag is
  1442. cleared, and normal write request processing resumes.
  1443. Status: Open
  1444. Priority: Medium
  1445. Title: EP0 OUT CLASS DATA
  1446. Description: There is no mechanism in place to handle EP0 OUT data transfers.
  1447. There are two aspects to this problem, neither are easy to fix
  1448. (only because of the number of drivers that would be impacted):
  1449. 1. The class drivers only send EP0 write requests and these are
  1450. only queued on EP0 IN by this drivers. There is never a read
  1451. request queued on EP0 OUT.
  1452. 2. But EP0 OUT data could be buffered in a buffer in the driver
  1453. data structure. However, there is no method currently
  1454. defined in the USB device interface to obtain the EP0 data.
  1455. Updates: (1) The USB device-to-class interface as been extended so
  1456. that EP0 OUT data can accompany the SETUP request sent to the
  1457. class drivers. (2) The logic in the STM32 F4 OTG FS device driver
  1458. has been extended to provide this data. Updates are still needed
  1459. to other drivers.
  1460. Here is an overview of the required changes:
  1461. New two buffers in driver structure:
  1462. 1. The existing EP0 setup request buffer (ctrlreq, 8 bytes)
  1463. 2. A new EP0 data buffer to driver state structure (ep0data,
  1464. max packetsize)
  1465. Add a new state:
  1466. 3. Waiting for EP0 setup OUT data (EP0STATE_SETUP_OUT)
  1467. General logic flow:
  1468. 1. When an EP0 SETUP packet is received:
  1469. - Read the request into EP0 setup request buffer (ctrlreq,
  1470. 8 bytes)
  1471. - If this is an OUT request with data length, set the EP0
  1472. state to EP0STATE_SETUP_OUT and wait to receive data on
  1473. EP0.
  1474. - Otherwise, the SETUP request may be processed now (or,
  1475. in the case of the F4 driver, at the conclusion of the
  1476. SETUP phase).
  1477. 2. When EP0 the EP0 OUT DATA packet is received:
  1478. - Verify state is EP0STATE_SETUP_OUT
  1479. - Read the request into the EP0 data buffer (ep0data, max
  1480. packet size)
  1481. - Now process the previously buffered SETUP request along
  1482. with the OUT data.
  1483. 3. When the setup packet is dispatched to the class driver,
  1484. the OUT data must be passed as the final parameter in the
  1485. call.
  1486. Update 2013-9-2: The new USB device-side driver for the SAMA5D3
  1487. correctly supports OUT SETUP data following the same design as
  1488. per above.
  1489. Update 2013-11-7: David Sidrane has fixed with issue with the
  1490. STM32 F1 USB device driver. Still a few more to go before this
  1491. can be closed out.
  1492. Status: Open
  1493. Priority: High for class drivers that need EP0 data. For example, the
  1494. CDC/ACM serial driver might need the line coding data (that
  1495. data is not used currently, but it might be).
  1496. Title: IMPROVED USAGE of STM32 USB RESOURCES
  1497. Description: The STM32 platforms use a non-standard, USB host peripheral
  1498. that uses "channels" to implement data transfers the current
  1499. logic associates each channel with an pipe/endpoint (with two
  1500. channels for bi-directional control endpoints). The OTGFS
  1501. peripheral has 8 channels and the OTGHS peripheral has 12
  1502. channels.
  1503. This works okay until you add a hub and try connect multiple
  1504. devices. A typical device will require 3-4 pipes and, hence,
  1505. 4-5 channels. This effectively prevents using a hub with the
  1506. STM32 devices. This also applies to the EFM32 which uses the
  1507. same IP.
  1508. It should be possible to redesign the STM32 F4 OTGHS/OTGFS and
  1509. EFM32 host driver so that channels are dynamically assigned to
  1510. pipes as needed for individual transfers. Then you could have
  1511. more "apparent" pipes and make better use of channels.
  1512. Although there are only 8 or 12 channels, transfers are not
  1513. active all of the time on all channels so it ought to be
  1514. possible to have an unlimited number of "pipes" but with no
  1515. more than 8 or 12 active transfers.
  1516. Status: Open
  1517. Priority: Medium-Low
  1518. Title: USB CDC/ACM HOST CLASS DRIVER
  1519. Description: A CDC/ACM host class driver has been added. This has been
  1520. testing by running the USB CDC/ACM host on an Olimex
  1521. LPC1766STK and using the configs/stm3210e-eval/usbserial
  1522. configuration (using the CDC/ACM device side driver). There
  1523. are several unresolved issues that prevent the host driver
  1524. from being usable:
  1525. - The driver works fine when configured for reduced or bulk-
  1526. only protocol on the Olimex LPC1766STK.
  1527. - Testing has not been performed with the interrupt IN channel
  1528. enabled (ie., I have not enabled FLOW control nor do I have
  1529. a test case that used the interrupt IN channel). I can see
  1530. that the polling for interrupt IN data is occurring
  1531. initially.
  1532. - I test for incoming data by doing 'nsh> cat /dev/ttyACM0' on
  1533. the Olimex LPC1766STK host. The bulk data reception still
  1534. works okay whether or not the interrupt IN channel is enabled.
  1535. If the interrupt IN channel is enabled, then polling of that
  1536. channel appears to stop when the bulk in channel becomes
  1537. active.
  1538. - The RX reception logic uses the low priority work queue.
  1539. However, that logic never returns and so blocks other use of
  1540. the work queue thread. This is probably okay but means that
  1541. the RX reception logic probably should be moved to its own
  1542. dedicated thread.
  1543. - I get crashes when I run with the STM32 OTGHS host driver.
  1544. Apparently the host driver is trashing memory on receipt
  1545. of data.
  1546. UPDATE: This behavior needs to be retested with:
  1547. commit ce2845c5c3c257d081f624857949a6afd4a4668a
  1548. Author: Janne Rosberg <janne.rosberg@offcode.fi>
  1549. Date: Tue Mar 7 06:58:32 2017 -0600
  1550. usbhost_cdcacm: fix tx outbuffer overflow and remove now
  1551. invalid assert
  1552. commit 3331e9c49aaaa6dcc3aefa6a9e2c80422ffedcd3
  1553. Author: Janne Rosberg <janne.rosberg@offcode.fi>
  1554. Date: Tue Mar 7 06:57:06 2017 -0600
  1555. STM32 OTGHS host: stm32_in_transfer() fails and returns NAK
  1556. if a short transfer is received. This causes problems from
  1557. class drivers like CDC/ACM where short packets are expected.
  1558. In those protocols, any transfer may be terminated by sending
  1559. short or NUL packet.
  1560. commit 0631c1aafa76dbaa41b4c37e18db98be47b60481
  1561. Author: Gregory Nutt <gnutt@nuttx.org>
  1562. Date: Tue Mar 7 07:17:24 2017 -0600
  1563. STM32 OTGFS, STM32 L4 and F7: Adapt Janne Rosberg's patch to
  1564. STM32 OTGHS host to OTGFS host, and to similar implements for
  1565. L4 and F7.
  1566. - The SAMA5D EHCI and the LPC31 EHCI drivers both take semaphores
  1567. in the cancel method. The current CDC/ACM class driver calls
  1568. the cancel() method from an interrupt handler. This will
  1569. cause a crash. Those EHCI drivers should be redesigned to
  1570. permit cancellation from the interrupt level.
  1571. Most of these problems are unique to the Olimex LPC1766STK
  1572. DCD; some are probably design problems in the CDC/ACM host
  1573. driver. The bottom line is that the host CDC/ACM driver is
  1574. still immature and you could experience issues in some
  1575. configurations if you use it.
  1576. That all being said, I know of no issues with the current
  1577. CDC/ACM driver on the Olimex LPC1766STK platform if the interrupt
  1578. IN endpoint is not used, i.e., in "reduced" mode. The only loss
  1579. of functionality is output flow control.
  1580. UPDATE: The CDC/ACM class driver may also now be functional on
  1581. the STM32. That needs to be verified.
  1582. Status: Open
  1583. Priority: Medium-Low unless you really need host CDC/ACM support.
  1584. o Libraries (libs/libc/, libs/libm/)
  1585. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1586. Title: SIGNED time_t
  1587. Description: The NuttX time_t is type uint32_t. I think this is consistent
  1588. with all standards and with normal usage of time_t. However,
  1589. according to Wikipedia, time_t is usually implemented as a
  1590. signed 32-bit value.
  1591. Status: Open
  1592. Priority: Very low unless there is some compelling issue that I do not
  1593. know about.
  1594. Title: ENVIRON
  1595. Description: The definition of environ in stdlib.h is bogus and will not
  1596. work as it should. This is because the underlying
  1597. representation of the environment is not an array of pointers.
  1598. Status: Open
  1599. Priority: Medium
  1600. Title: TERMIOS
  1601. Description: Need some minimal termios support... at a minimum, enough to
  1602. switch between raw and "normal" modes to support behavior like
  1603. that needed for readline().
  1604. UPDATE: There is growing functionality in libs/libc/termios/
  1605. and in the ioctl methods of several MCU serial drivers (stm32,
  1606. lpc43, lpc17, pic32, and others). However, as phrased, this
  1607. bug cannot yet be closed since this "growing functionality"
  1608. does not address all termios.h functionality and not all
  1609. serial drivers support termios.
  1610. Status: Open
  1611. Priority: Low
  1612. Title: CONCURRENT STREAM READ/WRITE
  1613. Description: NuttX only supports a single file pointer so reads and writes
  1614. must be from the same position. This prohibits implementation
  1615. of behavior like that required for fopen() with the "a+" mode.
  1616. According to the fopen man page:
  1617. "a+ Open for reading and appending (writing at end of file).
  1618. The file is created if it does not exist. The initial file
  1619. position for reading is at the beginning of the file, but
  1620. output is always appended to the end of the file."
  1621. At present, the single NuttX file pointer is positioned to the
  1622. end of the file for both reading and writing.
  1623. Status: Open
  1624. Priority: Medium. This kind of operation is probably not very common in
  1625. deeply embedded systems but is required by standards.
  1626. Title: DIVIDE BY ZERO
  1627. Description: This is bug 3468949 on the SourceForge website (submitted by
  1628. Philipp Klaus Krause):
  1629. "lib_strtod.c does contain divisions by zero in lines 70 and 96.
  1630. AFAIK, unlike for Java, division by zero is not a reliable way to
  1631. get infinity in C. AFAIK compilers are allowed e.g. give a compile-
  1632. time error, and some, such as sdcc, do. AFAIK, C implementations
  1633. are not even required to support infinity. In C99 the macro isinf()
  1634. could replace the first use of division by zero. Unfortunately, the
  1635. macro INFINITY from math.h probably can't replace the second division
  1636. by zero, since it will result in a compile-time diagnostic, if the
  1637. implementation does not support infinity."
  1638. Status: Open
  1639. Priority:
  1640. Title: OLD dtoa NEEDS TO BE UPDATED
  1641. Description: This implementation of dtoa in libs/libc/stdio is old and will not
  1642. work with some newer compilers. See
  1643. http://patrakov.blogspot.com/2009/03/dont-use-old-dtoac.html
  1644. Update: A new dtoa version is not available and enabled with
  1645. CONFIG_NANO_PRINF. However, the old version of dtoa is still in
  1646. in place and lib_libvsprintf() has been dupliated. I think this
  1647. issue should remain open until the implementations have been
  1648. unified.
  1649. Status: Open
  1650. Priority: ??
  1651. Title: FLOATING POINT FORMATS
  1652. Description: Only the %f floating point format is supported. Others are
  1653. accepted but treated like %f.
  1654. Update: %g is supported with CONFIG_NANO_PRINTF.
  1655. Status: Open
  1656. Priority: Medium (this might important to someone).
  1657. Title: LIBM INACCURACIES
  1658. Description: "..if you are writing something like robot control or
  1659. inertial navigation system for aircraft, I have found
  1660. that using the toolchain libmath is only safe option.
  1661. I ported some code for converting quaternions to Euler
  1662. angles to NuttX for my project and only got it working
  1663. after switching to newlib math library.
  1664. "NuttX does not fully implement IEC 60559 floating point
  1665. from C99 (sections marked [MX] in OpenGroup specs) so if
  1666. your code assumes that some function, say pow(), actually
  1667. behaves right for all the twenty or so odd corner cases
  1668. that the standards committees have recently specified,
  1669. you might get surprises. I'd expect pow(0.0, 1.0) to
  1670. return 0.0 (as zero raised to any positive power is
  1671. well-defined in mathematics) but I get +Inf.
  1672. "NuttX atan2(-0.0, -1.0) returns +M_PI instead of correct
  1673. -M_PI. If we expect [MX] functionality, then atan2(Inf, Inf)
  1674. should return M_PI/4, instead NuttX gives NaN.
  1675. "asin(2.0) does not set domain error or return NaN. In fact
  1676. it does not return at all as the loop in it does not
  1677. converge, hanging your app.
  1678. "There are likely many other issues like these as the Rhombus
  1679. OS code has not been tested or used that much. Sorry for not
  1680. providing patches, but we found it easier just to switch the
  1681. math library."
  1682. UPDATE: 2015-09-01: A fix for the noted problems with asin()
  1683. has been applied.
  1684. 2016-07-30: Numerous fixes and performance improvements from
  1685. David Alessio.
  1686. Status: Open
  1687. Priority: Low for casual users but clearly high if you need care about
  1688. these incorrect corner case behaviors in the math libraries.
  1689. Title: REPARTITION LIBC FUNCTIONALITY
  1690. Description: There are many things implemented within the kernel (for example
  1691. under sched/pthread) that probably should be migrated in the
  1692. C library where it belongs.
  1693. I would really like to see a little flavor of a micro-kernel
  1694. at the OS interface: I would like to see more primitive OS
  1695. system calls with more higher level logic in the C library.
  1696. One awkward thing is the incompatibility of KERNEL vs FLAT
  1697. builds: In the kernel build, it would be nice to move many
  1698. of the thread-specific data items out of the TCB and into
  1699. the process address environment where they belong. It is
  1700. difficult to make this compatible with the FLAT build,
  1701. however.
  1702. Status: Open
  1703. Priority: Low
  1704. o File system / Generic drivers (fs/, drivers/)
  1705. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1706. NOTE: The NXFFS file system has its own TODO list at nuttx/fs/nxffs/README.txt
  1707. Title: MISSING FILE SYSTEM FEATURES
  1708. Description: Implement missing file system features:
  1709. chmod() is probably not relevant since file modes are not
  1710. currently supported.
  1711. File privileges would also be good to support. But this is
  1712. really a small part of a much larger feature. NuttX has no
  1713. user IDs, there are no groups, there are no privileges
  1714. associated with either. User's don't need credentials.
  1715. This is really a system wide issues of which chmod is only
  1716. a small part.
  1717. User privileges never seemed important to me since NuttX is
  1718. intended for deeply embedded environments where there are
  1719. not multiple users with varying levels of trust.
  1720. link, unlink, softlink, readlink - For symbolic links. Only
  1721. the ROMFS file system currently supports hard and soft links,
  1722. so this is not too important. The top-level, pseudo-file
  1723. system supports soft links.
  1724. File locking
  1725. Special files - NuttX support special files only in the top-
  1726. level pseudo file system. Unix systems support many
  1727. different special files via mknod(). This would be
  1728. important only if it is an objective of NuttX to become a
  1729. true Unix OS. Again only supported by ROMFS.
  1730. True inodes - Standard Unix inodes. Currently only supported
  1731. by ROMFs.
  1732. File times, for example as set by utimes().
  1733. The primary obstacle to all these is that each would require
  1734. changes to all existing file systems. That number is pretty
  1735. large. The number of file system implementations that would
  1736. need to be reviewed and modified As of this writing this
  1737. would include binfs, fat, hostfs, nfs, nxffs, procfs, romfs,
  1738. tmpfs, unionfs, plus pseduo-file system support.
  1739. Status: Open
  1740. Priority: Low
  1741. Title: ROMFS CHECKSUMS
  1742. Description: The ROMFS file system does not verify checksums on either
  1743. volume header on on the individual files.
  1744. Status: Open
  1745. Priority: Low. I have mixed feelings about if NuttX should pay a
  1746. performance penalty for better data integrity.
  1747. Title: SPI-BASED SD MULTIPLE BLOCK TRANSFERS
  1748. Description: The simple SPI based MMCS/SD driver in fs/mmcsd does not
  1749. yet handle multiple block transfers.
  1750. Status: Open
  1751. Priority: Medium-Low
  1752. Title: SDIO-BASED SD READ-AHEAD/WRITE BUFFERING INCOMPLETE
  1753. Description: The drivers/mmcsd/mmcsd_sdio.c driver has hooks in place to
  1754. support read-ahead buffering and write buffering, but the logic
  1755. is incomplete and untested.
  1756. Status: Open
  1757. Priority: Low
  1758. Title: POLLHUP SUPPORT
  1759. Description: All drivers that support the poll method should also report
  1760. POLLHUP event when the driver is closed.
  1761. Status: Open
  1762. Priority: Medium-Low
  1763. Title: CONFIG_RAMLOG_CONSOLE DOES NOT WORK
  1764. Description: When I enable CONFIG_RAMLOG_CONSOLE, the system does not come up
  1765. properly (using configuration stm3240g-eval/nsh2). The problem
  1766. may be an assertion that is occurring before we have a console.
  1767. Status: Open
  1768. Priority: Medium
  1769. Title: UNIFIED DESCRIPTOR REPRESENTATION
  1770. Description: There are two separate ranges of descriptors for file and
  1771. socket descriptors: if a descriptor is in one range then it is
  1772. recognized as a file descriptor; if it is in another range
  1773. then it is recognized as a socket descriptor. These separate
  1774. descriptor ranges can cause problems, for example, they make
  1775. dup'ing descriptors with dup2() problematic. The two groups
  1776. of descriptors are really indices into two separate tables:
  1777. On an array of file structures and the other an array of
  1778. socket structures. There really should be one array that
  1779. is a union of file and socket descriptors. Then socket and
  1780. file descriptors could lie in the same range.
  1781. Another example of how the current implementation limits
  1782. functionality: I recently started to implement of the FILEMAX
  1783. (using pctl() instead sysctl()). My objective was to be able
  1784. to control the number of available file descriptors on a task-
  1785. by-task basis. The complexity due to the partitioning of
  1786. descriptor space into a range for file descriptors and a range
  1787. for socket descriptors made this feature nearly impossible to
  1788. implement.
  1789. Status: Open
  1790. Priority: Low
  1791. Title: DUPLICATE FAT FILE NAMES
  1792. Description: "The NSH and POSIX API interpretations about sensitivity or
  1793. insensitivity to upper/lowercase file names seem to be not
  1794. consistent in our usage - which can result in creating two
  1795. directories with the same name..."
  1796. Example using NSH:
  1797. nsh> echo "Test1" >/tmp/AtEsT.tXt
  1798. nsh> echo "Test2" >/tmp/aTeSt.TxT
  1799. nsh> ls /tmp
  1800. /tmp:
  1801. AtEsT.tXt
  1802. aTeSt.TxT
  1803. nsh> cat /tmp/aTeSt.TxT
  1804. Test2
  1805. nsh> cat /tmp/AtEsT.tXt
  1806. Test1
  1807. Status: Open
  1808. Priority: Low
  1809. Title: MISSING FILES IN NSH 'LS' OF A DIRECTORY
  1810. Description: I have seen cases where (1) long file names are enabled,
  1811. but (2) a short file name is created like:
  1812. nsh> echo "This is another test" >/mnt/sdcard/another.txt
  1813. But then on subsequent 'ls' operations, the file does not appear:
  1814. nsh> ls -l /mnt/sdcard
  1815. I have determined that the problem is because, for some as-
  1816. of-yet-unknown reason the short file name is treated as a long
  1817. file name. The name then fails the long filename checksum
  1818. test and is skipped.
  1819. readdir() (and fat_readdir()) is the logic underlying the
  1820. failure and the problem appears to be something unique to the
  1821. fat_readdir() implementation. Why? Because the file is
  1822. visible when you put the SD card on a PC and because this
  1823. works fine:
  1824. nsh> ls -l /mnt/sdcard/another.txt
  1825. The failure does not happen on all short file names. I do
  1826. not understand the pattern. But I have not had the opportunity
  1827. to dig into this deeply.
  1828. Status: Open
  1829. Priority: Perhaps not a problem??? I have analyzed this problem and
  1830. I am not sure what to do about it. I am suspected that a
  1831. fat filesystem was used with a version of NuttX that does
  1832. not support long file name entries. Here is the failure
  1833. scenario:
  1834. 1) A file with a long file name is created under Windows.
  1835. 2) Then the file is deleted. I am not sure if Windows or
  1836. NuttX deleted the file, but the resulting directory
  1837. content is not compatible with NuttX with long file
  1838. name support.
  1839. The file deletion left the full sequence of long
  1840. file name entries intact but apparently delete only
  1841. the following short file name entry. I am thinking
  1842. that this might have happened because a version of NuttX
  1843. with only short file name support was used to delete
  1844. the file.
  1845. 3) When a new file with a short file name was created, it
  1846. re-used the short file name entry that was previously
  1847. deleted. This makes the new short file name entry
  1848. look like a part of the long file name.
  1849. 4) When comparing the checksum in the long file name
  1850. entry with the checksum of the short file name, the
  1851. checksum fails and the entire directory sequence is
  1852. ignored by readdir() logic. This is why the file does
  1853. not appear in the 'ls'.
  1854. Title: SILENT SPIFFS FILE TRUNCATION
  1855. Description: Under certain corner case conditions, SPIFFS will truncate
  1856. files. All of the writes to the file will claim that the
  1857. data has been written but after the file is closed, it may
  1858. be a little shorter than expected.
  1859. This is due to how the caching is implemented in SPIFFS:
  1860. 1. On each write, the data is not written to the FLASH but
  1861. rather to an internal cache in memory.
  1862. 2. When the a write causes the cache to become full, the
  1863. content of cache is flushed to memory. If that flush
  1864. fails because the FLASH has become full, write will
  1865. return the file system full error (ENOSPC).
  1866. 3. The cache is also flushed when the file is closed (or
  1867. when fsync() is called). These will also fail if the
  1868. file system becomes full.
  1869. The problem is when the file is closed, the final file
  1870. size could be smaller than the number of successful writes
  1871. to the file.
  1872. This error is probably not so significant in a real world
  1873. file system usage: It requires that you write continuously
  1874. to SPIFFS, never deleting files or freeing FLASH resources
  1875. in any way. And it requires the unlikely circumstance that
  1876. the final file written has its last few hundred bytes in
  1877. cache when the file is closed but there are even fewer bytes
  1878. available on the FLASH. That would be rare with a cache
  1879. size of a few hundred bytes and very large serial FLASH.
  1880. This issue does cause the test at apps/testing/fstest to
  1881. fail. That test fails with a "Partial Read" because the
  1882. file being read is smaller than number bytes written to the
  1883. file. That test does write small files continuously until
  1884. file system is full and even the the error is rare. The
  1885. configs/sim/spiffs test can used to demonstrate the error.
  1886. Status: Open
  1887. Priority: Medium. It is certain a file system failure, but I think that
  1888. the exposure in real world uses cases is very small.
  1889. Title: FAT: CAN'T SEEK TO END OF FILE IF READ-ONLY
  1890. Description: If the size of the underlying file is an exact multiple of the
  1891. FAT cluster size, then you cannot seek to the end of the file
  1892. if the file was opened read-only. In that case, the FAT lseek
  1893. logic will return ENOSPC.
  1894. This is because seeking to the end of the file involves seeking
  1895. to an offset that is the size of the file (number of bytes
  1896. allocated for file + 1). In order to seek to a position, the
  1897. current FAT implementation insists that there be allocated file
  1898. space at the seek position. Seeking beyond the end of the file
  1899. has the side effect of extending the file.
  1900. [NOTE: This automatic extension of the file cluster allocation
  1901. is probably unnecessary and another issue of its own.]
  1902. For example, suppose you have a cluster size that is 4096 bytes
  1903. and a file that is 8192 bytes long. Then the file will consist
  1904. of 2 allocated clusters at offsets 0 through 8191.
  1905. If the file is opened O_RDWR or O_WRONLY, then the statement:
  1906. offset = lseek(fd, 0, SET_SEEK);
  1907. will seek to offset 8192 which beyond the end of the file so a
  1908. new (empty) cluster will be added. Now the file consists of
  1909. three clusters and the file position refers to the first byte of
  1910. the third cluster.
  1911. If the file is open O_RDONLY, however, then that same lseek
  1912. statement will fail. It is not possible to seek to position
  1913. 8192. That is beyond the end of the allocated cluster chain
  1914. and since the file is read-only, it is not permitted to extend
  1915. the cluster chain. Hence, the error ENOSPC is returned.
  1916. This code snippet will duplicate the problem. It assumes a
  1917. cluster size of 512 and that /tmp is a mounted FAT file system:
  1918. #define BUFSIZE 1024 //8192, depends on cluster size
  1919. static char buffer[BUFSIZE];
  1920. #if defined(BUILD_MODULE)
  1921. int main(int argc, FAR char *argv[])
  1922. #else
  1923. int hello_main(int argc, char *argv[])
  1924. #endif
  1925. {
  1926. ssize_t nwritten;
  1927. off_t pos;
  1928. int fd;
  1929. int ch;
  1930. int i;
  1931. for (i = 0, ch = ' '; i < BUFSIZE; i++)
  1932. {
  1933. buffer[i] = ch;
  1934. if (++ch == 0x7f)
  1935. {
  1936. ch = ' ';
  1937. }
  1938. }
  1939. fd = open("/tmp/testfile", O_WRONLY | O_CREAT | O_TRUNC, 0644);
  1940. if (fd < 0)
  1941. {
  1942. printf("open failed: %d\n", errno);
  1943. return 1;
  1944. }
  1945. nwritten = write(fd, buffer, BUFSIZE);
  1946. if (nwritten < 0)
  1947. {
  1948. printf("write failed: %d\n", errno);
  1949. return 1;
  1950. }
  1951. close(fd);
  1952. fd = open("/tmp/testfile", O_RDONLY);
  1953. if (fd < 0)
  1954. {
  1955. printf("open failed: %d\n", errno);
  1956. return 1;
  1957. }
  1958. pos = lseek(fd, 0, SEEK_END);
  1959. if (pos < 0)
  1960. {
  1961. printf("lseek failed: %d\n", errno);
  1962. return 1;
  1963. }
  1964. else if (pos != BUFSIZE)
  1965. {
  1966. printf("lseek failed: %d\n", pos);
  1967. return 1;
  1968. }
  1969. close(fd);
  1970. return 0;
  1971. }
  1972. Status: Open
  1973. Priority: Medium. Although this is a significant design error, the problem
  1974. has existed for 11 years without being previously reported. I
  1975. conclude, then that the exposure from this problem is not great.
  1976. Why would you seek to the end of a file using a read=only file
  1977. descriptor anyway? Only one reason I can think of: To get the
  1978. size of the file. The alternative (and much more efficient) way
  1979. to do that is via stat().
  1980. o Graphics Subsystem (graphics/)
  1981. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1982. See also the NxWidgets TODO list file for related issues.
  1983. Title: UNTESTED GRAPHICS APIS
  1984. Description: Testing of all APIs is not complete. See
  1985. http://nuttx.sourceforge.net/NXGraphicsSubsystem.html#testcoverage
  1986. Status: Open
  1987. Priority: Medium
  1988. Title: ITALIC FONTS / NEGATIVE FONT OFFSETS
  1989. Description: Font metric structure (in include/nuttx/nx/nxfont.h) should allow
  1990. negative X offsets. Negative x-offsets are necessary for certain
  1991. glyphs (and is very common in italic fonts).
  1992. For example Eth, icircumflex, idieresis, and oslash should have
  1993. offset=1 in the 40x49b font (these missing negative offsets are
  1994. NOTE'ed in the font header files).
  1995. Status: Open. The problem is that the x-offset is an unsigned bitfield
  1996. in the current structure.
  1997. Priority: Low.
  1998. Title: RAW WINDOW AUTORAISE
  1999. Description: Auto-raise only applies to NXTK windows. Shouldn't it also apply
  2000. to raw windows as well?
  2001. Status: Open
  2002. Priority: Low
  2003. Title: AUTO-RAISE DISABLED
  2004. Description: Auto-raise is currently disabled. The reason is complex:
  2005. - Most touchscreen controls send touch data a high rates
  2006. - In multi-server mode, touch events get queued in a message
  2007. queue.
  2008. - The logic that receives the messages performs the auto-raise.
  2009. But it can do stupid things after the first auto-raise as
  2010. it operates on the stale data in the message queue.
  2011. I am thinking that auto-raise ought to be removed from NuttX
  2012. and moved out into a graphics layer (like NxWM) that knows
  2013. more about the appropriate context to do the autoraise.
  2014. Status: Open
  2015. Priority: Medium low
  2016. Title: NxTERM VT100 SUPPORT
  2017. Description: If the NxTerm will be used with the Emacs-like command line
  2018. editor (CLE), then it will need to support VT100 cursor control
  2019. commands.
  2020. Status: Open
  2021. Priority: Low, the need has not yet arisen.
  2022. Title: VERTICAL ANTI-ALIASING
  2023. Description: Anti-aliasing is implemented along the horizontal raster line
  2024. with fractional pixels at the ends of each line. There is no
  2025. accounting for fractional pixels in the vertical direction.
  2026. As a result lines closer to vertical receive better anti-
  2027. aliasing than lines closer to horizontal.
  2028. Status: Open
  2029. Priority: Low, not a serious issue but worth noting. There is no plan
  2030. to change this behavior.
  2031. Title: WIDE-FONT SUPPORT
  2032. Description: Wide fonts are not currently supported by the NuttX graphics sub-
  2033. system.
  2034. Status: Open
  2035. Priority: Low for many, but I imagine higher in countries that use wide fonts
  2036. Title: LOW-RES FRAMEBUFFER RENDERING
  2037. Description: There are obvious issues in the low-res, < 8 BPP, implementation of
  2038. the framebuffer rendering logic of graphics/nxglib/fb. I see two
  2039. obvious problems in reviewing nxglib_copyrectangle():
  2040. 1. The masking logic might work 1 BPP, but is insufficient for other
  2041. resolutions like 2-BPP and 4-BPP.
  2042. 2. The use of lnlen will not handle multiple bits per pixel. It
  2043. would need to be converted to a byte count.
  2044. The function PDC_copy_glyph() in the file apps/graphics/pdcurs34/nuttx/pdcdisp.c
  2045. derives from nxglib_copyrectangle() and all of those issues have been
  2046. resolved in that file.
  2047. Other framebuffer rendering functions probably have similar issues.
  2048. Status: Open
  2049. Priority: Low. It is not surprising that there would be bugs in this logic:
  2050. I have never encountered a hardware framebuffer with sub-byte pixel
  2051. depth. If such a beast ever shows up, then this priority would be
  2052. higher.
  2053. Title: INCOMPLATE PLANAR COLOR SUPPORT
  2054. Description: The original NX design included support for planar colors,
  2055. i.e,. for devices that provide separate framebuffers for each
  2056. color component. Planar graphics hard was common some years
  2057. back but is rarely encountered today. In fact, I am not aware
  2058. of any MCU that implements planar framebuffers.
  2059. Support for planar colors is, however, unverified and
  2060. incomplete. In fact, many recent changes explicitly assume a
  2061. single color plane: Planar colors are specified by a array
  2062. of components; some recent logic uses only component [0],
  2063. ignoring the possible existence of other color componet frames.
  2064. Completely removing planar color support is one reasonable
  2065. options; it is not likely that NuttX will encounter planar
  2066. color hardware and this would greatly simplify the logic and
  2067. eliminate inconsistencies in the immplementation.
  2068. Status: Open
  2069. Priority: Low. There is no problem other than one of aesthetics.
  2070. o Build system
  2071. ^^^^^^^^^^^^
  2072. Title: MAKE EXPORT LIMITATIONS
  2073. Description: The top-level Makefile 'export' target that will bundle up all of the
  2074. NuttX libraries, header files, and the startup object into an export-able
  2075. tarball. This target uses the tools/mkexport.sh script. Issues:
  2076. 1. This script assumes the host archiver ar may not be appropriate for
  2077. non-GCC toolchains
  2078. 2. For the kernel build, the user libraries should be built into some
  2079. libuser.a. The list of user libraries would have to accepted with
  2080. some new argument, perhaps -u.
  2081. Status: Open
  2082. Priority: Low.
  2083. o Other drivers (drivers/)
  2084. ^^^^^^^^^^^^^^^^^^^^^^^^
  2085. Title: SYSLOG OUTPUT LOST ON A CRASH
  2086. Description: Flush syslog output on crash. I don't know how to do in the
  2087. character driver case with interrupts disabled. It would be
  2088. easy to flush the interrupt interrupt buffer, but not the
  2089. data buffered within a character driver (such as the serial
  2090. driver).
  2091. Perhaps there could be a crash dump IOCTL command to flush
  2092. that buffered data with interrupts disabled?
  2093. Status: Open
  2094. Priority: Low. It would be a convenience and would simplify crash
  2095. debug if you could see all of the SYSLOG output up to the
  2096. time of the crash. But not essential.
  2097. Title: SERIAL DRIVER WITH DMA DOES NOT DISCARD OOB CHARACTERS
  2098. Description: If Ctrl-Z or Ctrl-C actions are enabled, the the OOB
  2099. character that generates the signal action must not be placed
  2100. in the serial driver Rx buffer. This behavior is correct for
  2101. the non-DMA case (serial_io.c), but not for the DMA case
  2102. (serial_dma.c). In the DMA case, the OOB character is left
  2103. in the Rx buffer and will be received as normal Rx data by
  2104. the application. It should not work that way.
  2105. Perhaps in the DMA case, the OOB characters could be filtered
  2106. out later, just before returning the Rx data to the application?
  2107. Status: Open
  2108. Priority: Low, provided that the application can handle these characters
  2109. in the data stream.
  2110. o Linux/Cywgin simulation (arch/sim)
  2111. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2112. Title: SIMULATOR HAS NO INTERRUPTS (NON-PREMPTIBLE)
  2113. Description: The current simulator implementation is has no interrupts and, hence,
  2114. is non-preemptible. Also, without simulated interrupt, there can
  2115. be no high-fidelity simulated device drivers.
  2116. Currently, all timing and serial input is simulated in the IDLE loop:
  2117. When nothing is going on in the simulation, the IDLE loop runs and
  2118. fakes timer and UART events.
  2119. Status: Open
  2120. Priority: Low, unless there is a need for developing a higher fidelity simulation
  2121. I have been thinking about how to implement simulated interrupts in
  2122. the simulation. I think a solution would work like this:
  2123. http://www.nuttx.org/doku.php?id=wiki:nxinternal:simulator
  2124. Title: ROUND-ROBIN SCHEDULING IN THE SIMULATOR
  2125. Description: Since the simulation is not pre-emptible, you can't use round-robin
  2126. scheduling (no time slicing). Currently, the timer interrupts are
  2127. "faked" during IDLE loop processing and, as a result, there is no
  2128. task pre-emption because there are no asynchronous events. This could
  2129. probably be fixed if the "timer interrupt" were driver by Linux
  2130. signals. NOTE: You would also have to implement up_irq_save() and
  2131. up_irq_restore() to block and (conditionally) unblock the signal.
  2132. Status: Open
  2133. Priority: Low
  2134. Title: SMP SIMULATION ISSUES
  2135. Description: The configuration has basic support SMP testing. The simulation
  2136. supports the emulation of multiple CPUs by creating multiple
  2137. pthreads, each run a copy of the simulation in the same process
  2138. address space.
  2139. At present, the SMP simulation is not fully functional: It does
  2140. operate on the simulated CPU threads for a few context switches
  2141. then fails during a setjmp() operation. I suspect that this is
  2142. not an issue with the NuttX SMP logic but more likely some chaos
  2143. in the pthread controls. I have seen similar such strange behavior
  2144. other times that I have tried to use setjmp/longmp from a signal
  2145. handler! Like when I tried to implement simulated interrupts
  2146. using signals.
  2147. Apparently, if longjmp is invoked from the context of a signal
  2148. handler, the result is undefined:
  2149. http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1318.htm
  2150. You can enable SMP for ostest configuration by enabling:
  2151. -# CONFIG_EXPERIMENTAL is not set
  2152. +CONFIG_EXPERIMENTAL=y
  2153. +CONFIG_SPINLOCK=y
  2154. +CONFIG_SMP=y
  2155. +CONFIG_SMP_NCPUS=2
  2156. +CONFIG_SMP_IDLETHREAD_STACKSIZE=2048
  2157. You also must enable near-realtime-performance otherwise even long
  2158. timeouts will expire before a CPU thread even has a chance to
  2159. execute.
  2160. -# CONFIG_SIM_WALLTIME is not set
  2161. +CONFIG_SIM_WALLTIME=y
  2162. And you can enable some additional debug output with:
  2163. -# CONFIG_DEBUG_SCHED is not set
  2164. +CONFIG_DEBUG_SCHED=y
  2165. -# CONFIG_SCHED_INSTRUMENTATION is not set
  2166. +CONFIG_SCHED_INSTRUMENTATION=y
  2167. The NSH configuration can also be forced to run SMP, but
  2168. suffers from the same quirky behavior. I can be made
  2169. reliable if you modify arch/sim/src/up_idle.c so that
  2170. the IDLE loop only runs for CPU0. Otherwise, often
  2171. simuart_post() will be called from CPU1 and it will try
  2172. to restart NSH on CPU0 and, again, the same quirkiness
  2173. occurs.
  2174. But for example, this command:
  2175. nsh> sleep 1 &
  2176. will execute the sleep command on CPU1 which has worked
  2177. every time that I have tried it (which is not too many
  2178. times).
  2179. Status: Open
  2180. Priority: Low, SMP is important, but SMP on the simulator is not
  2181. o ARM (arch/arm/)
  2182. ^^^^^^^^^^^^^^^
  2183. Title: IMPROVED ARM INTERRUPT HANDLING
  2184. Description: ARM interrupt handling performance could be improved in some
  2185. ways. One easy way is to use a pointer to the context save
  2186. area in g_current_regs instead of using up_copystate so much.
  2187. This approach is already implemented for the ARM Cortex-M0,
  2188. Cortex-M3, Cortex-M4, and Cortex-A5 families. But still needs
  2189. to be back-ported to the ARM7 and ARM9 (which are nearly
  2190. identical to the Cortex-A5 in this regard). The change is
  2191. *very* simple for this architecture, but not implemented.
  2192. Status: Open. But complete on all ARM platforms except ARM7 and ARM9.
  2193. Priority: Low.
  2194. Title: IMPROVED ARM INTERRUPT HANDLING
  2195. Description: The ARM and Cortex-M3 interrupt handlers restores all registers
  2196. upon return. This could be improved as well: If there is no
  2197. context switch, then the static registers need not be restored
  2198. because they will not be modified by the called C code.
  2199. (see arch/renesas/src/sh1/sh1_vector.S for example)
  2200. Status: Open
  2201. Priority: Low
  2202. Title: CORTEX-M3 STACK OVERFLOW
  2203. Description: There is bit bit logic in up_fullcontextrestore() that executes on
  2204. return from interrupts (and other context switches) that looks like:
  2205. ldr r1, [r0, #(4*REG_CPSR)] /* Fetch the stored CPSR value */
  2206. msr cpsr, r1 /* Set the CPSR */
  2207. /* Now recover r0 and r1 */
  2208. ldr r0, [sp]
  2209. ldr r1, [sp, #4]
  2210. add sp, sp, #(2*4)
  2211. /* Then return to the address at the stop of the stack,
  2212. * destroying the stack frame
  2213. */
  2214. ldr pc, [sp], #4
  2215. Under conditions of excessively high interrupt conditions, many
  2216. nested interrupts can occur just after the 'msr cpsr' instruction.
  2217. At that time, there are 4 bytes on the stack and, with each
  2218. interrupt, the stack pointer may increment and possibly overflow.
  2219. This can happen only under conditions of continuous interrupts.
  2220. One suggested change is:
  2221. ldr r1, [r0, #(4*REG_CPSR)] /* Fetch the stored CPSR value */
  2222. msr spsr_cxsf, r1 /* Set the CPSR */
  2223. ldmia r0, {r0-r15}^
  2224. But this has not been proven to be a solution.
  2225. UPDATE: Other ARM architectures have a similar issue.
  2226. Status: Open
  2227. Priority: Low. The conditions of continuous interrupts is really the problem.
  2228. If your design needs continuous interrupts like this, please try
  2229. the above change and, please, submit a patch with the working fix.
  2230. Title: IMPROVED TASK START-UP AND SYSCALL RETURN
  2231. Description: Couldn't up_start_task and up_start_pthread syscalls be
  2232. eliminated. Wouldn't this work to get us from kernel-
  2233. to user-mode with a system trap:
  2234. lda r13, #address
  2235. str rn, [r13]
  2236. msr spsr_SVC, rm
  2237. ld r13,{r15}^
  2238. Would also need to set r13_USER and r14_USER. For new
  2239. SYS_context_switch... couldn't we do he same thing?
  2240. Also... System calls use traps to get from user- to kernel-
  2241. mode to perform OS services. That is necessary to get from
  2242. user- to kernel-mode. But then another trap is used to get
  2243. from kernel- back to user-mode. It seems like this second
  2244. trap should be unnecessary. We should be able to do the
  2245. same kind of logic to do this.
  2246. Status: Open
  2247. Priority: Low-ish, but a good opportunity for performance improvement.
  2248. Title: USE COMMON VECTOR LOGIC IN ALL ARM ARCHITECTURES.
  2249. Description: Originally, each ARMv7-M MCU architecture had its own
  2250. private implementation for interrupt vectors and interrupt
  2251. handling logic. This was superceded by common interrupt
  2252. vector logic but these private implementations were never
  2253. removed from older MCU architectures. This is turning into
  2254. a maintenance issue because any improvements to the common
  2255. vector handling must also be re-implemented for each of the
  2256. older MCU architectures.
  2257. Status: Open
  2258. Priority: Low. A pain in the ass and an annoying implementation, but
  2259. not really an issue otherwise.
  2260. o Network Utilities (apps/netutils/)
  2261. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2262. Title: UNVERIFIED THTTPD FEATURES
  2263. Description: Not all THTTPD features/options have been verified. In
  2264. particular, there is no test case of a CGI program receiving
  2265. POST input. Only the configuration of apps/examples/thttpd
  2266. has been tested.
  2267. Status: Open
  2268. Priority: Medium
  2269. o NuttShell (NSH) (apps/nshlib)
  2270. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2271. Title: IFCONFIG AND MULTIPLE NETWORK INTERFACES
  2272. Description: The ifconfig command will not behave correctly if an interface
  2273. is provided and there are multiple interfaces. It should only
  2274. show status for the single interface on the command line; it will
  2275. still show status for all interfaces.
  2276. Status: Open
  2277. Priority: Low
  2278. o System libraries apps/system (apps/system)
  2279. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2280. Title: READLINE IMPLEMENTATION
  2281. Description: readline implementation does not use C-buffered I/O, but rather
  2282. talks to serial driver directly via read(). It includes VT-100
  2283. specific editing commands. A more generic readline() should be
  2284. implemented using termios' tcsetattr() to put the serial driver
  2285. into a "raw" mode.
  2286. Status: Open
  2287. Priority: Low (unless you are using mixed C-buffered I/O with readline and
  2288. fgetc, for example).
  2289. o Modbus (apps/modbus)
  2290. ^^^^^^^^^^^^^^^^^^^^
  2291. Title: MODBUS NOT USABLE WITH USB SERIAL
  2292. Description: Modbus can be used with USB serial, however, if the USB
  2293. serial connection is lost, Modbus will hang in an infinite
  2294. loop.
  2295. This is a problem in the handling of select() and read()
  2296. and could probably resolved by studying the Modbus error
  2297. handling.
  2298. A more USB-friendly solution would be to: (1) Re-connect and
  2299. (2) re-open the serial drviers. That is what is done is NSH.
  2300. When the serial USB device is removed, this terminates the
  2301. session and NSH will then try to re-open the USB device. See
  2302. the function nsh_waitusbready() in the file
  2303. apps/nshlib/nsh_usbconsole.c. When the USB serial is
  2304. reconnected the open() in the function will succeed and a new
  2305. session will be started.
  2306. Status: Open
  2307. Priority: Low. This is really an enhancement request: Modbus was never
  2308. designed to work with removable serial devices.
  2309. o Pascal Add-On (pcode/)
  2310. ^^^^^^^^^^^^^^^^^^^^^^
  2311. Title: P-CODES IN MEMORY UNTESTED
  2312. Description: Need APIs to verify execution of P-Code from memory buffer.
  2313. Status: Open
  2314. Priority: Low
  2315. Title: SMALLER LOADER AND OBJECT FORMAT
  2316. Description: Loader and object format may be too large for some small
  2317. memory systems. Consider ways to reduce memory footprint.
  2318. Status: Open
  2319. Priority: Medium
  2320. Title: PDBG
  2321. Description: Move the pascal p-code debugger into the NuttX apps/ tree
  2322. where it can be used from the NSH command line.
  2323. Status: Open
  2324. Priority: Low
  2325. o Other Applications & Tests (apps/examples/)
  2326. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2327. Title: EXAMPLES/PIPE ON CYGWIN
  2328. Description: The redirection test (part of examples/pipe) terminates
  2329. incorrectly on the Cywgin-based simulation platform (but works
  2330. fine on the Linux-based simulation platform).
  2331. Status: Open
  2332. Priority: Low
  2333. Title: EXAMPLES/SENDMAIL UNTESTED
  2334. Description: examples/sendmail is untested on the target (it has been tested
  2335. on the host, but not on the target).
  2336. Status: Open
  2337. Priority: Med
  2338. Title: EXAMPLES/NX FONT CACHING
  2339. Description: The font caching logic in examples/nx is incomplete. Fonts are
  2340. added to the cache, but never removed. When the cache is full
  2341. it stops rendering. This is not a problem for the examples/nx
  2342. code because it uses so few fonts, but if the logic were
  2343. leveraged for more general purposes, it would be a problem.
  2344. Update: see examples/nxtext for some improved font cache handling.
  2345. Update: The NXTERM font cache has been generalized and is now
  2346. offered as the standard, common font cache for all applications.
  2347. both the nx and nxtext examples should be modified to use this
  2348. common font cache. See interfaces defined in nxfonts.h.
  2349. Status: Open
  2350. Priority: Low. This is not really a problem because examples/nx works
  2351. fine with its bogus font caching.
  2352. Title: EXAMPLES/NXTEXT ARTIFACTS
  2353. Description: examples/nxtext. Artifacts when the pop-up window is opened.
  2354. There are some artifacts that appear in the upper left hand
  2355. corner. These seems to be related to window creation. At
  2356. tiny artifact would not be surprising (the initial window
  2357. should like at (0,0) and be of size (1,1)), but sometimes
  2358. the artifact is larger.
  2359. Status: Open
  2360. Priority: Medium.