TODO 142 KB

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