Arduino fails to start: undefined symbol: sp_get_port_usb_vid_pid

Bug #1916278 reported by Hans Joachim Desserud
174
This bug affects 36 people
Affects Status Importance Assigned to Milestone
arduino (Ubuntu)
Fix Released
Undecided
Unassigned
Jammy
Fix Released
Undecided
Unassigned
Kinetic
Fix Released
Undecided
Unassigned
listserialportsc (Ubuntu)
Fix Released
Undecided
Unassigned
Jammy
Fix Released
Undecided
Unassigned
Kinetic
Fix Released
Undecided
Unassigned

Bug Description

[ Impact ]

Arduino IDE crashes on start with undefined symbol error

[ Test Plan ]

1. Start without fix -> crash
2. Start with fix -> no crash
3. [racb: needs completing; see comment 41]

[ Where problems could occur ]

Nowhere. Arduino IDE is the only user and is already broken.

[ Original Report ]

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.

Revision history for this message
Paul Abraham (j-paul-q) wrote :

Still happening with clean install of Xubuntu 22.04

Revision history for this message
chris white (pocc) wrote :

Issue still present on clean install of Kubuntu 22.04 - For reference, I've already added myself as a member of the dialout,tty & uucp groups, and applied the patch as listed in #11 - I still get the java errors as others have and the Arduino IDE crashes immediately after displaying it's splash page

Revision history for this message
Norbert (nrbrtx) wrote :

Then do not use this buggy Arduino deb-package, use Ubuntu Make < https://wiki.ubuntu.com/ubuntu-make > :

sudo apt autopurge arduino
sudo add-apt-repository ppa:lyzardking/ubuntu-make
sudo apt-get update
sudo apt-get install ubuntu-make
umake electronics arduino

sudo usermod -a -G dialout $USER

then reboot and enjoy latest and fully-functional Arduino IDE 1.8.19.

Revision history for this message
Karsten (kpbenz) wrote :

Confirming the patch in #11 work for me (Ubuntu 22.04)!

Thanks a lot, ugur-jnmbk !

Revision history for this message
Tobias Heider (tobhe) wrote :

The problem seems to be the order of the linker flags in the listserialportsc Makefile. Moving the LDFLAGS after the object files fixes the bug.

Revision history for this message
Mikolaj Buchwald (mikbuch) wrote :

The bug still affects Ubuntu 22.04 jammy.

Solution suggested by Uğur Çetin (ugur-jnmbk; wrote on 2021-06-30 #11 https://bugs.launchpad.net/ubuntu/+source/arduino/+bug/1916278/comments/11) helped in my case:

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

Logs attached

Revision history for this message
Tobias Heider (tobhe) wrote :

My fix made it into the newest debian version: https://tracker.debian.org/news/1358628/accepted-listserialportsc-140repack-1-source-into-unstable/
I will prepare new diffs for kinetic and jammy with the debian fix applied.

Revision history for this message
Tobias Heider (tobhe) wrote :

@sponsors: the best solution for kinetic is probably just syncing the new debian version. The only changes are the bugfix + some packaging/lintian fixes. The affected library is also only used by arduino so the potential for regressions seems low.

A debdiff of only the bugfix ported to jammy is attached.

Changed in listserialportsc (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
Tobias Heider (tobhe) wrote :

Thank you @xnox! With this fixed the Arduino IDE deb now works on kinetic.

Tobias Heider (tobhe)
Changed in listserialportsc (Ubuntu Kinetic):
status: New → Fix Released
Changed in listserialportsc (Ubuntu Jammy):
status: New → Confirmed
Tobias Heider (tobhe)
description: updated
Revision history for this message
Sebastien Bacher (seb128) wrote :

uploaded

Changed in arduino (Ubuntu Kinetic):
status: New → Fix Released
Changed in listserialportsc (Ubuntu):
status: Fix Committed → Fix Released
Changed in listserialportsc (Ubuntu Jammy):
status: Confirmed → Fix Committed
Changed in arduino (Ubuntu):
status: Confirmed → Fix Released
Changed in arduino (Ubuntu Jammy):
status: New → Fix Committed
Revision history for this message
Yvan Fracheboud (yvanf) wrote :

I could also run it in Ubentu 22.04 LTS with the command from Inugami modified by Uğur Çetin. Thank you so much.

Revision history for this message
Robie Basak (racb) wrote :

Since 1.4.0-1 exists in both Focal and Jammy, I changed the version to 1.4.0-1ubuntu0.22.04.1 (following https://wiki.ubuntu.com/SecurityTeam/UpdatePreparation#Update_the_packaging which covers this case) and reuploaded.

I think the Test Plan should be enhanced to ensure that the IDE basically works as expected, and this is verified before landing this update. Otherwise we could end up in a situation where we fixed one crash but there's some other major blocker resulting in a further, more painful SRU. I'll accept the upload now, but could someone please do some further testing than just "no crash" as part of SRU verification to avoid this trap?

description: updated
tags: added: verification-needed verification-needed-jammy
Revision history for this message
Robie Basak (racb) wrote : Please test proposed package

Hello Hans, or anyone else affected,

Accepted listserialportsc into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/listserialportsc/1.4.0-1ubuntu0.22.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
Tobias Heider (tobhe) wrote (last edit ):

Confirmed to work in jammy with the new -proposed package ( 1.4.0-1ubuntu0.22.04.1).

What I have done to make sure it actually works:
1. Setup a new Jammy VM, enable proposed and install arduino
2. Make sure it starts, compiles the test program, doesn't die after $seconds
3. Attached NodeMCU board via USB, passed through and made sure I can log the serial console output

Since the broken package was libserialport, checking that the IDE lists all connected serial devices and is actually able to print serial output should be sufficient to make sure the library is actually working.

Revision history for this message
Kevin Krumwiede (kjkrum) wrote :

Not as thorough as Tobias since I haven't dug my Arduino out of the closet yet. Confirmed that the IDE no longer crashes at startup with liblistserialsj1:amd64 (1.4.0-1ubuntu0.22.04.1).

Tobias Heider (tobhe)
tags: added: verification-done verification-done-jammy
removed: verification-needed verification-needed-jammy
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package listserialportsc - 1.4.0-1ubuntu0.22.04.1

---------------
listserialportsc (1.4.0-1ubuntu0.22.04.1) jammy; urgency=medium

  * d/p/0001-Makefile-Fix-linkage-in-order-to-make-as-needed-usab.patch:
    Fix linking of listSerialsj with --as-needed (LP: #1916278)

 -- Tobias Heider <email address hidden> Mon, 26 Sep 2022 17:22:35 +0200

Changed in listserialportsc (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Robie Basak (racb) wrote : Update Released

The verification of the Stable Release Update for listserialportsc has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Tobias Heider (tobhe)
Changed in arduino (Ubuntu Jammy):
status: Fix Committed → Fix Released
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

Remote bug watches

Bug watches keep track of this bug in other bug trackers.