Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception in getPortNames() when ports not available #8

Closed
GoogleCodeExporter opened this issue Dec 20, 2015 · 3 comments
Closed

Exception in getPortNames() when ports not available #8

GoogleCodeExporter opened this issue Dec 20, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. System don`t have any serial ports.
2. Call getPortNames()
3. Application crashes

# Problematic frame:
# j  jssc.SerialNativeInterface.getSerialPortNames()[Ljava/lang/String;+0

---------------  T H R E A D  ---------------

Current thread (0x00000000003ac000):  JavaThread "main" [_thread_in_Java, 
id=12264, stack(0x00000000020d0000,0x00000000021d0000)]

siginfo: ExceptionCode=0xc0000005, reading address 0xffffffff00000002

Original issue reported on code.google.com by w...@posten.ru on 25 Apr 2012 at 11:53

@GoogleCodeExporter
Copy link
Author

Version: jSSC-0.9.0
MS Win7, 64 bit

Original comment by w...@posten.ru on 25 Apr 2012 at 12:00

@GoogleCodeExporter
Copy link
Author

Workaround:

public static String[] GetPortList() {
    try {
        String[] serialPortNames = SerialPortList.getPortNames();
        return serialPortNames;
    } catch (NullPointerException e) {
    }
    return new String[0];
}

Original comment by w...@posten.ru on 25 Apr 2012 at 12:07

@GoogleCodeExporter
Copy link
Author

As I see, you use jSSC-0.8-tb2 (see 223 string of your stack trace: 
0x0000000067c40000 - 0x0000000067c5d000 
    C:\Users\Pavel\.jssc\windows\jSSC-0.8-tb2_x86_64.dll)

jSSC-0.8-tb2 have no checking of returned array from native code, that's why 
you have this error. This issue was fixed in jSSC-0.8-tb3.

Original comment by scream3r.org@gmail.com on 13 Mar 2013 at 8:41

  • Changed state: Fixed

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

No branches or pull requests

1 participant