Arduino icon indicating copy to clipboard operation
Arduino copied to clipboard

OSX Serial Monitor crashes the IDE

Open gitcnd opened this issue 6 years ago • 15 comments

If the monitor is left open while lots is printing, Arduino IDE needs to be force-quit.

This is almost certainly a memory leak or some other kind of memory management mistake that needs to be fixed.

gitcnd avatar Nov 29 '18 02:11 gitcnd

Hi @gitcnd , which version of the IDE are you using? OSX version too would be useful.

facchinm avatar Nov 29 '18 08:11 facchinm

1.8.7 on 10.13.6

I could probably fix this myself - and I do happen to want to add a feature (ability for the Serial-Plotter to also write data to a log file).

If you're busy with other stuff and just want to point me at where to start on both the above, I can probably send over some diffs of a fix.

gitcnd avatar Nov 29 '18 10:11 gitcnd

Maybe related to the long-presumed fixed #2233 issue? That difficult issue was really 2 related problems, using too much CPU time to keep up with real-time data, and allocating too much memory. New features like timestamps have been added. Maybe they're increasing the CPU load?

Any chance you could tell us which board you're using and maybe even share the code which sends too much data?

PaulStoffregen avatar Nov 29 '18 10:11 PaulStoffregen

Arduino Nano with the elcheapo serial chip (CH340G I think?)

Loads of things break the IDE - the latest was a simple loop doing a println() on a pair of ints at pretty-much the fastest speed it can do. After about 3 or 4 mins - force-quit is the only escape. Exactly the same problem on a second mac I own with an older OSX and and older IDE (maybe worse even - hosed the whole OS yesterday, and I had to reboot).

I connect at 115200 baud.

Funny you mention the timestamps - they don't work (does absolutely nothing when I select that). Maybe there's a clue?

gitcnd avatar Nov 29 '18 11:11 gitcnd

p.s. having a feature to log to disk is desperately needed in both the monitor and the plotter...

gitcnd avatar Nov 29 '18 11:11 gitcnd

Funny you mention the timestamps - they don't work (does absolutely nothing when I select that). Maybe there's a clue?

There's a known bug with the Serial Monitor timestamp feature in Arduino IDE 1.8.7: https://github.com/arduino/Arduino/issues/8055 That has been fixed since the 1.8.7 release.

It's best to test with the hourly build of the Arduino IDE to make sure the bug hasn't already been fixed: https://www.arduino.cc/en/Main/Software#hourly

per1234 avatar Nov 29 '18 11:11 per1234

@gitcnd did you ever get a chance to test with the hourly build of the Arduino IDE? If so, does the bug still occur?

per1234 avatar Mar 26 '19 05:03 per1234

I have used every build since 1.8.8 and the monitor still hangs the IDE - I have projects I run overnight and if you really want to see it crash quickly hide the monitor.

ldalep avatar Apr 07 '19 15:04 ldalep

@ldalep Thanks for your input!

I have used every build since 1.8.8 Does that mean you tried the latest hourly build of the Arduino IDE and the beta build too?

Are you using OS X/macOS?

per1234 avatar Apr 07 '19 15:04 per1234

High Sierra Mac OS - yes last one was April 3??? 1.8.10

Sent from my iPhone

On Apr 7, 2019, at 9:42 AM, per1234 [email protected] wrote:

@ldalep Thanks for your input!

I have used every build since 1.8.8 Does that mean you tried the latest hourly build of the Arduino IDE and the beta build too?

Are you using OS X/macOS?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

ldalep avatar Apr 07 '19 16:04 ldalep

Same problem here, with Arduino 1.8.10 on macOS Sierra.

IDE and Console completely irresponsive, and top shows excessively high CPU load of Arduino process, while memory usage is moderate (500MB after startup, 700MB when crash happens).

Im my case the software on serial console (on an ESP32) is producing about 30-40 lines of log messages per second, and the problem starts after running for about 20-25 minutes. Problem rises gradually after about 20 minutes, i.e. first the console is slow and e.g., clicking close will still close the console window (after a delay of some seconds). Just shortly after that, its completely frozen. Total amount of data sent via serial console is maybe 3-4 MB, so most likely way below the 8M limit where TextAreaFIFO starts dropping old data.

dl9rdz avatar Dec 11 '19 12:12 dl9rdz

Same problem with macOS Catalina 10.15.3, and Arduino 1.8.11

  • Serial detection works (however openning the tools menu always takes about 5secs).
  • Upload also works.
  • Serial monitor/serial plotter crashes the gui, that brings up the send-to-apple report window. Tested with FTDI breakout adapter. (Serial monitor works with PlatformIO on the same setup.)

prampec avatar Feb 04 '20 09:02 prampec

Same here with macOS Catalina 10.15.3 and Arduino 1.8.11 or 1.8.12.

crapougnax avatar Mar 07 '20 15:03 crapougnax

Same here with macOS Catalina 10.15.5 and Arduino 1.8.12.

shamal69 avatar May 31 '20 06:05 shamal69

Seems the issue still occurs, I'm using macOS Mojave 10.14.6 and Arduino 1.8.16. It (almost?) always happens when the serial monitor is open and I try to flash a sketch. Sometimes this fails (with varying errors) and for some reason the serial monitor is then sometimes continuously receiving a lot of garbage (likely due to the initial baud rate of the board being different than what I set in the sketch), which seems to cause the hang.

I would use an hourly build but it seems the most recent one is from April, while the release build is from September. :>

GottemHams avatar Dec 12 '21 14:12 GottemHams