Arduino fails to start: undefined symbol: sp_get_port_usb_vid_pid

Bug #1916278 reported by Hans Joachim Desserud
102
This bug affects 21 people
Affects Status Importance Assigned to Milestone
arduino (Ubuntu)
Confirmed
Undecided
Unassigned
listserialportsc (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

How to reproduce:
1. Run `arduino`
2. A window pops up stating "you need to be added to the dialout group"
3. Click add. At this point, a system dialog pops up. Confirm with your password.
4. When authenticated, watch the Arduino splash screen and wait a while.

Expected:
Arduino launches

Actual:
It fails to start with an error message indicating undefined symbol:
$ arduino
No required groups are missing for this user.
Picked up JAVA_TOOL_OPTIONS:
java.lang.UnsatisfiedLinkError: /usr/lib/x86_64-linux-gnu/liblistSerialsj.so.1.4.0: /usr/lib/x86_64-linux-gnu/liblistSerialsj.so.1.4.0: undefined symbol: sp_get_port_usb_vid_pid
 at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
 at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
 at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
 at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
 at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2659)
 at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830)
 at java.base/java.lang.System.loadLibrary(System.java:1873)
 at processing.app.Platform.<clinit>(Platform.java:144)
 at java.base/java.lang.Class.forName0(Native Method)
 at java.base/java.lang.Class.forName(Class.java:315)
 at processing.app.BaseNoGui.initPlatform(BaseNoGui.java:514)
 at processing.app.Base.<init>(Base.java:201)
 at processing.app.Base.main(Base.java:141)

I am not sure exactly what is causing this issue. I was unable to reacreate it on Debian Sid.

ProblemType: Bug
DistroRelease: Ubuntu 21.04
Package: arduino 2:1.8.13+dfsg1-1
ProcVersionSignature: Ubuntu 5.8.0-36.40+21.04.1-generic 5.8.18
Uname: Linux 5.8.0-36-generic x86_64
ApportVersion: 2.20.11-0ubuntu59
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: ubuntu:GNOME
Date: Fri Feb 19 19:07:33 2021
InstallationDate: Installed on 2020-11-05 (106 days ago)
InstallationMedia: Ubuntu 21.04 "Hirsute Hippo" - Alpha amd64 (20201105)
SourcePackage: arduino
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Hans Joachim Desserud (hjd) wrote :
Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Fwiw, I tried to rebuild the package locally in case it would pick up new symbols, but I still get the same error message.

Revision history for this message
David Coe (hooligan-red) wrote : [Bug 1916278] [NEW] Arduino fails to start: undefined symbol: sp_get_port_usb_vid_pid

Same problem here on the alpha Hirsute Hippo :-). Suspect package
liblistserialsj1 needs attention.

Download version 1.8.13 direct from Arduino. That works fine!

--
David Coe

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Thanks for checking, I've marked listserialportsc as also affected. :)

Changed in arduino (Ubuntu):
status: New → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in listserialportsc (Ubuntu):
status: New → Confirmed
Revision history for this message
inugami (inugami-mamoru) wrote :

This bug still exist Xubuntu 21.04RC.

Revision history for this message
David Coe (hooligan-red) wrote :

Alas, the bug is still there in the just-released Kubuntu 21.04.

Revision history for this message
William Page (datapath) wrote :

I have validated the following on Ubuntu 21.04 (vanilla, upgraded from 20.10, using the gnome DE instead of Ubuntu):

* The Arduino application fails while loading /usr/lib/x86_64-linux-gnu/liblistSerialsj.so.1.4.0 due to undefined symbol: sp_get_port_usb_vid_pid
* Running 'nm -D /usr/lib/x86_64-linux-gnu/liblistSerialsj.so.1.4.0' shows 'U sp_get_port_usb_vid_pid", meaning that that library depends on that symbol, but doesn't provide it
* Running 'ldd /usr/lib/x86_64-linux-gnu/liblistSerialsj.so.1.4.0' doesn't list any dependencies that provide the missing symbol
* Installing the package listserialportsc and running "listserialportsc" works
* Running 'nm -D /usr/bin/listserialportsc' also shows 'U sp_get_port_usb_vid_pid'
* Running 'ldd /usr/bin/listserialportsc' lists 'libserialport.so.0 => /lib/x86_64-linux-gnu/libserialport.so.0 (0x00007f610efaa000)'
* Running 'nm -D /lib/x86_64-linux-gnu/libserialport.so.0' prints '0000000000002700 T sp_get_port_usb_vid_pid' indicating that that library provides the missing symbol
* Patching liblistSerialsj.so.1.4.0 so that it specifies an ELF dependency on libserialport.so.0 provides the missing symbol and allows the application to start as expected
* This patching can be performed by running 'sudo patchelf --add-needed libserialport.so.0 liblistSerialsj.so.1.4.0' (recommended to back up the original library beforehand, e.g. sudo cp liblistSerialsj.so.1.4.0 liblistSerialsj.so.1.4.0.orig)

Looking at the build scripts in the listSerialPortsC project, I suspect things were mis-translated going into the Ubuntu build process - the build scripts "vendor-in" the .c files with the required symbols rather than using a dynamic-link dependency on the libserialport.so library. If the debian package for liblistSerialsj is compiling the project sources without either adding -Lserialport to the compile/link line or vendoring in those sources, that would explain the issue.

Revision history for this message
inugami (inugami-mamoru) wrote :

I could run arduinoIDE

sudo apt install libserial0

sudo patchelf --add-needed libserialport.so.0 liblistSerialsj.so.1.4.0

Revision history for this message
François Pernoud (francois-pernoud) wrote :

I could run arduinoIDE on Ubuntu 21.04 after uninstalling package from Ubuntu depot (version 1.8.13) and installing the one from https://www.arduino.cc/

Revision history for this message
Uğur Çetin (ugur-jnmbk) wrote :

I also could run it using commands from @inugami and modifying them a little

sudo apt install libserialport0 patchelf

sudo patchelf --add-needed /usr/lib/x86_64-linux-gnu/libserialport.so.0 /usr/lib/x86_64-linux-gnu/liblistSerialsj.so.1.4.0

Revision history for this message
slc66 (slc66) wrote :

@ugur-jnmbk This workaround works on Ubuntu 21.04 Wayland and Xorg.

Thanks a lot.

Revision history for this message
Piotr Henryk Dabrowski (phd) wrote :

This bug still affects Arduino IDE 1.8.13 package in Ubuntu 21.04.

Revision history for this message
Anonymous User (hippaponymous) wrote :

Confirming:

 1. This bug still affects Arduino IDE 1.8.13 package in Ubuntu 21.04.
 2. The workaround from @ugur-jnmbk works.

Revision history for this message
Joe Smith (joesmith32158976) wrote :
Download full text (3.6 KiB)

Hello,

This is still happenning, installed arduino yesterday

This is a fresh and updated install of lubuntu 21.04

Here is the error

shodan@ibm:~$ arduino
Picked up JAVA_TOOL_OPTIONS:
java.lang.UnsatisfiedLinkError: /usr/lib/x86_64-linux-gnu/liblistSerialsj.so.1.4.0: /usr/lib/x86_64-linux-gnu/liblistSerialsj.so.1.4.0: undefined symbol: sp_get_port_usb_vid_pid
        at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
        at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
        at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
        at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
        at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2659)
        at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830)
        at java.base/java.lang.System.loadLibrary(System.java:1873)
        at processing.app.Platform.<clinit>(Platform.java:144)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:315)
        at processing.app.BaseNoGui.initPlatform(BaseNoGui.java:514)
        at processing.app.Base.<init>(Base.java:201)
        at processing.app.Base.main(Base.java:141)

shodan@ibm:~$ apt info arduino
Package: arduino
Version: 2:1.8.13+dfsg1-2
Priority: optional
Section: universe/electronics
Origin: Ubuntu
Maintainer: Ubuntu Developers <email address hidden>
Original-Maintainer: Debian Electronics Team <email address hidden>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 9,106 kB
Provides: arduino-core
Depends: arduino-builder (>= 1.3.25-2), arduino-core-avr, avrdude, default-jre | openjdk-11-jre, dpkg-dev, libastylej-jni, libbatik-java, libbcpg-java, libbcprov-java, libcommons-codec-java, libcommons-compress-java, libcommons-exec-java, libcommons-io-java, libcommons-lang3-java, libcommons-logging-java, libcommons-net-java, libhttpclient-java, libjackson2-annotations-java, libjackson2-core-java, libjackson2-databind-java, libjaxp1.3-java, libjmdns-java, libjna-java, libjna-platform-java, libjsch-java, libjssc-java, liblistserialsj-dev, liblog4j2-java, librsyntaxtextarea-java, librxtx-java, libsemver-java, libslf4j-java, libxml-commons-external-java, libxmlgraphics-commons-java
Recommends: extra-xdg-menus, policykit-1
Breaks: arduino-core (<< 2:1.5.6.2+sdfsg2-3.1)
Replaces: arduino-core (<< 2:1.5.6.2+sdfsg2-3.1)
Homepage: https://www.arduino.cc
Download-Size: 4,867 kB
APT-Manual-Installed: yes
APT-Sources: http://archive.ubuntu.com/ubuntu hirsute/universe amd64 Packages
Description: AVR development board IDE from Arduino CC
 Arduino is an open-source electronics prototyping platform based on
 flexible, easy-to-use hardware and software. It's intended for artists,
 designers, hobbyists, and anyone interested in creating interactive
 objects or environments.
 .
 This package will install the integrated development environment that
 allows for program writing, code verification, compiling, and uploading
 to the Arduino development board. Example code will also be installed.
 .
 Some base AVR libraries w...

Read more...

Revision history for this message
Piotr Henryk Dabrowski (phd) wrote :

This issue still persists...

$ arduino
Picked up JAVA_TOOL_OPTIONS:
java.lang.UnsatisfiedLinkError: /usr/lib/x86_64-linux-gnu/liblistSerialsj.so.1.4.0: /usr/lib/x86_64-linux-gnu/liblistSerialsj.so.1.4.0: undefined symbol: sp_get_port_usb_vid_pid
        at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
        at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
        at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
        at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
        at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2659)
        at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830)
        at java.base/java.lang.System.loadLibrary(System.java:1873)
        at processing.app.Platform.<clinit>(Platform.java:144)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:315)
        at processing.app.BaseNoGui.initPlatform(BaseNoGui.java:514)
        at processing.app.Base.<init>(Base.java:201)
        at processing.app.Base.main(Base.java:141)

Revision history for this message
Piotr Henryk Dabrowski (phd) wrote :

Bump. This issue still occurs.

Revision history for this message
Stephen (stephen26) wrote :

Same thing here. Just installed latest Arduino from apt and got the same error. Apt reports version 1.8.13, at time of writing, I downloaded Arduino IDE 1.8.16 and installed from website and it works just fine. Is just Kubuntu not updating their packages?

Kubuntu 21.04 x86_64

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Tested with arduino 2:1.8.18+dfsg1-1 on Ubuntu Jammy, which is also affected. Updating tags.

tags: added: impish jammy
Revision history for this message
Rob Frohne (frohro) wrote :

And with arduino 2.1.8.15+dfsg1-1 on Ubuntu 21.10 it still happens now.

Revision history for this message
rew (r-e-wolff) wrote :

Just did a fresh install to prevent running into "old" problems and encountered this one.

Still present in an out-of-the-box 21.10 .

Revision history for this message
Valerio Bozzolan (bozzy) wrote :

Just here to say that this fix by inugami-mamoru (#9) worked well:

sudo apt install libserialport0 patchelf
sudo patchelf --add-needed /usr/lib/x86_64-linux-gnu/libserialport.so.0 /usr/lib/x86_64-linux-gnu/liblistSerialsj.so.1.4.0

Revision history for this message
Adrian Knagg-Baugh (ajekb78) wrote :

Just another comment to say the bug is still present. Fix still works.

Revision history for this message
Drew Knoll-Owen (nollo1) wrote :

Running Ubuntu 21.10 upgraded from Ubuntu 21.04, the bug is present and the fix from @ugur-jnmbk (comment #11) worked for me.

I first attempted the fix from @inugami-mamoru (#9) but unable to locate package libserial0.

Revision history for this message
theofficialgman (theofficialgman) wrote :

over a year and this bug is still unfixed. @<email address hidden> please take a look at fixing your package

Revision history for this message
Batwam (batwam) wrote :

Issue still there for me as well. Is this going to be fixed in 22.04 or is the deb package simply no longer maintain and people expected to use snaps? I noticed that the "Arduino" package in the store doesn't list the deb package.

Revision history for this message
Norbert (nrbrtx) wrote :

Final release of Ubuntu 22.04 LTS is affected.

Revision history for this message
Golden Child (goldenchild1000) wrote :

Upgraded recently from 21.10 to 22.04. Post-upgrading to 22.04 did an "sudo apt install arduino" and get this "java.lang.UnsatisfiedLinkError: ... undefined symbol: sp_get_port_usb_vid_pid" upon launching arduino from the command line.

Revision history for this message
Sid Lori (16siddy) wrote :

Clean install of Ubuntu 22.04 LTS x64 (Jammy Jellyfish), with KDE. Noticed several suggestions to install via Snap...

I can report that installing the Arduino IDE via Snap (1.8.19+dfsg1-1) has the EXACT same behavior as above. Asks for dialout permissions, then closes. Running "arduino" from Terminal shows the exact same error as mentioned in the initial bug ("undefined symbol: sp_get_port_usb_vid_pid").

Just FYI the patch recommended in #11 does solve the issue--or at least bypasses it so the Arduino IDE can start.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers