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

Random memory leak when typing Chinese comments in my sketch #144

Open
3 tasks done
Ebola-Chan-bot opened this issue Dec 24, 2022 · 4 comments
Open
3 tasks done

Random memory leak when typing Chinese comments in my sketch #144

Ebola-Chan-bot opened this issue Dec 24, 2022 · 4 comments
Labels
type: imperfection Perceived defect in any part of project

Comments

@Ebola-Chan-bot
Copy link

Ebola-Chan-bot commented Dec 24, 2022

Describe the problem

When I type Chinese comments in my sketch, severe memory leak occurs randomly in the arduino-language-server process.
image

To reproduce

Since the issue occurs randomly, there are no steps to 100% reproduce. But after some fumbling, I found a way to reproduce with the greatest probability:

  1. Open my sketch with Arduino IDE v2.0.3, and switch to IStepTrial.h
  2. Open Task Manager and monitor the memory footprint of arduino-language-server.
  3. Use the Microsoft Pinyin input method to type the comment text on line 16 as it is on line 17. Note that keyboard input is required, not copy-paste. You will most likely observe a memory explosion before you finish this line.
    image

Gbec.zip

I have tried some of other sketches and they were all less likely to trigger this issue than my sketch. I offer my sketch here so that you may easily reproduce the issue.

Expected behavior

The Arduino code language may not have plans to support Chinese, but I don't think there should be a serious problem like a memory leak just because of a few lines of Chinese comments anyway.

Arduino Language Server version

0.7.2

Arduino CLI version

0.29.0

Operating system

Windows

Operating system version

Win11 22H2, Win10

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest version
  • My report contains all necessary details
@Ebola-Chan-bot Ebola-Chan-bot added the type: imperfection Perceived defect in any part of project label Dec 24, 2022
@Ebola-Chan-bot
Copy link
Author

This issue has been extremely rare in recent releases. While not sure where the update happened to fix this issue as a side effect?

@14725
Copy link

14725 commented Feb 5, 2024

It is rare but still happens. However it seemed to triggered the OOM Killer of my Ubuntu...

Keeping track on this issue...


版本:2.2.1
日期:2023-08-31T14:16:33.536Z
CLI 版本:0.34.0

Copyright © 2024 Arduino SA
Arduino AVR Boards 1.8.6

I'm using the AppImage release of Arduino.

@14725
Copy link

14725 commented Feb 5, 2024

It can be reproduced easily with the Arduino version mentioned above and a script to type "啊" (I have run it 3 times. ).

  //此方法不是必须实现。如果你的步骤是即时步骤,无需实现此方法,因为即时步骤立即完成,不会被暂停。但如果是延时步骤,建议实现此方法以支持暂停。

->

//啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊此方法不是必须实现。如果你的步骤是即时步骤,无需实现此方法,因为即时步骤立即完成,不会被暂停。但如果是延时步骤,建议实现此方法以支持暂停。

~8MB -> ~300MB -> ~79.2MB

core_arduino_lang_serv.zip

Core dumps, maybe helpful to some hackers. (Warning: ZIP Bomb! ),

How about reopen it ?

@Ebola-Chan-bot
Copy link
Author

@14725 Thanks for your attention. The probability of this problem seems to have increased again in recent versions. Since I'm not the only one experiencing this problem, I think I can really reopen it.
BTW, I don't know if any of the developers and maintainers of this repository know Chinese, and if not, I'm afraid it will be difficult for them to reproduce this problem. 😓

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

2 participants