Broken on kernel 3.7 #133

Closed
tannewt opened this Issue Dec 18, 2012 · 22 comments

7 participants

@tannewt

Hi, I tried running this on stock 3.7 with an Open Bench Logic Sniffer on /dev/ttyACM0 but it crashes:
[pid 4485] open("/dev/ttyACM0", O_RDWR|O_NOCTTY|O_NONBLOCK) = 52
[pid 4485] open("/dev/ttyACM0", O_RDWR|O_NOCTTY|O_NONBLOCK) = 52
[pid 4485] fcntl(52, F_GETFL) = 0x8802 (flags O_RDWR|O_NONBLOCK|O_LARGEFILE)
[pid 4485] fcntl(52, F_SETFL, O_RDWR|O_LARGEFILE) = 0
[pid 4485] ioctl(52, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B921600 -opost -isig -icanon -echo ...}) = 0
[pid 4485] ioctl(52, SNDCTL_TMR_START or SNDRV_TIMER_IOCTL_TREAD or TCSETS, {B921600 -opost -isig -icanon -echo ...}) = 0
[pid 4485] ioctl(52, TIOCGSERIAL, 0x7f5ba4130760) = 0
[pid 4485] ioctl(52, TIOCSSERIAL, 0x7f5ba4130760) = -1 ENOTTY (Inappropriate ioctl for device)
[pid 4485] fcntl(52, F_GETFL) = 0x8002 (flags O_RDWR|O_LARGEFILE)
[pid 4485] fcntl(52, F_SETFL, O_RDWR|O_NONBLOCK|O_LARGEFILE) = 0
[pid 4485] ioctl(-1, SNDCTL_TMR_START or SNDRV_TIMER_IOCTL_TREAD or TCSETS, {B921600 -opost -isig -icanon -echo ...}) = -1 EBADF (Bad file descriptor)
java.lang.IllegalStateException: JTermios call returned -1 at class jtermios.JTermios$JTermiosLogging line 489
at purejavacomm.PureJavaSerialPort.checkReturnCode(PureJavaSerialPort.java:908)
at purejavacomm.PureJavaSerialPort.setSerialPortParams(PureJavaSerialPort.java:478)
at purejavacomm.PureJavaSerialPort.(PureJavaSerialPort.java:722)
at purejavacomm.CommPortIdentifier.open(CommPortIdentifier.java:138)
at nl.lxtreme.ols.io.serial.CommConnectionFactory.getSerialPort(CommConnectionFactory.java:141)
at nl.lxtreme.ols.io.serial.CommConnectionFactory.obtainSerialPort(CommConnectionFactory.java:177)
at nl.lxtreme.ols.io.serial.CommConnectionFactory.createConnection(CommConnectionFactory.java:72)
at nl.lxtreme.ols.io.ConnectorServiceImpl.open(ConnectorServiceImpl.java:160)
at org.sump.device.logicsniffer.LogicSnifferDevice.createStreamConnection(LogicSnifferDevice.java:159)
at org.sump.device.logicsniffer.LogicSnifferDetectionTask.call(LogicSnifferDetectionTask.java:82)
at org.sump.device.logicsniffer.LogicSnifferDeviceProfilePanel.obtainDeviceMetadata(LogicSnifferDeviceProfilePanel.java:353)
at org.sump.device.logicsniffer.LogicSnifferDeviceProfilePanel$ShowDeviceMetadataAction.actionPerformed(LogicSnifferDeviceProfilePanel.java:243)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3312)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:723)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:682)
at java.awt.EventQueue$3.run(EventQueue.java:680)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:696)
at java.awt.EventQueue$4.run(EventQueue.java:694)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:693)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:155)
at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182)
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219)
at java.awt.Dialog.show(Dialog.java:1077)
at java.awt.Component.show(Component.java:1651)
at java.awt.Component.setVisible(Component.java:1603)
at java.awt.Window.setVisible(Window.java:1014)
at java.awt.Dialog.setVisible(Dialog.java:1003)
at org.sump.device.logicsniffer.LogicSnifferConfigDialog.showDialog(LogicSnifferConfigDialog.java:586)
at org.sump.device.logicsniffer.LogicSnifferDevice.setupCapture(LogicSnifferDevice.java:138)
at nl.lxtreme.ols.client.ClientController.captureData(ClientController.java:535)
at nl.lxtreme.ols.client.action.CaptureAction.actionPerformed(CaptureAction.java:97)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3312)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:723)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:682)
at java.awt.EventQueue$3.run(EventQueue.java:680)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:696)
at java.awt.EventQueue$4.run(EventQueue.java:694)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:693)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)

As you can see I was running it under strace and the TIOCSSERIAL call is failing. My guess is that its related to this commit (torvalds/linux@ba2d8ce) to the kernel a month ago.

@tannewt

Ignore that commit. Its not actually in 3.7. Its in 3.7.1. I'll report back if 3.7.1 works or not.

@tannewt

Still broken in 3.7.1:
[pid 2670] open("/dev/ttyACM0", O_RDWR|O_NOCTTY|O_NONBLOCK) = 52
[pid 2670] open("/dev/ttyACM0", O_RDWR|O_NOCTTY|O_NONBLOCK) = 52
[pid 2670] fcntl(52, F_GETFL) = 0x8802 (flags O_RDWR|O_NONBLOCK|O_LARGEFILE)
[pid 2670] fcntl(52, F_SETFL, O_RDWR|O_LARGEFILE) = 0
[pid 2670] ioctl(52, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B9600 opost isig icanon echo ...}) = 0
[pid 2670] ioctl(52, SNDCTL_TMR_START or SNDRV_TIMER_IOCTL_TREAD or TCSETS, {B9600 -opost -isig -icanon -echo ...}) = 0
[pid 2670] ioctl(52, TIOCGSERIAL, 0x7f0e283942c0) = 0
[pid 2670] ioctl(52, TIOCSSERIAL, 0x7f0e283942c0) = -1 EOPNOTSUPP (Operation not supported)
[pid 2670] fcntl(52, F_GETFL) = 0x8002 (flags O_RDWR|O_LARGEFILE)
[pid 2670] fcntl(52, F_SETFL, O_RDWR|O_NONBLOCK|O_LARGEFILE) = 0
[pid 2670] ioctl(-1, SNDCTL_TMR_START or SNDRV_TIMER_IOCTL_TREAD or TCSETS, {B9600 -opost -isig -icanon -echo ...}) = -1 EBADF (Bad file descriptor)
java.lang.IllegalStateException: JTermios call returned -1 at class jtermios.JTermios$JTermiosLogging line 489
at purejavacomm.PureJavaSerialPort.checkReturnCode(PureJavaSerialPort.java:908)
at purejavacomm.PureJavaSerialPort.setSerialPortParams(PureJavaSerialPort.java:478)
at purejavacomm.PureJavaSerialPort.(PureJavaSerialPort.java:722)
at purejavacomm.CommPortIdentifier.open(CommPortIdentifier.java:138)
at nl.lxtreme.ols.io.serial.CommConnectionFactory.getSerialPort(CommConnectionFactory.java:141)
at nl.lxtreme.ols.io.serial.CommConnectionFactory.obtainSerialPort(CommConnectionFactory.java:177)
at nl.lxtreme.ols.io.serial.CommConnectionFactory.createConnection(CommConnectionFactory.java:72)
at nl.lxtreme.ols.io.ConnectorServiceImpl.open(ConnectorServiceImpl.java:160)
at org.sump.device.logicsniffer.LogicSnifferDevice.createStreamConnection(LogicSnifferDevice.java:159)
at org.sump.device.logicsniffer.LogicSnifferDetectionTask.call(LogicSnifferDetectionTask.java:82)
at org.sump.device.logicsniffer.LogicSnifferDeviceProfilePanel.obtainDeviceMetadata(LogicSnifferDeviceProfilePanel.java:353)
at org.sump.device.logicsniffer.LogicSnifferDeviceProfilePanel$ShowDeviceMetadataAction.actionPerformed(LogicSnifferDeviceProfilePanel.java:243)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3312)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:723)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:682)
at java.awt.EventQueue$3.run(EventQueue.java:680)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:696)
at java.awt.EventQueue$4.run(EventQueue.java:694)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:693)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:155)
at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182)
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219)
at java.awt.Dialog.show(Dialog.java:1077)
at java.awt.Component.show(Component.java:1651)
at java.awt.Component.setVisible(Component.java:1603)
at java.awt.Window.setVisible(Window.java:1014)
at java.awt.Dialog.setVisible(Dialog.java:1003)
at org.sump.device.logicsniffer.LogicSnifferConfigDialog.showDialog(LogicSnifferConfigDialog.java:586)
at org.sump.device.logicsniffer.LogicSnifferDevice.setupCapture(LogicSnifferDevice.java:138)
at nl.lxtreme.ols.client.ClientController.captureData(ClientController.java:535)
at nl.lxtreme.ols.client.action.CaptureAction.actionPerformed(CaptureAction.java:97)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3312)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:723)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:682)
at java.awt.EventQueue$3.run(EventQueue.java:680)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:696)
at java.awt.EventQueue$4.run(EventQueue.java:694)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:693)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)

It looks like it works as root but fails the new capability check here: https://github.com/torvalds/linux/blob/master/drivers/usb/class/cdc-acm.c#L817

Should probably just continue if the set fails due to permissions.

@jawi
Owner

Could you provide me the following information:

  • what version of the client are you using?
  • you seem to use the "detect device" button; did you fill in a proper port into the "analyzer port" field?
@jawi
Owner

Verified this bug against the latest 3.7 release of Linux.

System administration rights are needed to use the TIOCSSERIAL IOCTL, which is -I believe- not strictly necessary to make most use cases work... I'll contact the author of PureJavacomm about this issue.

@jawi
Owner
@wayoda

I have the same problem on KUbuntu 12.10.

I use the latest version 0.9.6 SP1
Kernel Version is 3.5.0-21-generic

Jawi wrote

System administration rights are needed to use the TIOCSSERIAL IOCTL...

Running the Software as root doesn't help

@jawi
Owner

@wayoda : could you do a strace as well? The stock 3.5-kernel does not have the same issues as the OP has with 3.7; perhaps the Ubuntu guys backported some fixes?

@wayoda

It seems to be something else over here.
It seems to be a problem with the permissions to the device files, doesn't look like a Kernel issue.

I have a new machine, so I reinstalled KUbuntu and also the OlsClient from scratch.
In contrary to what I wrote earlier the Client does work for root, when I select the device ttyACM0 from the ComboBox or when I enter the original filename /dev/ttyACM0.

For normal users I get a No such port error (from the Client).
This is a bit strange because I belong to the group dialout so I should be able to open the device.

wayoda@shredder:~$ groups wayoda
wayoda : wayoda adm dialout cdrom sudo dip plugdev lpadmin sambashare
wayoda@shredder:~$ ll /dev/ttyACM0 
crw-rw---- 1 root dialout 166, 0 Jan 16 17:55 /dev/ttyACM0

When I do a

wayoda@shredder:~$ sudo chmod a+rw /dev/ttyACM0
wayoda@shredder:~$ ll /dev/ttyACM0 
crw-rw-rw- 1 root dialout 166, 0 Jan 16 18:03 /dev/ttyACM0

I can use the device as a normal user again.

But...

I used to point the OlsClient to a symlink to my device that I create with a simple udev rule

# The OpenLogicSniffer
SUBSYSTEM=="usb", ATTR{idVendor}=="04d8", ATTR{idProduct}=="fc92", MODE="0666", SYMLINK+="OLS"

setting the ComboBox to /dev/OLS would work.
This doesn't seem to work any more, not for normal user and not for root.

@jawi
Owner

@wayoda : indeed, this appears to be another issue. Could you split this off to a new issue?

@jawi jawi added a commit that referenced this issue Feb 15, 2013
@jawi Intermediate fix for #133:
- used a local build of PureJavacomm with the proposed changes for
  issue nyholku/purejavacomm#16.
5a7d134
@jawi
Owner

@wayoda : I've created #159 for the problem you're facing...

@jawi
Owner

I've got positive feedback about the intermediate fix I made. Considering this issue to be fixed for the upcoming release...

@jawi jawi closed this Mar 11, 2013
@MartinNowak

Works for me too.

@russm

FYI, I am seeing this problem using ols-0.9.7-SNAPSHOT build #46 from drone.io on a 3.8.5 kernel (on Debian Wheezy)

russm@worcestershire:/usr/local/playground/ols/ols-0.9.7-SNAPSHOT$ DISPLAY=:2 ./run.sh
JGoodies Looks: I have successfully installed the 'Sky Bluer' theme.
java.lang.IllegalStateException: JTermios call returned -1 at class purejavacomm.PureJavaSerialPort line 514
at purejavacomm.PureJavaSerialPort.checkReturnCode(PureJavaSerialPort.java:1279)
at purejavacomm.PureJavaSerialPort.setSerialPortParams(PureJavaSerialPort.java:514)
at purejavacomm.PureJavaSerialPort.(PureJavaSerialPort.java:1096)
at purejavacomm.CommPortIdentifier.open(CommPortIdentifier.java:148)
at nl.lxtreme.ols.io.serial.CommConnectionFactory.getSerialPort(CommConnectionFactory.java:141)
at nl.lxtreme.ols.io.serial.CommConnectionFactory.obtainSerialPort(CommConnectionFactory.java:177)
at nl.lxtreme.ols.io.serial.CommConnectionFactory.createConnection(CommConnectionFactory.java:72)
at nl.lxtreme.ols.io.ConnectorServiceImpl.open(ConnectorServiceImpl.java:160)
at org.sump.device.logicsniffer.LogicSnifferDevice.createStreamConnection(LogicSnifferDevice.java:159)
at org.sump.device.logicsniffer.LogicSnifferDevice.getStreamConnection(LogicSnifferDevice.java:245)
at org.sump.device.logicsniffer.LogicSnifferDevice.createAcquisitionTask(LogicSnifferDevice.java:87)
at nl.lxtreme.ols.acquisition.BackgroundDataAcquisitionService.acquireData(BackgroundDataAcquisitionService.java:76)
at nl.lxtreme.ols.client.ClientController.captureData(ClientController.java:539)
at nl.lxtreme.ols.client.action.CaptureAction.actionPerformed(CaptureAction.java:97)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2012)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2335)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:404)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.AbstractButton.doClick(AbstractButton.java:374)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:829)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:873)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
at java.awt.Component.processMouseEvent(Component.java:6288)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6053)
at java.awt.Container.processEvent(Container.java:2045)
at java.awt.Component.dispatchEventImpl(Component.java:4649)
at java.awt.Container.dispatchEventImpl(Container.java:2103)
at java.awt.Component.dispatchEvent(Component.java:4475)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4633)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4297)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4227)
at java.awt.Container.dispatchEventImpl(Container.java:2089)
at java.awt.Window.dispatchEventImpl(Window.java:2587)
at java.awt.Component.dispatchEvent(Component.java:4475)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:675)
at java.awt.EventQueue.access$300(EventQueue.java:96)
at java.awt.EventQueue$2.run(EventQueue.java:634)
at java.awt.EventQueue$2.run(EventQueue.java:632)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:116)
at java.awt.EventQueue$3.run(EventQueue.java:648)
at java.awt.EventQueue$3.run(EventQueue.java:646)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:645)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)
russm@worcestershire:/usr/local/playground/ols/ols-0.9.7-SNAPSHOT$

@russm

I've updated to 3.8.13 and still see this issue. Are the snapshot builds at drone.io the ones that should have this fix?

@jawi
Owner

I tried the latest build from drone.io on two 3.8.0 (stock) kernels, and one custom 3.9.0 kernel (see below for details). In all three situations, it runs just fine and captures normally.
I'm not sure why it doesn't work for you, do you have the correct permissions to access the port? Does it work if you re-enter the portname? What device are you using?

Linux ubuntu-vmware 3.8.0-21-generic #32-Ubuntu SMP Tue May 14 22:16:46 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
Linux mint-vmware 3.8.0-19-generic #29-Ubuntu SMP Wed Apr 17 18:16:28 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
Linux mint-vmware 3.9.0-030900-generic #201304291257 SMP Mon Apr 29 16:58:15 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
@russm

My device is a regular OLS board. Device permissions are "crw-rw---T 1 root dialout 166, 1 May 21 15:16 /dev/ttyACM1" and I'm a member of group "dialout" (and have no trouble communicating with the target device on ttyACM0 that has the same permissions). I'm using build #46 from drone.io (the .tar.gz with md5 24cb619bd037745ead0ea8d89c06e71b). Using the same client on an Ubuntu 12.04 box works fine.

My current kernel is "3.8-2-amd64 #1 SMP Debian 3.8.13-1 x86_64 GNU/Linux" (kernel from Debian Sid on a Wheezy userland). I'll try booting in to the stock 3.2 kernel when I get in to work tomorrow.

I've tried manually re-entering the device to use, as well as deleting the prefs file and letting the client discover serial ports then selecting from the drop-down. I've tried both leaving the port speed at 115200 and setting it to 9600 to match the ioctl info from strafe below. Both clicking "Show device metadata" and trying to capture dump a java stack trace with "JTermios call returned -1". Running under strace shows the same pattern as the original bug report on this issue:

[pid  8093] open("/dev/ttyACM1", O_RDWR|O_NOCTTY|O_NONBLOCK) = 61
[pid  8093] fcntl(61, F_GETFL)          = 0x8802 (flags O_RDWR|O_NONBLOCK|O_LARGEFILE)
[pid  8093] fcntl(61, F_SETFL, O_RDWR|O_LARGEFILE) = 0
[pid  8093] ioctl(61, SNDCTL_TMR_TIMEBASE or TCGETS, {B9600 -opost -isig -icanon -echo ...}) = 0
[pid  8093] ioctl(61, SNDCTL_TMR_TIMEBASE or TCGETS, {B9600 -opost -isig -icanon -echo ...}) = 0
[pid  8093] ioctl(61, SNDCTL_TMR_START or TCSETS, {B9600 -opost -isig -icanon -echo ...}) = 0
[pid  8093] ioctl(61, SNDCTL_TMR_TIMEBASE or TCGETS, {B9600 -opost -isig -icanon -echo ...}) = 0
[pid  8093] ioctl(61, TIOCGSERIAL, 0x1affc30) = 0
[pid  8093] ioctl(61, TIOCSSERIAL, 0x1affc30) = -1 EPERM (Operation not permitted)
[pid  8093] fcntl(61, F_GETFL)          = 0x8002 (flags O_RDWR|O_LARGEFILE)
[pid  8093] fcntl(61, F_SETFL, O_RDWR|O_NONBLOCK|O_LARGEFILE) = 0
[pid  8093] close(61)                   = 0
[pid  8093] ioctl(-1, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fde89e39980) = -1 EBADF (Bad file descriptor)
[pid  8093] ioctl(-1, SNDCTL_TMR_START or TCSETS, {B9600 -opost -isig -icanon -echo ...}) = -1 EBADF (Bad file descriptor)
Exception occurred during event dispatching:
java.lang.IllegalStateException: JTermios call returned -1 at class purejavacomm.PureJavaSerialPort line 514
    at purejavacomm.PureJavaSerialPort.checkReturnCode(PureJavaSerialPort.java:1279)
    at purejavacomm.PureJavaSerialPort.setSerialPortParams(PureJavaSerialPort.java:514)
    at purejavacomm.PureJavaSerialPort.<init>(PureJavaSerialPort.java:1096)
    at purejavacomm.CommPortIdentifier.open(CommPortIdentifier.java:148)
    at nl.lxtreme.ols.io.serial.CommConnectionFactory.getSerialPort(CommConnectionFactory.java:141)
    at nl.lxtreme.ols.io.serial.CommConnectionFactory.obtainSerialPort(CommConnectionFactory.java:177)
    at nl.lxtreme.ols.io.serial.CommConnectionFactory.createConnection(CommConnectionFactory.java:72)
    at nl.lxtreme.ols.io.ConnectorServiceImpl.open(ConnectorServiceImpl.java:160)
@russm

One other data point, I can communicate with the OLS fine by talking directly to the serial port. If I run echo -n 000000000002 | xxd -r -p > /dev/ttyACM1 in one terminal, I get the string 1ALS back from the device as expected.

@russm

Using the same system but booted to a 3.2 kernel (3.2.0-4-amd64 #1 SMP Debian 3.2.41-2+deb7u2 x86_64 GNU/Linux), everything runs fine. I can capture, and the "Show device metadata" button reports "Open Logic Sniffer v1.01", firmware 3.07.

As far as I can see this is the same issue. The only explanations I have are that either A) the build I have doesn't include the fixed version of purejavacomm, or B) my system is using an older local version of purejavacomm in preference to the one bundled in the client. I don't think it's B (there is no file on the system that matches "javacomm" in the path, but I' don't know enough about the JRE to ask it what bundles it's loading).

@festlv

I can confirm that the error (http://goo.gl/iQwns) is fixed for me in 0.9.7-SNAPSHOT downloaded from drone.io. It was apparent in latest stable release (running Arch Linux with 3.8.11 kernel). Previously I got the same error when not running OLS as root (permissions for /dev/ttyACMx were correct).

@TomSaw
@jawi
Owner

One thing that still needs to be done is to upgrade to the latest official release of Purejavacomm: 0.0.17. It contains several fixes, including an official fix for this issue.

@russm : the official release of 0.0.17 might perhaps fix your issue, are you willing to test this?

@russm

@jawi: I've just grabbed the new build from drone.io and can confirm it's working for me now. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment