Bug 195123

Summary: devel/arduino: missing dependencies?
Product: Ports & Packages Reporter: Adrian Chadd <adrian>
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed Feedback Timeout    
Severity: Affects Only Me CC: james, leres, miwi
Priority: --- Keywords: needs-patch, needs-qa
Version: LatestFlags: adrian: maintainer-feedback? (leres)
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196369

Description Adrian Chadd freebsd_committer freebsd_triage 2014-11-17 22:45:57 UTC
Hi,

I'm trying to run the arduino port built for HEAD/i386. This is using the binary pkg repository.

adrian@lucy-11i386:~/work/freebsd/head/src % arduino
java.lang.UnsatisfiedLinkError: /usr/local/arduino/lib/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so" thrown while loading gnu.io.RXTXCommDriver
Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/arduino/lib/librxtxSerial.so: Shared object "libpthread.so.0" not found, required by "librxtxSerial.so"
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1929)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1847)
	at java.lang.Runtime.loadLibrary0(Runtime.java:870)
	at java.lang.System.loadLibrary(System.java:1119)
	at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:123)
	at processing.app.Editor.populateSerialMenu(Editor.java:962)
	at processing.app.Editor.buildToolsMenu(Editor.java:691)
	at processing.app.Editor.buildMenuBar(Editor.java:476)
	at processing.app.Editor.<init>(Editor.java:205)
	at processing.app.Base.handleOpen(Base.java:705)
	at processing.app.Base.restoreSketches(Base.java:365)
	at processing.app.Base.<init>(Base.java:282)
	at processing.app.Base.main(Base.java:195)

.. and it never finishes starting up.

adrian@lucy-11i386:~/work/freebsd/head/src % pkg info | grep arduino
arduino-1.0.5_2,1              Open-source electronics prototyping platform
adrian@lucy-11i386:~/work/freebsd/head/src % pkg info arduino
arduino-1.0.5_2,1
Name           : arduino
Version        : 1.0.5_2,1
Installed on   : Tue Sep 16 18:16:03 PDT 2014
Origin         : devel/arduino
Architecture   : freebsd:11:x86:32
Prefix         : /usr/local
Categories     : lang java devel
Maintainer     : leres@ee.lbl.gov
WWW            : http://arduino.cc/
Comment        : Open-source electronics prototyping platform
Options        :
	ATMEGA644P     : off
	DOCS           : on
	EXAMPLES       : on
Annotations    :
	repo_type      : binary
	repository     : FreeBSD
Flat size      : 22.6MiB
Description    :
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.

The Arduino software consists of a development environment (IDE) and the
core libraries.

.. is this missing some dependency on something?
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2014-11-17 22:45:57 UTC
Maintainer CC'd
Comment 2 Craig Leres freebsd_committer freebsd_triage 2014-12-29 23:53:27 UTC
I'm running 9.1-RELEASE and don't really use the arduino ide.

The only libpthread.so.0 I see on my system is part of linux_base-f10. I installed arduino and xorg and deinstalled linux_base-f10 on a spare box and
I can get the arduino ide to run via X over a ssh session.

I also see two versions of librxtxSerial.so. One is installed by arduino and the other by rxtx-openjdk6. On my test system it looks like the rxtx-openjdk6 version is the one being used and it only depends on libc.so.7.

I poked at the configure script for the comms/rxtx source package but it doesn't look to me as if it would ever directly add -lpthread to LDFLAGS on any version of FreeBSD. Can you determine which librxtxSerial.so you're running? I used ls -lu after running arduino. See if you can figure out if the FreeBSD 11 librxtxSerial.so depends on libpthread.so.0.
Comment 3 Adrian Chadd freebsd_committer freebsd_triage 2015-04-05 04:57:06 UTC
(In reply to leres from comment #2)

Hi,

root@lucy-11i386:/home/adrian # pkg info | grep rxtx
rxtx-openjdk7-2.2p2_2          Native interface to serial ports in Java
root@lucy-11i386:/home/adrian # pkg info | grep arduino
arduino-1.0.6,1                Open-source electronics prototyping platform

That's all I know. I'm using the binary packages made for -HEAD i386, and I update every month. It's still not working even with the most recent update.

So, how's it ending up not actually working?
Comment 4 James Elstone 2015-05-13 19:57:21 UTC
The [RXTX] port, that [arduino] depends on, requires the "libpthread.so.0" which can be found in the port "./emulators/linux_base-c6".

This is installed into /usr/local/lib/compat/libpthread.so.1 by the [linux_base-c6] port.

The [RXTX] port is lacking this dependancy, and a bug for the [RXTX] port has been raised, with a proposed patch attached.

(Please see bug reports for RXTX that you will encounter once you resolve the issue you reported; it has a static code base located at http://rxtx.qbang.org/ which hasn't been updated since 4th Feb 2009).





https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196892
This core dump is occuring in the [RXTX] port as it issues a SIGABRT to a thread, which forces the prcoess to perform a core dump.  
I suspect in JRE (OpenJDK) the handling of this had a different effect than OpenJDK 7+.

An upstream bug in RXTX has been reported, with proposed patch attached.
Comment 5 James Elstone 2015-05-13 20:10:09 UTC
Upstream PR raised on RXTX:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=200179
Comment 6 Craig Leres freebsd_committer freebsd_triage 2015-07-27 00:18:14 UTC
Given the recent fixes applied to and PRs closed for comms/rxtx, is the original concern still an issue?

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=128809
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=200179
Comment 7 Adrian Chadd freebsd_committer freebsd_triage 2015-07-27 00:21:37 UTC
There's no -HEAD package for i386 yet, so I guess it's all even more broken again. :(

Please try it out on i386 -HEAD; it'll be very obvious.
Comment 8 Martin Wilke freebsd_committer freebsd_triage 2015-12-24 20:43:54 UTC
Hi Adrian,

any update on this?