Bug #10751
Beep Sound Playback Causing Client Abend
100%
History
#1 Updated by Vladimir Tsichevski 9 months ago
FWD emits a beep sound to indicate invalid user input (e.g., pressing a disallowed key in a FILL-IN widget). When the underlying audio system cannot play the sound, FWD logs warnings and ignores specific exceptions.
The relevant code is in the AbstractDriver.playBeep method:
try
{
...
clip.open(audioStream);
...
}
catch (LineUnavailableException | IOException | UnsupportedAudioFileException e)
{
LOG.warning("Cannot play beep sound file " + BEEP_FILE_PATH, e);
return null;
}
On Linux (at least with Java 8), the underlying audio implementation in icedtea-sound.jar uses Java assert statement in the Stream.disconnect() method:
/**
* Disconnect a stream from a source/sink.
*/
void disconnect() {
int returnValue = native_pa_stream_disconnect();
assert (returnValue == 0);
}
During automated tests, an assertion failure in disconnect() triggers a java.lang.AssertionError, causing an immediate application abend. The stack trace is as follows:
Caused by: java.lang.AssertionError
at org.classpath.icedtea.pulseaudio.Stream.disconnect(Stream.java:560)
at org.classpath.icedtea.pulseaudio.PulseAudioDataLine.connect(PulseAudioDataLine.java:271)
at org.classpath.icedtea.pulseaudio.PulseAudioDataLine.open(PulseAudioDataLine.java:101)
at org.classpath.icedtea.pulseaudio.PulseAudioDataLine.open(PulseAudioDataLine.java:283)
at org.classpath.icedtea.pulseaudio.PulseAudioClip.open(PulseAudioClip.java:402)
at org.classpath.icedtea.pulseaudio.PulseAudioClip.open(PulseAudioClip.java:453)
at com.goldencode.p2j.ui.client.driver.AbstractDriver.playBeep(AbstractDriver.java:408)
at com.goldencode.p2j.ui.client.gui.driver.swing.SwingGuiDriver.beep(SwingGuiDriver.java:308)
at com.goldencode.p2j.ui.client.OutputManager.beep(OutputManager.java:817)
at com.goldencode.p2j.ui.client.FillIn.validateDisplayValue(FillIn.java:3562)
at com.goldencode.p2j.ui.client.FillIn.processKeyEvent(FillIn.java:1709)
at com.goldencode.p2j.ui.client.gui.FillInGuiImpl.processKeyEvent(FillInGuiImpl.java:1373)
at com.goldencode.p2j.ui.chui.ThinClient.processProgressEvent(ThinClient.java:22455)
at com.goldencode.p2j.ui.client.FocusManager.focusChange(FocusManager.java:1583)
at com.goldencode.p2j.ui.chui.ThinClient.nextTabStop(ThinClient.java:25172)
at com.goldencode.p2j.ui.client.FillIn.processKeyEvent(FillIn.java:1852)
at com.goldencode.p2j.ui.client.gui.FillInGuiImpl.processKeyEvent(FillInGuiImpl.java:1373)
Recommended Fix
Add java.lang.AssertionError to the list of caught exceptions in AbstractDriver.playBeep.
#4 Updated by Hynek Cihlar 8 months ago
Greg, I know we've had a debate about the use of assertions in our code base. Was the conclusion that using assert is discouraged?
#6 Updated by Vladimir Tsichevski 8 months ago
Greg Shah wrote:
Hynek Cihlar wrote:
Greg, I know we've had a debate about the use of assertions in our code base. Was the conclusion that using
assertis discouraged?Using
assertis disallowed. It must be removed.
You cannot do this in 3-rd party software.
#9 Updated by Hynek Cihlar 8 months ago
- Status changed from Review to Internal Test
Vladimir Tsichevski wrote:
Greg Shah wrote:
Hynek Cihlar wrote:
Greg, I know we've had a debate about the use of assertions in our code base. Was the conclusion that using
assertis discouraged?Using
assertis disallowed. It must be removed.You cannot do this in 3-rd party software.
Sorry, I was browsing the dissassembly assuming this was our code :-).
The changes are good. I suppose no more testing is needed?
#10 Updated by Vladimir Tsichevski 8 months ago
Hynek Cihlar wrote:
Vladimir Tsichevski wrote:
Greg Shah wrote:
Hynek Cihlar wrote:
Greg, I know we've had a debate about the use of assertions in our code base. Was the conclusion that using
assertis discouraged?Using
assertis disallowed. It must be removed.You cannot do this in 3-rd party software.
Sorry, I was browsing the dissassembly assuming this was our code :-).
The changes are good. I suppose no more testing is needed?
I suppose no testing is needed.
#11 Updated by Hynek Cihlar 8 months ago
- Status changed from Internal Test to Merge Pending
Please merge 10751a to trunk.