You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/06/01 13:26:35 UTC

[GitHub] [incubator-nuttx] patacongo opened a new pull request #1167: drivers/serial/pty.c: Correct returned number of bytes.

patacongo opened a new pull request #1167:
URL: https://github.com/apache/incubator-nuttx/pull/1167


   ## Summary
   
   Reported by 권석근 <kw...@gmail.com>:
   
   I found a bug at "pty.c" during ssh server implementation.
   
   When I turn on CONFIG_SERIAL_TERMIOS and OPOST|ONLCR on pty device
   for nsh console's stdin/stdout (ssh shell service), I've got system crash.
   
   Bugs at line 687 of pty.c, pty_write()
   ntotal++;
   
   when converting '\n' to '\r\n', pty_write() will return more than requested
   (+1, for example) length. and this will break caller lib_fflush(), line 150
   of lib_libfflush.c.
   When she get (libfflush()) bytes_nwritten which is greater than nbuffer,
   nbuffer goes to negative at line 150 and eventually destroys
   *stream->fs_bufpos at line 163 of lib_libflush.c
   
   Removing ntotal++;  line 687 of pty.c will fix this bug.
   
   BTW, nsh using ptm/pty as a ssh shell service works great with libssh +
   mbedtls.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #1167: drivers/serial/pty.c: Correct returned number of bytes.

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #1167:
URL: https://github.com/apache/incubator-nuttx/pull/1167#issuecomment-636873366


   It is strange that x86_64 platform include the host glibc header:
   ```
   /usr/lib/gcc/x86_64-linux-gnu/8/include/mm_malloc.h
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] sonicyang commented on pull request #1167: drivers/serial/pty.c: Correct returned number of bytes.

Posted by GitBox <gi...@apache.org>.
sonicyang commented on pull request #1167:
URL: https://github.com/apache/incubator-nuttx/pull/1167#issuecomment-638101424


   I am sorry, I haven't though that including that will results this kind of side-effect.
   
   I should have written an stub ASM for accessing RDRAND, instead relaying on GCC intrinsic. 
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] patacongo commented on pull request #1167: drivers/serial/pty.c: Correct returned number of bytes.

Posted by GitBox <gi...@apache.org>.
patacongo commented on pull request #1167:
URL: https://github.com/apache/incubator-nuttx/pull/1167#issuecomment-636871168


   The build failed because of this in qemu-intel64:nsh
   
       /usr/lib/gcc/x86_64-linux-gnu/8/include/mm_malloc.h:32:12: error: expected identifier or '(' before 'void'
        extern int posix_memalign (void **, size_t, size_t);
                   ^~~~~~~~~~~~~~
       /usr/lib/gcc/x86_64-linux-gnu/8/include/mm_malloc.h:32:12: error: expected ')' before '=' token
        extern int posix_memalign (void **, size_t, size_t);
                   ^~~~~~~~~~~~~~
       /usr/lib/gcc/x86_64-linux-gnu/8/include/mm_malloc.h:32:12: error: expected ')' before '?' token
        extern int posix_memalign (void **, size_t, size_t);
                   ^~~~~~~~~~~~~~
   
   @xiaoxiang781216 This looks like breakage from PR #1164


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #1167: drivers/serial/pty.c: Correct returned number of bytes.

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #1167:
URL: https://github.com/apache/incubator-nuttx/pull/1167#issuecomment-636881086


   > #1164 passes all of its checks. So it is not clear why this is showing up now. I assume that this will break all PR checks.
   
   Because x86_64 check enable just after #1169 send out:
   https://github.com/apache/incubator-nuttx-testing/pull/43


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 edited a comment on pull request #1167: drivers/serial/pty.c: Correct returned number of bytes.

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 edited a comment on pull request #1167:
URL: https://github.com/apache/incubator-nuttx/pull/1167#issuecomment-636873366


   @btashton and @sonicyang It is strange that x86_64 platform include the host glibc header:
   ```
   /usr/lib/gcc/x86_64-linux-gnu/8/include/mm_malloc.h
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #1167: drivers/serial/pty.c: Correct returned number of bytes.

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #1167:
URL: https://github.com/apache/incubator-nuttx/pull/1167#issuecomment-636879657


   Should be fixed by this patch:
   https://github.com/apache/incubator-nuttx/pull/1169


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] Ouss4 merged pull request #1167: drivers/serial/pty.c: Correct returned number of bytes.

Posted by GitBox <gi...@apache.org>.
Ouss4 merged pull request #1167:
URL: https://github.com/apache/incubator-nuttx/pull/1167


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] patacongo commented on pull request #1167: drivers/serial/pty.c: Correct returned number of bytes.

Posted by GitBox <gi...@apache.org>.
patacongo commented on pull request #1167:
URL: https://github.com/apache/incubator-nuttx/pull/1167#issuecomment-636877881


   #1164 passes all of its checks.  So it is not clear why this is showing up now.  I assume that this will break all PR checks.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org