arduino / arduino/Arduino

Failure to create ~/.jssc directory is not properly reported

Open
#7,517 3 comments 1 reaction 0 assignees View on GitHub
Component: IDE Serial monitor feature request Type: Bug
Dominant language
Java
Stars
14.6k
Forks
7k
PR merge metrics
No merged PRs in 30d

Description

For the serial monitor, the JSSC library is used. On linux (and possibly other OS's as well), this requires a small native library, which is automatically unpacked from the .jar file into the `~/.jssc` directory. However, when this unpacking fails, not message is shown about that. Instead, an exception is thrown and logged when opening the serial monitor:

Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: jssc.SerialNativeInterface.openPort(Ljava/lang/String;Z)J

This can be reproduced by removing `~/.jssc` and replacing it with a regular file or broken symlink. Removing permissions on the directory (which might happen when somebody runs the IDE as root) will probably also trigger it.

It would be better if the actual problem would be reported, so the user can act on that, instead of just showing the linkage error which is just a secondary symptom.

This is a followup issue for #7516, which was about the linkage error shown above (it also has a more complete backtrace).

Contributor guide

Open the contributing guide

Research direction

Start at the serial monitor's JSSC native-library unpacking and reproduce the failure by replacing ~/.jssc with a file or broken symlink. Trace how the failure reaches serial-port opening; done means the underlying unpacking problem is reported clearly instead of only showing UnsatisfiedLinkError.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
desktop, embedded-iot
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.