Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: 运行ls命令,串口输出会显示两次结果 #45

Open
fslongjin opened this issue Sep 28, 2024 · 1 comment
Open

bug: 运行ls命令,串口输出会显示两次结果 #45

fslongjin opened this issue Sep 28, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@fslongjin
Copy link
Member

有问题的版本: cac674d

经验证,问题从 5b85994 之后出现了。

image

@fslongjin fslongjin added the bug Something isn't working label Sep 28, 2024
@MemoryShore
Copy link
Collaborator

MemoryShore commented Sep 28, 2024

调试过程

经过调试发现,如果在创建子进程前关闭了raw模式,就会出现ls命令重复输出的现象,因为 5b85994 版本修复了exec前未关闭raw模式的bug,所以 5b85994 之后的版本才会出现这个问题

注释掉关闭raw模式的代码,串口输出正常:
image
image

原因推测

为排除NovaShell的影响,直接修改init程序为ls,并在write系统调用中打印日志:
image

image

输出结果:
image

image

可以发现只进行了一次write系统调用,可以排除应用程序的问题,推测是串口或者tty的问题
@fslongjin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants