From renaud at nentec.de Wed Jun 2 12:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed Jun 2 11:48:57 2004 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 12:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed Jun 2 12:12:56 2004 Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj@www.linux.org.uk From renaud at nentec.de Wed Jun 2 12:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed Jun 2 12:35:31 2004 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 13:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed Jun 2 13:00:27 2004 Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj@www.linux.org.uk From jls at sco.com Wed Jun 2 14:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed Jun 2 13:59:53 2004 Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 16:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu Jun 3 16:06:02 2004 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 10:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri Jun 4 10:00:20 2004 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 13:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 4 13:27:14 2004 Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj@www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 14:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri Jun 4 13:57:35 2004 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj@www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 15:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri Jun 4 14:51:11 2004 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj@www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx@linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 15:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri Jun 4 14:55:02 2004 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj@www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx@linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx@linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 15:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 4 15:03:54 2004 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj@www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 15:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 4 15:13:44 2004 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj@www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx@linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 15:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 4 15:36:49 2004 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj@www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx@linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx@linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj@www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 16:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri Jun 4 15:51:53 2004 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 16:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri Jun 4 16:59:44 2004 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 18:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun Jun 6 18:34:27 2004 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 16:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon Jun 7 16:34:44 2004 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 15:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue Jun 8 15:50:10 2004 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 17:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Jun 8 17:14:39 2004 Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj@www.linux.org.uk From renaud at nentec.de Wed Jun 9 07:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed Jun 9 07:53:56 2004 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 09:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed Jun 9 09:16:43 2004 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 16:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Thu Jun 10 13:38:48 2004 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 13:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu Jun 10 13:45:20 2004 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj@www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 09:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri Jun 11 09:08:56 2004 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp.@EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp.@EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 12:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri Jun 11 12:38:49 2004 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx@linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request@linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner@linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx@linuxgrrls.org" > Message-ID: <40C72DF8.9030208@dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj@www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx@linuxgrrls.org > Message-ID: <40C967ED.9080402@bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp.@EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp.@EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 20:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Sat Jun 12 00:04:06 2004 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Sat Jun 12 03:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat Jun 12 03:03:23 2004 Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix@CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 13:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat Jun 12 13:08:59 2004 Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj@www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj@www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.linuxgrrls.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 11:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue Jun 15 11:07:48 2004 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.linuxgrrls.org/pipermail/rxtx/attachments/20040615/7181668d/attachment.bin From moritz.gmelin at gmx.de Tue Jun 15 15:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue Jun 15 15:39:59 2004 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.linuxgrrls.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892.obj From jdevora at saadian.com Tue Jun 15 16:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue Jun 15 16:46:23 2004 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 16:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue Jun 15 16:56:53 2004 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 11:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed Jun 16 11:35:59 2004 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx@linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 13:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: Wed Jun 16 13:02:16 2004 Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.linuxgrrls.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment.html From alexandre.ricciardi at free.fr Wed Jun 16 16:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed Jun 16 16:31:10 2004 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root@0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root@0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root@0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 16:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed Jun 16 16:39:00 2004 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root@0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root@0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root@0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 17:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed Jun 16 17:18:17 2004 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen@lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 09:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed Jun 23 09:47:43 2004 Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 11:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed Jun 23 10:58:11 2004 Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 11:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed Jun 23 11:14:32 2004 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root@0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root@0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root@0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 11:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed Jun 23 11:15:49 2004 Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj@www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann@stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann@stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 11:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed Jun 23 11:28:33 2004 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx@linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 11:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed Jun 23 11:41:29 2004 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 03:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 25 03:40:29 2004 Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar@Sun.COM > To: rxtx-bounces@linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443@qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443@qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj@www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 10:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri Jun 25 10:48:37 2004 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 12:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 25 12:15:48 2004 Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj@www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 12:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri Jun 25 12:55:37 2004 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj@www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 13:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri Jun 25 13:10:44 2004 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj@www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 13:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 25 13:12:53 2004 Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj@www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 13:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 25 13:17:50 2004 Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj@www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj@www.linux.org.uk From renaud at nentec.de Wed Jun 2 12:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Fri Jun 3 17:46:28 2005 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 12:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:28 2005 Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj@www.linux.org.uk From renaud at nentec.de Wed Jun 2 12:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Fri Jun 3 17:46:28 2005 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 13:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:28 2005 Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj@www.linux.org.uk From jls at sco.com Wed Jun 2 14:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Fri Jun 3 17:46:28 2005 Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 16:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Fri Jun 3 17:46:28 2005 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 10:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri Jun 3 17:46:28 2005 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 13:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:29 2005 Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj@www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 14:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri Jun 3 17:46:29 2005 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj@www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 15:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri Jun 3 17:46:29 2005 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj@www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx@linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 15:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri Jun 3 17:46:29 2005 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj@www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx@linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx@linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 15:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:29 2005 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj@www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 15:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:29 2005 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj@www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx@linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 15:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:29 2005 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj@www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx@linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx@linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj@www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 16:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri Jun 3 17:46:29 2005 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 16:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri Jun 3 17:46:29 2005 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 18:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Fri Jun 3 17:46:29 2005 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 16:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Fri Jun 3 17:46:29 2005 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 15:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Fri Jun 3 17:46:29 2005 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 17:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:29 2005 Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj@www.linux.org.uk From renaud at nentec.de Wed Jun 9 07:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Fri Jun 3 17:46:30 2005 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 09:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Fri Jun 3 17:46:30 2005 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 16:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Fri Jun 3 17:46:30 2005 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 13:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:30 2005 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj@www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 09:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri Jun 3 17:46:30 2005 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp.@EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp.@EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 12:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri Jun 3 17:46:30 2005 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx@linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request@linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner@linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx@linuxgrrls.org" > Message-ID: <40C72DF8.9030208@dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj@www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx@linuxgrrls.org > Message-ID: <40C967ED.9080402@bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp.@EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp.@EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 20:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri Jun 3 17:46:30 2005 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Sat Jun 12 03:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:30 2005 Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix@CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 13:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:30 2005 Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj@www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj@www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://pixie.strangenoises.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0002.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 11:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Fri Jun 3 17:46:31 2005 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20040615/7181668d/attachment.pgp From moritz.gmelin at gmx.de Tue Jun 15 15:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri Jun 3 17:46:31 2005 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0002.obj From jdevora at saadian.com Tue Jun 15 16:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Fri Jun 3 17:46:31 2005 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 16:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Fri Jun 3 17:46:31 2005 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 11:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Fri Jun 3 17:46:31 2005 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx@linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 13:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: Fri Jun 3 17:46:31 2005 Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://pixie.strangenoises.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment.htm From alexandre.ricciardi at free.fr Wed Jun 16 16:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Fri Jun 3 17:46:31 2005 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root@0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root@0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root@0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 16:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Fri Jun 3 17:46:31 2005 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root@0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root@0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root@0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 17:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Fri Jun 3 17:46:31 2005 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen@lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 09:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:31 2005 Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 11:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:31 2005 Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 11:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:31 2005 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root@0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root@0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root@0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 11:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:31 2005 Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj@www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann@stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann@stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 11:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:32 2005 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx@linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 11:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:32 2005 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 03:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:32 2005 Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar@Sun.COM > To: rxtx-bounces@linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443@qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443@qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj@www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 10:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri Jun 3 17:46:32 2005 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 12:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:32 2005 Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj@www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 12:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri Jun 3 17:46:32 2005 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj@www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 13:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri Jun 3 17:46:32 2005 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj@www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 13:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:32 2005 Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj@www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 13:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:32 2005 Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj@www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj@www.linux.org.uk From renaud at nentec.de Wed Jun 2 12:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Fri Jun 3 18:08:51 2005 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 12:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:08:51 2005 Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj@www.linux.org.uk From renaud at nentec.de Wed Jun 2 12:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Fri Jun 3 18:08:51 2005 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 13:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:08:51 2005 Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj@www.linux.org.uk From jls at sco.com Wed Jun 2 14:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Fri Jun 3 18:08:51 2005 Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 16:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Fri Jun 3 18:08:51 2005 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 10:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri Jun 3 18:08:51 2005 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 13:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:08:51 2005 Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj@www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 14:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri Jun 3 18:08:51 2005 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj@www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 15:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri Jun 3 18:08:51 2005 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj@www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx@linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 15:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri Jun 3 18:08:52 2005 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj@www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx@linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx@linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 15:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:08:52 2005 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj@www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 15:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:08:52 2005 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj@www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx@linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 15:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:08:52 2005 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj@www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx@linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx@linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj@www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 16:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri Jun 3 18:08:52 2005 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 16:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri Jun 3 18:08:52 2005 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 18:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Fri Jun 3 18:08:52 2005 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 16:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Fri Jun 3 18:08:52 2005 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 15:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Fri Jun 3 18:08:52 2005 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 17:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:08:52 2005 Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj@www.linux.org.uk From renaud at nentec.de Wed Jun 9 07:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Fri Jun 3 18:08:52 2005 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 09:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Fri Jun 3 18:08:52 2005 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 16:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Fri Jun 3 18:08:52 2005 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 13:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:08:52 2005 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj@www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 09:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri Jun 3 18:08:53 2005 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp.@EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp.@EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 12:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri Jun 3 18:08:53 2005 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx@linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request@linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner@linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx@linuxgrrls.org" > Message-ID: <40C72DF8.9030208@dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj@www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx@linuxgrrls.org > Message-ID: <40C967ED.9080402@bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp.@EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp.@EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 20:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri Jun 3 18:08:53 2005 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Sat Jun 12 03:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:08:53 2005 Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix@CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 13:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:08:53 2005 Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj@www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj@www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://pixie.strangenoises.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0003.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 11:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Fri Jun 3 18:08:53 2005 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0001.pgp From moritz.gmelin at gmx.de Tue Jun 15 15:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri Jun 3 18:08:53 2005 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0003.obj From jdevora at saadian.com Tue Jun 15 16:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Fri Jun 3 18:08:53 2005 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 16:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Fri Jun 3 18:08:54 2005 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 11:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Fri Jun 3 18:08:54 2005 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx@linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 13:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: Fri Jun 3 18:08:54 2005 Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://pixie.strangenoises.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0001.htm From alexandre.ricciardi at free.fr Wed Jun 16 16:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Fri Jun 3 18:08:54 2005 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root@0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root@0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root@0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 16:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Fri Jun 3 18:08:54 2005 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root@0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root@0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root@0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 17:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Fri Jun 3 18:08:54 2005 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen@lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 09:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:08:54 2005 Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 11:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:08:54 2005 Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 11:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:08:54 2005 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root@0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root@0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root@0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 11:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:08:54 2005 Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj@www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann@stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann@stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 11:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:08:54 2005 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx@linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 11:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:08:54 2005 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 03:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:08:55 2005 Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar@Sun.COM > To: rxtx-bounces@linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443@qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443@qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj@www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 10:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri Jun 3 18:08:55 2005 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 12:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:08:55 2005 Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj@www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 12:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri Jun 3 18:08:55 2005 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj@www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 13:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri Jun 3 18:08:55 2005 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj@www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 13:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:08:55 2005 Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj@www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 13:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:08:55 2005 Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj@www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj@www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0395.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0352.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0144.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0395.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0396.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0355.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0167.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0396.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0397.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0357.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0168.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0397.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0398.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0362.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0395.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0398.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0399.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0363.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0396.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0399.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0400.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0365.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0397.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0400.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0401.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0366.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0398.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0401.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0402.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0367.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0399.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0402.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0403.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0368.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0400.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0403.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0404.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0369.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0401.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0404.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0001.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0001.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0001.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0001.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0002.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0002.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0002.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0002.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0003.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0003.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0003.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0003.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0004.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0004.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0004.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0004.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0005.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0005.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0005.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0005.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0006.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0006.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0006.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0006.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0007.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0007.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0007.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0007.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0008.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0008.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0008.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0008.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0009.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0009.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0009.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0009.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0010.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0010.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0010.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0010.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0001.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0001.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0001.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0001.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0002.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0002.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0002.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0002.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0003.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0003.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0003.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0003.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0004.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0004.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0004.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0004.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0005.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0005.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0005.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0005.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0006.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0006.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0006.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0006.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0007.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0007.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0007.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0007.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0008.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0008.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0008.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0008.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0009.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0009.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0009.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0009.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0010.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0010.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0010.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0010.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0001.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0001.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0001.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0001.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0002.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0002.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0002.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0002.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0003.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0003.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0003.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0003.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0004.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0004.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0004.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0004.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0005.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0005.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0005.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0005.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0006.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0006.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0006.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0006.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0007.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0007.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0007.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0007.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0008.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0008.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0008.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0008.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0009.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0009.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0009.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0009.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0010.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0010.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0010.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0010.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0011.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0011.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0011.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0011.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0012.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0012.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0012.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0012.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0013.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0013.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0013.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0013.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0014.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0014.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0014.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0014.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0015.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0015.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0015.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0015.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0016.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0016.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0016.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0016.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0017.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0017.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0017.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0017.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} + serialPort.close(); } } } Jonathan Schilling From doktorbernd at hotmail.com Thu Jun 3 09:17:58 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Thu, 03 Jun 2004 15:17:58 +0000 Subject: [Rxtx] no output on IR port Message-ID: Hi, I am still fighting with the problems I had in "Re: [Rxtx] rxtx on iPAQ, strange Exception" I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2: I can open this port with rxtx and write to it. When I tick the box in connections->beam the port is blocked. So I think this is the port I am looking for. Unfortunately there is no output on my ir port when I am writing to it. When I use COM3 I get some garbaged output and then the message that there is an internal inconsistency in the security accounts manager. Using COM1 for communication works fine. Does anyone have an idea why I won't get an output on COM2:? Thanx, FReAK _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus From moritz.gmelin at gmx.de Fri Jun 4 03:12:18 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 11:12:18 +0200 Subject: [Rxtx] Reproducable Crash Message-ID: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Hi Trent and others, I have a situation where one thread is reading data while the other thread is closing that channel. That gives me a crash (Unexpected Signal 11) at the end of the read_byte_array method where the flags are reset eis->eventflags[SPE_DATA_AVAILABLE] = flag; Can you think of some kind of locking scheme to prevent that ? Greetings Moritz From taj at www.linux.org.uk Fri Jun 4 06:39:34 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 13:39:34 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > Hi Trent and others, > > I have a situation where one thread is reading data while the other > thread is closing that channel. > That gives me a crash (Unexpected Signal 11) at the end of the > read_byte_array method where the flags are reset > > eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > Can you think of some kind of locking scheme to prevent that ? > > Greetings > > Moritz > Ugh. That entire stucture is gone after closing. Before setting the flag you can just add a test to see if the structure is still there: - if ( this && that ) + if( eis && this && that ) { eis->blah = ..; } The information is used for events and the event monitor is gone at that point. You just want to make sure you get the return value. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Fri Jun 4 07:09:48 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 15:09:48 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> eis is still there but it's invalid. That's why it crashes when trying to set the flag. Could it be made something persistant ? And not just valid as long as the eventLoop is running ? M. Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> Hi Trent and others, >> >> I have a situation where one thread is reading data while the other >> thread is closing that channel. >> That gives me a crash (Unexpected Signal 11) at the end of the >> read_byte_array method where the flags are reset >> >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >> >> Can you think of some kind of locking scheme to prevent that ? >> >> Greetings >> >> Moritz >> > > Ugh. > > That entire stucture is gone after closing. Before setting the flag > you > can just add a test to see if the structure is still there: > > - if ( this && that ) > + if( eis && this && that ) > { > eis->blah = ..; > } > > The information is used for events and the event monitor is gone at > that > point. You just want to make sure you get the return value. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From dmarkman at mac.com Fri Jun 4 08:03:21 2004 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Jun 2004 10:03:21 -0400 Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: maybe it's related to cached jni env instance On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >> >>> Hi Trent and others, >>> >>> I have a situation where one thread is reading data while the other >>> thread is closing that channel. >>> That gives me a crash (Unexpected Signal 11) at the end of the >>> read_byte_array method where the flags are reset >>> >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>> >>> Can you think of some kind of locking scheme to prevent that ? >>> >>> Greetings >>> >>> Moritz >>> >> >> Ugh. >> >> That entire stucture is gone after closing. Before setting the flag >> you >> can just add a test to see if the structure is still there: >> >> - if ( this && that ) >> + if( eis && this && that ) >> { >> eis->blah = ..; >> } >> >> The information is used for events and the event monitor is gone at >> that >> point. You just want to make sure you get the return value. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Dmitry Markman From moritz.gmelin at gmx.de Fri Jun 4 08:07:15 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Fri, 4 Jun 2004 16:07:15 +0200 Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: <7B8F9824-B630-11D8-9B0F-000A95BC7E8A@gmx.de> No, I applied Trents Patch to remove the env references yesterday (hat to fix some other stuff with that). It showed the same behaviour in the patched version than it does in the stock 2.1-7pre17. I did a temporary fix, that stores a pointer to the last finalized EIS. If eis == lastFinalizedEIS in the read_byte_array method, then no flags are set. I know that this is BAAAAD coding. But it fixed a crash for me right now. M. Am 04.06.2004 um 16:03 schrieb Dmitry Markman: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > >> eis is still there but it's invalid. >> >> That's why it crashes when trying to set the flag. >> >> Could it be made something persistant ? And not just valid as long as >> the eventLoop is running ? >> >> M. >> >> >> Am 04.06.2004 um 14:39 schrieb Trent Jarvi: >> >>> On Fri, 4 Jun 2004, Moritz Gmelin wrote: >>> >>>> Hi Trent and others, >>>> >>>> I have a situation where one thread is reading data while the other >>>> thread is closing that channel. >>>> That gives me a crash (Unexpected Signal 11) at the end of the >>>> read_byte_array method where the flags are reset >>>> >>>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; >>>> >>>> Can you think of some kind of locking scheme to prevent that ? >>>> >>>> Greetings >>>> >>>> Moritz >>>> >>> >>> Ugh. >>> >>> That entire stucture is gone after closing. Before setting the flag >>> you >>> can just add a test to see if the structure is still there: >>> >>> - if ( this && that ) >>> + if( eis && this && that ) >>> { >>> eis->blah = ..; >>> } >>> >>> The information is used for events and the event monitor is gone at >>> that >>> point. You just want to make sure you get the return value. >>> >>> -- >>> Trent Jarvi >>> taj at www.linux.org.uk >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at linuxgrrls.org >>> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > From taj at www.linux.org.uk Fri Jun 4 08:16:10 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:16:10 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: On Fri, 4 Jun 2004, Moritz Gmelin wrote: > eis is still there but it's invalid. > > That's why it crashes when trying to set the flag. > > Could it be made something persistant ? And not just valid as long as > the eventLoop is running ? > > M. > Hmm I thought there was code like this in finalize_event_info_struct() jeis = (*eis->env)->GetFieldID (eis->env, eis->jclazz, "eis", "I"); (*eis->env)->SetIntField (eis->env, *eis->jobj, jeis, (jint) 0); but its not there. Bouncing information back and forth over the JNI concerning wether the port is open is going to be problematic in that read(). > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > > >> Hi Trent and others, > >> > >> I have a situation where one thread is reading data while the other > >> thread is closing that channel. > >> That gives me a crash (Unexpected Signal 11) at the end of the > >> read_byte_array method where the flags are reset > >> > >> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >> > >> Can you think of some kind of locking scheme to prevent that ? > >> > >> Greetings > >> > >> Moritz > >> > > > > Ugh. > > > > That entire stucture is gone after closing. Before setting the flag > > you > > can just add a test to see if the structure is still there: > > > > - if ( this && that ) > > + if( eis && this && that ) > > { > > eis->blah = ..; > > } > > > > The information is used for events and the event monitor is gone at > > that > > point. You just want to make sure you get the return value. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:26:06 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:26:06 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: This error is a little easier to understand than the jni env thing. I'm planning on looking at the env issue next week after I get grades in. In this case, we closed the port and trashed the pointer to the struct but the read does not know that and tries accessing the memory. I dont think we want the pointer to persist as was suggested. Thats going to lead to things possibly working after we closed the port when the should be throwing IO Exceptions. But storing the pointer over in java and nulling it on close may be problematic for read: open port -> set eis call read()->get eis -> start read waiting, waiting, boom. close() remove eis. oh! got the read!, use eis... Sp I'm guessing we want a native var not stored in java that lets read know the port is closed? I'm a little confused here. I'd like to terminate all reads on that port if close is called. We are unlocking the port and should not touch it. Doing things fancy with threads/signals has proven to be best avoided if possible. I'm looking at the above and thinking right now. But maybe the code snippet just posted will catch most cases. On Fri, 4 Jun 2004, Dmitry Markman wrote: > maybe it's related to cached jni env instance > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > eis is still there but it's invalid. > > > > That's why it crashes when trying to set the flag. > > > > Could it be made something persistant ? And not just valid as long as > > the eventLoop is running ? > > > > M. > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > >> > >>> Hi Trent and others, > >>> > >>> I have a situation where one thread is reading data while the other > >>> thread is closing that channel. > >>> That gives me a crash (Unexpected Signal 11) at the end of the > >>> read_byte_array method where the flags are reset > >>> > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > >>> > >>> Can you think of some kind of locking scheme to prevent that ? > >>> > >>> Greetings > >>> > >>> Moritz > >>> > >> > >> Ugh. > >> > >> That entire stucture is gone after closing. Before setting the flag > >> you > >> can just add a test to see if the structure is still there: > >> > >> - if ( this && that ) > >> + if( eis && this && that ) > >> { > >> eis->blah = ..; > >> } > >> > >> The information is used for events and the event monitor is gone at > >> that > >> point. You just want to make sure you get the return value. > >> > >> -- > >> Trent Jarvi > >> taj at www.linux.org.uk > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > Dmitry Markman > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 4 08:49:11 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 4 Jun 2004 15:49:11 +0100 (BST) Subject: [Rxtx] Reproducable Crash In-Reply-To: References: <473A26BE-B607-11D8-9B0F-000A95BC7E8A@gmx.de> <74F65212-B628-11D8-9B0F-000A95BC7E8A@gmx.de> Message-ID: It looks like a pending read() should return EBADF when the port is closed in the other thread. Between that and nulling jeis I'm fairly sure everything can be caught. On Fri, 4 Jun 2004, Trent Jarvi wrote: > > This error is a little easier to understand than the jni env thing. I'm > planning on looking at the env issue next week after I get grades in. > > In this case, we closed the port and trashed the pointer to the struct but > the read does not know that and tries accessing the memory. > > I dont think we want the pointer to persist as was suggested. Thats going > to lead to things possibly working after we closed the port when the > should be throwing IO Exceptions. > > But storing the pointer over in java and nulling it on close may be > problematic for read: > > open port -> set eis > call read()->get eis -> start read waiting, waiting, > boom. close() remove eis. > oh! got the read!, use eis... > > Sp I'm guessing we want a native var not stored in java that lets read > know the port is closed? I'm a little confused here. I'd like to > terminate all reads on that port if close is called. We are unlocking > the port and should not touch it. > > Doing things fancy with threads/signals has proven to be best avoided if > possible. I'm looking at the above and thinking right now. But maybe the > code snippet just posted will catch most cases. > > On Fri, 4 Jun 2004, Dmitry Markman wrote: > > > maybe it's related to cached jni env instance > > > > On Jun 4, 2004, at 9:09 AM, Moritz Gmelin wrote: > > > > > eis is still there but it's invalid. > > > > > > That's why it crashes when trying to set the flag. > > > > > > Could it be made something persistant ? And not just valid as long as > > > the eventLoop is running ? > > > > > > M. > > > > > > > > > Am 04.06.2004 um 14:39 schrieb Trent Jarvi: > > > > > >> On Fri, 4 Jun 2004, Moritz Gmelin wrote: > > >> > > >>> Hi Trent and others, > > >>> > > >>> I have a situation where one thread is reading data while the other > > >>> thread is closing that channel. > > >>> That gives me a crash (Unexpected Signal 11) at the end of the > > >>> read_byte_array method where the flags are reset > > >>> > > >>> eis->eventflags[SPE_DATA_AVAILABLE] = flag; > > >>> > > >>> Can you think of some kind of locking scheme to prevent that ? > > >>> > > >>> Greetings > > >>> > > >>> Moritz > > >>> > > >> > > >> Ugh. > > >> > > >> That entire stucture is gone after closing. Before setting the flag > > >> you > > >> can just add a test to see if the structure is still there: > > >> > > >> - if ( this && that ) > > >> + if( eis && this && that ) > > >> { > > >> eis->blah = ..; > > >> } > > >> > > >> The information is used for events and the event monitor is gone at > > >> that > > >> point. You just want to make sure you get the return value. > > >> > > >> -- > > >> Trent Jarvi > > >> taj at www.linux.org.uk > > >> _______________________________________________ > > >> Rxtx mailing list > > >> Rxtx at linuxgrrls.org > > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > >> > > > > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at linuxgrrls.org > > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > > > > > Dmitry Markman > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > -- Trent Jarvi taj at www.linux.org.uk From rxtx at gantzgulch.com Fri Jun 4 09:03:46 2004 From: rxtx at gantzgulch.com (Michael L. Gantz) Date: Fri, 04 Jun 2004 11:03:46 -0400 Subject: [Rxtx] Fedora Core 1, Java 1-Wire API, Crashes. Message-ID: <1086361425.2208.40.camel@localhost.localdomain> Distribution: Fedora Core 1 - All updates applied. Kernel: 2.4.22-1.2188.nptl JDK: Sun j2sdk 1.4.2_03 Application: Dallas 1 Wire API http://www.ibutton.com/software/1wire/1wire_api.html I get lots of somewhat predictable crashes with this combination. I believe this is related to a previous problem reported here: http://marc.theaimsgroup.com/?l=rxtx&m=108440326319032&w=2 I tried applying the patch included in the article but it didn't fix the crash problem. I have time, and need this working, so I am more than willing to any testing, code hacking, debugging required. I just need some hints as to where to start. My crash with the patch looks like the following: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4CF51B5C Function=get_java_var+0xC Library=/opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial.so Current Java thread: at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1529) Dynamic libraries: 0050a000-0051c000 r-xp 00000000 03:03 735492 /lib/libnsl-2.3.2.so 0051c000-0051d000 rw-p 00011000 03:03 735492 /lib/libnsl-2.3.2.so 00590000-005a5000 r-xp 00000000 03:03 734505 /lib/ld-2.3.2.so 005a5000-005a6000 rw-p 00015000 03:03 734505 /lib/ld-2.3.2.so 005a8000-006db000 r-xp 00000000 03:03 1894175 /lib/tls/libc-2.3.2.so 006db000-006df000 rw-p 00132000 03:03 1894175 /lib/tls/libc-2.3.2.so 006e3000-00704000 r-xp 00000000 03:03 1894176 /lib/tls/libm-2.3.2.so 00704000-00705000 rw-p 00020000 03:03 1894176 /lib/tls/libm-2.3.2.so 00707000-00709000 r-xp 00000000 03:03 735483 /lib/libdl-2.3.2.so 00709000-0070a000 rw-p 00001000 03:03 735483 /lib/libdl-2.3.2.so 0070c000-007e7000 r-xp 00000000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007e7000-007ea000 rw-p 000db000 03:03 652937 /usr/X11R6/lib/libX11.so.6.2 007ec000-007f9000 r-xp 00000000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 007f9000-007fa000 rw-p 0000c000 03:03 652949 /usr/X11R6/lib/libXext.so.6.4 0080f000-00823000 r-xp 00000000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00823000-00824000 rw-p 00013000 03:03 652905 /usr/X11R6/lib/libICE.so.6.3 00828000-0082f000 r-xp 00000000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 0082f000-00830000 rw-p 00007000 03:03 653353 /usr/X11R6/lib/libSM.so.6.0 00832000-0083f000 r-xp 00000000 03:03 1894177 /lib/tls/libpthread-0.60.so 0083f000-00840000 rw-p 0000d000 03:03 1894177 /lib/tls/libpthread-0.60.so 00858000-008a6000 r-xp 00000000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 008a6000-008aa000 rw-p 0004e000 03:03 653354 /usr/X11R6/lib/libXt.so.6.0 00934000-0093b000 r-xp 00000000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 0093b000-0093c000 rw-p 00006000 03:03 652940 /usr/X11R6/lib/libXrender.so.1.2.2 009af000-009b6000 r-xp 00000000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 009b6000-009b7000 rw-p 00006000 03:03 653359 /usr/X11R6/lib/libXp.so.6.2 00df4000-00df8000 r-xp 00000000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 00df8000-00df9000 rw-p 00004000 03:03 653358 /usr/X11R6/lib/libXtst.so.6.1 08048000-0804e000 r-xp 00000000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 0804e000-0804f000 rw-p 00005000 03:03 1371087 /opt/j2sdk1.4.2_03/bin/java 40000000-40008000 r-xp 00000000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40008000-40009000 rw-p 00007000 03:03 278340 /opt/j2sdk1.4.2_03/jre/lib/i386/native_threads/libhpi.so 40009000-4000d000 rw-s 00000000 03:03 980856 /tmp/hsperfdata_gantzm/7369 4000f000-40409000 r-xp 00000000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40409000-40425000 rw-p 003f9000 03:03 425111 /opt/j2sdk1.4.2_03/jre/lib/i386/client/libjvm.so 40437000-4043a000 r--s 00000000 03:03 539161 /opt/j2sdk1.4.2_03/jre/lib/ext/dnsns.jar 4043a000-4043c000 r-xp 00000000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 4043c000-4043d000 rw-p 00001000 03:03 1436286 /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2 40444000-4044e000 r-xp 00000000 03:03 734449 /lib/libnss_files-2.3.2.so 4044e000-4044f000 rw-p 0000a000 03:03 734449 /lib/libnss_files-2.3.2.so 4044f000-4045f000 r-xp 00000000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 4045f000-40461000 rw-p 0000f000 03:03 669909 /opt/j2sdk1.4.2_03/jre/lib/i386/libverify.so 40461000-40481000 r-xp 00000000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40481000-40483000 rw-p 0001f000 03:03 669910 /opt/j2sdk1.4.2_03/jre/lib/i386/libjava.so 40483000-40497000 r-xp 00000000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 40497000-4049a000 rw-p 00013000 03:03 669912 /opt/j2sdk1.4.2_03/jre/lib/i386/libzip.so 4049a000-41e32000 r--s 00000000 03:03 670186 /opt/j2sdk1.4.2_03/jre/lib/rt.jar 41e7c000-41e92000 r--s 00000000 03:03 669934 /opt/j2sdk1.4.2_03/jre/lib/sunrsasign.jar 41e92000-41f6d000 r--s 00000000 03:03 670183 /opt/j2sdk1.4.2_03/jre/lib/jsse.jar 41f6d000-41f7e000 r--s 00000000 03:03 669935 /opt/j2sdk1.4.2_03/jre/lib/jce.jar 41f7e000-424d7000 r--s 00000000 03:03 670184 /opt/j2sdk1.4.2_03/jre/lib/charsets.jar 4c987000-4c9a3000 r--s 00000000 03:03 539160 /opt/j2sdk1.4.2_03/jre/lib/ext/sunjce_provider.jar 4c9a3000-4c9b2000 r--s 00000000 03:03 539816 /opt/j2sdk1.4.2_03/jre/lib/ext/RXTXcomm.jar 4c9b2000-4c9bf000 r--s 00000000 03:03 539163 /opt/j2sdk1.4.2_03/jre/lib/ext/ldapsec.jar 4c9bf000-4ca7b000 r--s 00000000 03:03 539230 /opt/j2sdk1.4.2_03/jre/lib/ext/localedata.jar 4ca7b000-4cae1000 r--s 00000000 03:03 180841 /home/gantzm/tmp/builds/owapi/lib/OneWireAPI.jar 4cae1000-4cb1c000 r--s 00000000 03:03 1502765 /home/gantzm/tmp/builds/owapi/examples/OneWireViewer/OneWireViewer.jar 4cb1c000-4cde7000 r-xp 00000000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4cde7000-4cdfd000 rw-p 002ca000 03:03 669920 /opt/j2sdk1.4.2_03/jre/lib/i386/libawt.so 4ce22000-4ce75000 r-xp 00000000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce75000-4ce76000 rw-p 00052000 03:03 669919 /opt/j2sdk1.4.2_03/jre/lib/i386/libmlib_image.so 4ce76000-4cf30000 r-xp 00000000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf30000-4cf4a000 rw-p 000b9000 03:03 669923 /opt/j2sdk1.4.2_03/jre/lib/i386/libfontmanager.so 4cf4b000-4cf55000 r-xp 00000000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf55000-4cf56000 rw-p 00009000 03:03 669771 /opt/j2sdk1.4.2_03/jre/lib/i386/librxtxSerial-2.1-7pre17.so 4cf58000-4cf60000 r-xp 00000000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf60000-4cf61000 rw-p 00007000 03:03 652928 /usr/X11R6/lib/libXcursor.so.1.0 4cf61000-4cf7d000 r-xp 00000000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4cf7d000-4cf7f000 rw-p 0001b000 03:03 1436283 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2 4d102000-4d139000 r-xp 00000000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so 4d139000-4d13a000 rw-p 00036000 03:03 669924 /opt/j2sdk1.4.2_03/jre/lib/i386/libjpeg.so Heap at VM Abort: Heap def new generation total 576K, used 407K [0x44580000, 0x44620000, 0x44a60000) eden space 512K, 67% used [0x44580000, 0x445d5c90, 0x44600000) from space 64K, 100% used [0x44600000, 0x44610000, 0x44610000) to space 64K, 0% used [0x44610000, 0x44610000, 0x44620000) tenured generation total 2468K, used 1616K [0x44a60000, 0x44cc9000, 0x48580000) the space 2468K, 65% used [0x44a60000, 0x44bf43a8, 0x44bf4400, 0x44cc9000) compacting perm gen total 6912K, used 6714K [0x48580000, 0x48c40000, 0x4c580000) the space 6912K, 97% used [0x48580000, 0x48c0e828, 0x48c0ea00, 0x48c40000) Local Time = Fri Jun 4 10:59:11 2004 Elapsed Time = 293 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode) # # An error report file has been saved as hs_err_pid7369.log. # Please refer to the file for further information. # Aborted From scharrlach at bktel.com Fri Jun 4 09:23:45 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 04 Jun 2004 17:23:45 +0200 Subject: [Rxtx] lockdev support Message-ID: <40C09401.70802@bktel.com> Hi, maybe I am missing something, but on systems using "lockdev" (like Fedora) the locking of the current rxtx isn't working quite well, e.g. if you share the serial port with mgetty. A quick hack to use lockdev would be: diff -r ./src/SerialImp.c /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.c 111,114d110 < #ifdef LOCKDEV < #include < #endif < 4997,5001d4992 < int dev_lock_wrapper( const char *filename, int pid ) < { < return dev_lock(filename); < } < diff -r ./src/SerialImp.h /home/scharrla/tmp/rxtx-2.1-7pre17/src/SerialImp.h 114,115c114 < // # define FHS < # define LOCKDEV --- > # define FHS 308,311c307 < #if defined(LOCKDEV) < # define LOCK dev_lock_wrapper < # define UNLOCK dev_unlock < #elif defined(LOCKDEV) /* Use a Lock File Server */ --- > #ifdef LFS /* Use a Lock File Server */ plus you'll have to link with "-llockdev". The really big advantage is that you don't need to be in the group "lock" anymore to lock the serial port. Bye, Jochen From jasmine at linuxgrrls.org Sun Jun 6 11:34:22 2004 From: jasmine at linuxgrrls.org (Jasmine Strong) Date: Sun, 6 Jun 2004 19:34:22 +0200 Subject: [Rxtx] Testing Message-ID: Are we quick, are we late? Hex, our Vast Industrial Engine, sprouted another RAM flaw today, and fell down in a big heap. Due to the sterling efforts of Rachel, we have it running again. (We have modified the Linux kernel on that machine to ignore the two dead bits of RAM. Total loss == 8KiB. Yay for Linux!) No data was lost but if you've sent mails to any linuxgrrls.org address and had them bounce, I should like to extend my apologies; please send them again. -Jasmine, the very remote sysadmin... From renaud at nentec.de Mon Jun 7 09:34:44 2004 From: renaud at nentec.de (Fabien Renaud) Date: Mon, 07 Jun 2004 17:34:44 +0200 Subject: [Rxtx] getPortIdentifiers() Message-ID: <40C48B14.4060103@nentec.de> Hello, Some days ago the SimpleWriter sample worked better. Now I have a problem at the begining : The line portList = CommPortIdentifier.getPortIdentifiers(); returns null. What could be the reason ? Cheers, Fabien From renaud at nentec.de Tue Jun 8 08:50:16 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 08 Jun 2004 16:50:16 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C48B14.4060103@nentec.de> References: <40C48B14.4060103@nentec.de> Message-ID: <40C5D228.5020505@nentec.de> Hello, I?m cross-compiling rxtx for arm. I have this message when I want to run SimpleWrite class : RXTX WARNING: This library was compiled to run with OS release 2.4.20_dev and you are currently runnin g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. Try recompiling RXTX if you notic e strange behavior. If you just compiled RXTX make sure /usr/include/linux is a symbolic link to the i nclude files that came with the kernel source and not an older copy. press enter to continue This message appears when RXTXPort wants to load Zystem. When I press enter, nothing happened ! Someome has an idea of the problem ? Cheers, Fabien From taj at www.linux.org.uk Tue Jun 8 10:15:04 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Jun 2004 17:15:04 +0100 (BST) Subject: [rxtx] cross compilation In-Reply-To: <40C5D228.5020505@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: On Tue, 8 Jun 2004, Fabien Renaud wrote: > Hello, > > I?m cross-compiling rxtx for arm. I have this message when I want to run > SimpleWrite class : > > RXTX WARNING: This library was compiled to run with OS release > 2.4.20_dev and you are currently runnin > g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. > Try recompiling RXTX if you notic > e strange behavior. If you just compiled RXTX make sure > /usr/include/linux is a symbolic link to the i > nclude files that came with the kernel source and not an older copy. > > press enter to continue > > > This message appears when RXTXPort wants to load Zystem. > > When I press enter, nothing happened ! > > Someome has an idea of the problem ? > Hi Fabien If rxtx is trying to load the Zystem native library, then you have a version of the code that was used for debugging some w32 problems. The Zystem.java class should look like: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 9 00:54:17 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 08:54:17 +0200 Subject: [rxtx] cross compilation In-Reply-To: References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> Message-ID: <40C6B419.3010702@nentec.de> Trent Jarvi wrote: >On Tue, 8 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I?m cross-compiling rxtx for arm. I have this message when I want to run >>SimpleWrite class : >> >>RXTX WARNING: This library was compiled to run with OS release >>2.4.20_dev and you are currently runnin >>g OS release 2.4.21-rmk2-pxa1. In some cases this can be a problem. >>Try recompiling RXTX if you notic >>e strange behavior. If you just compiled RXTX make sure >>/usr/include/linux is a symbolic link to the i >>nclude files that came with the kernel source and not an older copy. >> >>press enter to continue >> >> >>This message appears when RXTXPort wants to load Zystem. >> >>When I press enter, nothing happened ! >> >>Someome has an idea of the problem ? >> >> >> > >Hi Fabien > >If rxtx is trying to load the Zystem native library, then you have a >version of the code that was used for debugging some w32 problems. > >The Zystem.java class should look like: > >ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java > > > > I have exactly this version. Fabien From renaud at nentec.de Wed Jun 9 02:17:10 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 09 Jun 2004 10:17:10 +0200 Subject: [rxtx] cross compilation In-Reply-To: <40C6B419.3010702@nentec.de> References: <40C48B14.4060103@nentec.de> <40C5D228.5020505@nentec.de> <40C6B419.3010702@nentec.de> Message-ID: <40C6C786.7020203@nentec.de> Fabien Renaud wrote: > Trent Jarvi wrote: > >> On Tue, 8 Jun 2004, Fabien Renaud wrote: >> >> >> >>> Hello, >>> >>> I?m cross-compiling rxtx for arm. I have this message when I want to >>> run SimpleWrite class : >>> >>> RXTX WARNING: This library was compiled to run with OS release >>> 2.4.20_dev and you are currently runnin >>> g OS release 2.4.21-rmk2-pxa1. In some cases this can be a >>> problem. Try recompiling RXTX if you notic >>> e strange behavior. If you just compiled RXTX make sure >>> /usr/include/linux is a symbolic link to the i >>> nclude files that came with the kernel source and not an older copy. >>> >>> press enter to continue >>> >>> >>> This message appears when RXTXPort wants to load Zystem. >>> >>> When I press enter, nothing happened ! >>> >>> Someome has an idea of the problem ? >>> >>> >> >> >> Hi Fabien >> >> If rxtx is trying to load the Zystem native library, then you have a >> version of the code that was used for debugging some w32 problems. >> >> The Zystem.java class should look like: >> >> ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/src/Zystem.java >> >> >> >> > I have exactly this version. > > Fabien Well, I think it?s due to kaffe. When I use anoter VM (sableVM) I have this : fhs_lock: creating lockfile: 780 open: locking worked for /dev//dev/ttyS3 Port /dev/ttyS3 in use by another application *** Couldn't bind native method Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner *** *** or Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner__Ljava_lang_String_2 *** java.lang.UnsatisfiedLinkError at gnu.io.CommPortIdentifier.native_psmisc_report_owner (CommPortIdentifier.java) at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) at SimpleWrite.main (SimpleWrite.java:20) Fabien From paul.bade at dot21rts.com Wed Jun 9 09:34:16 2004 From: paul.bade at dot21rts.com (Paul Bade) Date: Wed, 09 Jun 2004 11:34:16 -0400 Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call Message-ID: <40C72DF8.9030208@dot21rts.com> Hi, I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat and I observed the following error: [java] Exception in thread "main" java.lang.VerifyError: (class: gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) Illegal use of nonvirtual function call [java] at gnu.io.RXTXPort.(RXTXPort.java) [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) [java] at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) Does anyone know if there is work being done to address this issue? Thanks, Paul Bade From taj at www.linux.org.uk Thu Jun 10 06:46:15 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function call In-Reply-To: <40C72DF8.9030208@dot21rts.com> References: <40C72DF8.9030208@dot21rts.com> Message-ID: On Wed, 9 Jun 2004, Paul Bade wrote: > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > This is an older version of rxtx. With some VM's you can pass -noverify to avoid the problem. The innerclasses need protected not private methods. This was fixed in later versions. You can also make the changes yourself. The native code does not need to be recompiled - just the class. -- Trent Jarvi taj at www.linux.org.uk From scharrlach at bktel.com Fri Jun 11 02:06:05 2004 From: scharrlach at bktel.com (Jochen Scharrlach) Date: Fri, 11 Jun 2004 10:06:05 +0200 Subject: [Rxtx] native_psmisc_report_owner on Linux Message-ID: <40C967ED.9080402@bktel.com> Hi, there seems to be a bug in Makefile.in which prevents src/fuserImp.c (includes native_psmisc_report_owner) to be included into librxtxSerial. A patch could be: $ diff Makefile.in Makefile.in.old 423,424c423,424 < if [ "$*" = "Serial" ]; then \ < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ --- > if [ "$*" = "rxtxSerial" ]; then \ > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH seems to be absolute. BTW, src/CommPortIdentifier.java still includes a warning in the "static" part that native_psmisc_report_owner is not supported on Linux, while CommPortIdentifier.open() always uses this method to identify the port owner on a locked device (which causes a nasty java.lang.UnsatisfiedLinkError without my patch). Bye, Jochen From o_bolutiwi at cardstechnology.com Fri Jun 11 05:23:49 2004 From: o_bolutiwi at cardstechnology.com (Olumide Bolutiwi) Date: Fri, 11 Jun 2004 12:23:49 +0100 Subject: [Rxtx] Re: Rxtx Digest, Vol 15, Issue 9 References: <20040611110002.EDC2374F0D@mail.linuxgrrls.org> Message-ID: <001201c44fa8$622d6a20$0a00a8c0@cardstechnology.com> recompile with -noverify Olumide. ----- Original Message ----- From: To: Sent: Friday, June 11, 2004 12:00 PM Subject: Rxtx Digest, Vol 15, Issue 9 > Send Rxtx mailing list submissions to > rxtx at linuxgrrls.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > or, via email, send a message with subject or body 'help' to > rxtx-request at linuxgrrls.org > > You can reach the person managing the list at > rxtx-owner at linuxgrrls.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Rxtx digest..." > > > Today's Topics: > > 1. rxtx and jdk1.5.0 - Illegal use of nonvirtual function call > (Paul Bade) > 2. Re: rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call (Trent Jarvi) > 3. native_psmisc_report_owner on Linux (Jochen Scharrlach) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 09 Jun 2004 11:34:16 -0400 > From: Paul Bade > Subject: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual function > call > To: "rxtx at linuxgrrls.org" > Message-ID: <40C72DF8.9030208 at dot21rts.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > and I observed the following error: > > [java] Exception in thread "main" java.lang.VerifyError: (class: > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > Illegal use of nonvirtual function call > [java] at gnu.io.RXTXPort.(RXTXPort.java) > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > [java] at > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > Does anyone know if there is work being done to address this issue? > > Thanks, > > Paul Bade > > > > > ------------------------------ > > Message: 2 > Date: Thu, 10 Jun 2004 13:46:15 +0100 (BST) > From: Trent Jarvi > Subject: Re: [Rxtx] rxtx and jdk1.5.0 - Illegal use of nonvirtual > function call > To: Java RXTX discussion > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII > > On Wed, 9 Jun 2004, Paul Bade wrote: > > > Hi, > > > > I am trying to use RXTX in conjunction with jdk1.5.0beta2 on Redhat > > and I observed the following error: > > > > [java] Exception in thread "main" java.lang.VerifyError: (class: > > gnu/io/RXTXPort$SerialOutputStream, method: flush signature: ()V) > > Illegal use of nonvirtual function call > > [java] at gnu.io.RXTXPort.(RXTXPort.java) > > [java] at gnu.io.RXTXCommDriver.getCommPort(RXTXCommDriver.java) > > [java] at > > javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634) > > > > Does anyone know if there is work being done to address this issue? > > > > Thanks, > > > > Paul Bade > > > > > This is an older version of rxtx. With some VM's you can pass -noverify > to avoid the problem. The innerclasses need protected not private > methods. This was fixed in later versions. You can also make the changes > yourself. The native code does not need to be recompiled - just the > class. > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ------------------------------ > > Message: 3 > Date: Fri, 11 Jun 2004 10:06:05 +0200 > From: Jochen Scharrlach > Subject: [Rxtx] native_psmisc_report_owner on Linux > To: rxtx at linuxgrrls.org > Message-ID: <40C967ED.9080402 at bktel.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi, > > there seems to be a bug in Makefile.in which prevents src/fuserImp.c > (includes native_psmisc_report_owner) to be included into librxtxSerial. > A patch could be: > > $ diff Makefile.in Makefile.in.old > 423,424c423,424 > < if [ "$*" = "Serial" ]; then \ > < $(LIBTOOLC) $(SPATH)/fuserImp. at EXTENSION@ \ > --- > > if [ "$*" = "rxtxSerial" ]; then \ > > $(LIBTOOLC) ../$(SPATH)/fuserImp. at EXTENSION@ \ > > i.e. the "rxtx" is in the way and the "../" is wrong, because SPATH > seems to be absolute. > > BTW, src/CommPortIdentifier.java still includes a warning in the > "static" part that native_psmisc_report_owner is not supported on Linux, > while CommPortIdentifier.open() always uses this method to identify the > port owner on a locked device (which causes a nasty > java.lang.UnsatisfiedLinkError without my patch). > > Bye, > Jochen > > > > ------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > End of Rxtx Digest, Vol 15, Issue 9 > *********************************** > > From Frederic.Lacroix at CSE-CST.GC.CA Fri Jun 11 13:39:07 2004 From: Frederic.Lacroix at CSE-CST.GC.CA (Frederic.Lacroix@CSE-CST.GC.CA) Date: Fri, 11 Jun 2004 15:39:07 -0400 Subject: [Rxtx] removeEventListener problem? (U) Message-ID: <0B8192558DC8D51185D500062955141B19F697@dagger> Classification: UNCLASSIFIED OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 Java: J2SDK 1.4.2_03 RXTX: 2.1-7pre17 Sounds like the removeEventListener for at least SerialPort doesn't complete its work. The following code snippet is a very simplified example: ---------------------------------------------------------------------------- ------ import java.io.IOException; import java.util.Enumeration; import java.util.TooManyListenersException; import javax.swing.JFrame; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; public class Test implements SerialPortEventListener { private static final int MAX_DATA_LENGTH = 1024; private static final int MAX_SIZE = 8192; private static final int BAUD_RATE = 38400; private static final int PARITY = SerialPort.PARITY_NONE; private static final int BIT_LENGTH = SerialPort.DATABITS_8; private static final int STOPBITS = SerialPort.STOPBITS_1; private static final int TIMEOUT = 2500; private SerialPort serialPort; public Test() throws Exception { super(); initUI(); open("COM1"); } private void initUI() { JFrame editor = new JFrame(); editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); editor.pack(); editor.setLocationRelativeTo(null); editor.show(); } public void open(String port) throws PortInUseException, UnsupportedCommOperationException, NoSuchPortException, TooManyListenersException, IOException { CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(port); serialPort = (SerialPort) identifier.open(port, TIMEOUT); serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, STOPBITS, PARITY); serialPort.addEventListener(this); serialPort.notifyOnDataAvailable(true); } public void serialEvent(SerialPortEvent event) { if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) { try { byte[] data = new byte[5]; System.out.println("Incoming data!!!"); serialPort.getInputStream().read(data, 0, 5); System.out.println("Data read: " + new String(data)); serialPort.removeEventListener(); System.out.println("Listener removed"); serialPort.addEventListener(this); System.out.println("Listener added"); } catch (Exception e) { e.printStackTrace(); } } } public static void main(String[] args) { try { new Test(); } catch (Exception e) { e.printStackTrace(); } } } ---------------------------------------------------------------------------- ---- This example works fine with comm.jar, ie the data is read and printed, the listener is removed then re-added and the new incoming data is read, printed, etc. Using RXTX, the incoming data is read and printed, but listener is not removed. Am I doing something wrong? Is this a RXTX or a COMM bug? Any assistance would be appreciated. Fred From taj at www.linux.org.uk Fri Jun 11 20:04:40 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 03:04:40 +0100 (BST) Subject: [Rxtx] removeEventListener problem? (U) In-Reply-To: <0B8192558DC8D51185D500062955141B19F697@dagger> References: <0B8192558DC8D51185D500062955141B19F697@dagger> Message-ID: On Fri, 11 Jun 2004 Frederic.Lacroix at CSE-CST.GC.CA wrote: > Classification: UNCLASSIFIED > > OS: Linux Fedora Core 1 (kernel 2.4.21-9.EL), Windows NT 4 SP6 > Java: J2SDK 1.4.2_03 > RXTX: 2.1-7pre17 > > Sounds like the removeEventListener for at least SerialPort doesn't complete > its work. The following code snippet is a very simplified example: > > ---------------------------------------------------------------------------- > ------ > > import java.io.IOException; > import java.util.Enumeration; > import java.util.TooManyListenersException; > > import javax.swing.JFrame; > > import gnu.io.CommPortIdentifier; > import gnu.io.NoSuchPortException; > import gnu.io.PortInUseException; > import gnu.io.SerialPort; > import gnu.io.SerialPortEvent; > import gnu.io.SerialPortEventListener; > import gnu.io.UnsupportedCommOperationException; > > public class Test implements SerialPortEventListener { > > private static final int MAX_DATA_LENGTH = 1024; > private static final int MAX_SIZE = 8192; > private static final int BAUD_RATE = 38400; > private static final int PARITY = SerialPort.PARITY_NONE; > private static final int BIT_LENGTH = SerialPort.DATABITS_8; > private static final int STOPBITS = SerialPort.STOPBITS_1; > private static final int TIMEOUT = 2500; > > private SerialPort serialPort; > > public Test() throws Exception { > super(); > initUI(); > open("COM1"); > > } > > private void initUI() { > > JFrame editor = new JFrame(); > > editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > editor.pack(); > editor.setLocationRelativeTo(null); > editor.show(); > > } > > public void open(String port) > throws > PortInUseException, > UnsupportedCommOperationException, > NoSuchPortException, > TooManyListenersException, > IOException { > > CommPortIdentifier identifier = > CommPortIdentifier.getPortIdentifier(port); > > serialPort = (SerialPort) identifier.open(port, TIMEOUT); > > serialPort.setSerialPortParams(BAUD_RATE, BIT_LENGTH, > STOPBITS, PARITY); > serialPort.addEventListener(this); > serialPort.notifyOnDataAvailable(true); > } > > public void serialEvent(SerialPortEvent event) { > > if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) > { > try { > byte[] data = new byte[5]; > System.out.println("Incoming data!!!"); > serialPort.getInputStream().read(data, 0, > 5); > System.out.println("Data read: " + new > String(data)); > serialPort.removeEventListener(); > System.out.println("Listener removed"); > serialPort.addEventListener(this); > System.out.println("Listener added"); > > } catch (Exception e) { > e.printStackTrace(); > } > } > > } > > public static void main(String[] args) { > try { > new Test(); > } catch (Exception e) { > e.printStackTrace(); > } > } > } > > ---------------------------------------------------------------------------- > ---- > > This example works fine with comm.jar, ie the data is read and printed, the > listener is removed then re-added and the new incoming data is read, > printed, etc. > Using RXTX, the incoming data is read and printed, but listener is not > removed. Am I doing something wrong? Is this a RXTX or a COMM bug? > > Any assistance would be appreciated. > Hi Fred I suspect this a bug in rxtx and is related to "Closing a port from an event listener results in a deadlock." Esentially the remove call is waiting for the native code to finish sending the event. You should be able to avoid the problem by removing the event listener outside the scope of serialEvent(). -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sat Jun 12 06:10:20 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 12 Jun 2004 13:10:20 +0100 (BST) Subject: [Rxtx] Thank you for your excellent work on rxtx (fwd) Message-ID: Nils sent some nice documentation on rxtx. I'm forwarding this to the mail-list as I know some people have web pages out there that will be interested. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 12 Jun 2004 11:33:50 +0200 From: Nils Emil Pejstrup Larsen To: taj at www.linux.org.uk Subject: Thank you for your excellent work on rxtx Hello I'm an EE student at Danish Technical University. I'm using rxtx in a project regarding control of small mobile robots and I appreciate the ease of use and the support for both Windows and Linux. I have written a small document about installation and use of rxtx - mostly for internal use at the institute. But it might also be useful for other people. It is not on the web yet. You may do whatever you want with it including ignoring it or put it on the www.rxtx.org page. Thank you for your work on rxtx. Nils Emil P. Larsen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040612/7eef774b/rxtx_setup-0018.html -------------- next part -------------- From valirion at gmx.net Tue Jun 15 04:07:56 2004 From: valirion at gmx.net (Bernd Pachur) Date: Tue, 15 Jun 2004 12:07:56 +0200 Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: 20040430061841.23AF17327D@mail.linuxgrrls.org References: 20040430061841.23AF17327D@mail.linuxgrrls.org Message-ID: <1087294076.7548.55.camel@academia.thybaria.local> Hi! I had similar Problems with the CVS-Version from yesterday and with the latest release version. I am running gentoo too (for insiders: ~x86)! uname -a: Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 Celeron (Mendocino) GenuineIntel GNU/Linux java -version: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) I do not add the error output, because it is similar to the one of Rico. The error also occurs, when you call getReceiveTimeout(). It seems that I managed to solve the problem. I compiled my rxtx version with debugging on and tried to find the error. To pin down the lines in the native code that caused the problem, I tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" and "NativegetReceiveTimeout" in "SerialImpl.c" . When I added the lines at the following location in both methods: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; char message[80]; sprintf(message,"ReceiveTimeout: trace"); report(message); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; The problem suddenly disappeared. This combined with the fact that all problems occured on systems that use nptl threads suggested to me, that the problem is some kind of timing problem, when doing "tcgetattr". I then changed my addition to the code from adding "report(messsage)" lines to adding a "usleep" line: { int fd = get_java_var (env, jobj, "fd", "I"); struct termios ttyset; usleep(1000); ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); if (tcgetattr (fd, &ttyset) < 0) goto fail; And guess what, the error is gone! I don't know if this is a feasible solution on all systems, because I normally do not code in C but in JAVA and only remeber some basics from my C course, but at least for me it works. It should probably be tested on other systems too before permanently adding it to the code. Cheers, Bernd Pachur > Hello folks, > > I think I have the same problem Willem Riede reported on March 21, 2004. I get > the following: > > Devel Library > ========================================= > Native lib Version = RXTX-2.0-7pre1 > Java lib Version = RXTX-2.0-7pre1 > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > Port: /dev/usb/tts/0 - Serial > Unexpected Signal : 11 occurred at PC=0x8062b35 > Function name=(N/A) > Library=(N/A) > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > Current Java thread: > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native Method) > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > at Ctest.main(Ctest.java:14) > > > whenever my program invokes isReceiveTimeoutEnabled(). The other isXXX() methods > seem to work fine. I was initially running this on: > > Gentoo Linux 2004.0 > Linux kernel 2.6.5 (gentoo-dev-sources) > Sun JDK 1.4.2.04 > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > I tried with > > Sun JDK 1.3.1.09 > > Same behavior. Does anyone have any other suggestions? > > Rico Juinio -- Text mails preferred! No HTML-mail please! Encrypted mails preferred! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/7181668d/attachment-0018.bin From moritz.gmelin at gmx.de Tue Jun 15 08:40:06 2004 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 15 Jun 2004 16:40:06 +0200 Subject: [Rxtx] Error-Logs Message-ID: Hi, can anybody tell me why RXTX is crashing at that point ? I'm not calling setEndOfInputChar anywhere ! M. -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid3892.log Type: application/octet-stream Size: 4501 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20040615/f1e370f4/hs_err_pid3892-0018.obj From jdevora at saadian.com Tue Jun 15 09:46:24 2004 From: jdevora at saadian.com (JD Evora) Date: Tue, 15 Jun 2004 16:46:24 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found Message-ID: <40CF19D0.3090900@saadian.com> Hi, I download rxtx-2.0-7pre1 and did a make install it seams to install OK I am trying to use them with a program that relays on Sun's comm API and when I run it I get java.lang.NoClassDefFoundError: gnu/io/CommPort From the INSTALL document I saw that it happens when RXTXcomm.jar is not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar as well) I opened the jar file and I didn't see the CommPort class there are LPRPort*.class and RXTXPort*.class files but not just a CommPort.class one Did I miss a configuration step somewhere? Thank you very much JD Evora From renaud at nentec.de Tue Jun 15 09:56:23 2004 From: renaud at nentec.de (Fabien Renaud) Date: Tue, 15 Jun 2004 17:56:23 +0200 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF19D0.3090900@saadian.com> References: <40CF19D0.3090900@saadian.com> Message-ID: <40CF1C27.7030400@nentec.de> Hi, If you type jar -tf RXTXcomm.jar you should have a line like this : gnu/io/CommPort.class Oh I didn?t see it. You use 2.0.x version. You should use 2.1.x version. With this one you don?t need CommAPI from SUN and you put your classes in gnu/io/ whereas it?s different with 2.0.x. Humm I hope you?ll understand what I wanted to say ^^ So use 2.1-7pre17 and everything will be ok. Fabien JD Evora wrote: > Hi, > > I download rxtx-2.0-7pre1 and did a make install it seams to install OK > > I am trying to use them with a program that relays on Sun's comm API > and when I run it I get > > java.lang.NoClassDefFoundError: gnu/io/CommPort > > From the INSTALL document I saw that it happens when RXTXcomm.jar is > not in the class path, but it is. (and in the jre/lib/ext/RXTXcomm.jar > as well) > > I opened the jar file and I didn't see the CommPort class there are > LPRPort*.class and RXTXPort*.class files but not just a > CommPort.class one > > Did I miss a configuration step somewhere? > > Thank you very much > JD Evora > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > From jdevora at saadian.com Wed Jun 16 04:36:04 2004 From: jdevora at saadian.com (JD Evora) Date: Wed, 16 Jun 2004 11:36:04 +0100 Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40CF1C27.7030400@nentec.de> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> Message-ID: <40D02294.5000200@saadian.com> Hi, Thank you for your reply. I used the version 2.0.x because the library uses the Sun CommAPI on windows, but looks like it detects when it is running on Linux and uses gnu.io.* instead. I installed 2.1.x and it worked perfectly. Cheers JD Fabien Renaud wrote: > Hi, > > If you type jar -tf RXTXcomm.jar you should have a line like this : > gnu/io/CommPort.class > Oh I didn?t see it. You use 2.0.x version. > You should use 2.1.x version. With this one you don?t need CommAPI > from SUN and you put your classes in gnu/io/ whereas it?s different > with 2.0.x. > > Humm I hope you?ll understand what I wanted to say ^^ > So use 2.1-7pre17 and everything will be ok. > > Fabien > > > > JD Evora wrote: > >> Hi, >> >> I download rxtx-2.0-7pre1 and did a make install it seams to >> install OK >> >> I am trying to use them with a program that relays on Sun's comm API >> and when I run it I get >> >> java.lang.NoClassDefFoundError: gnu/io/CommPort >> >> From the INSTALL document I saw that it happens when RXTXcomm.jar is >> not in the class path, but it is. (and in the >> jre/lib/ext/RXTXcomm.jar as well) >> >> I opened the jar file and I didn't see the CommPort class there are >> LPRPort*.class and RXTXPort*.class files but not just a >> CommPort.class one >> >> Did I miss a configuration step somewhere? >> >> Thank you very much >> JD Evora >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at linuxgrrls.org >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From t.neumann at stream-line.de Wed Jun 16 06:02:43 2004 From: t.neumann at stream-line.de (t.neumann@stream-line.de) Date: 16 Jun 2004 12:02:43 UT Subject: [Rxtx] Problems with pseudo terminals on Linux Message-ID: <00014483.40D052EA@62.153.101.193> Hello, I'm a newbie to programming serial ports and to RXTX in special. I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. I've tracked my error down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. Can anybody help me? Thanks in advance Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20040616/d35ea6e9/attachment-0018.html From alexandre.ricciardi at free.fr Wed Jun 16 09:30:40 2004 From: alexandre.ricciardi at free.fr (alexandre ricciardi) Date: Wed, 16 Jun 2004 17:30:40 +0200 Subject: [Rxtx] RXTX does not work Message-ID: <40D067A0.8020503@free.fr> Hi, I'm new to this mailing list and to rxtx I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not work ! I have messages as : root at 0[BlackBox]# java -cp BlackBox.jar BlackBox Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar JavaKit Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPort I tried to put comm.jar in the classpath and i get this root at 0[BlackBox]# java -cp BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver No serial ports found! I don't get what's wrong in my installation Thanks for reply Alexandre From renaud at nentec.de Wed Jun 16 09:38:38 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 16 Jun 2004 17:38:38 +0200 Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: <40D0697E.4030208@nentec.de> alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does > not work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit Exception in thread "main" > java.lang.NoClassDefFoundError: javax/comm/CommPort > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > > Alexandre > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > Use version 1.1.x and replace javax/comm by gnu/io in your java programs From Bob_Jacobsen at lbl.gov Wed Jun 16 10:14:50 2004 From: Bob_Jacobsen at lbl.gov (Bob Jacobsen) Date: Wed, 16 Jun 2004 09:14:50 -0700 Subject: [Rxtx] Events on MacOS X? In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: Can somebody please confirm whether RXTX on MacOS X should be notifying about SerialPortEvents from the serial port? I'm particularly interested in whether the program gets told about "OUTPUT_BUFFER_EMPTY" and "CTS". The longer story is that the JMRI project (http://jmri.sf.net) uses RXTX to attach to various model railroad electronics. There's one system, called the Lenz LI101, that requires spacing between messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, which works elsewhere but _not_ on MacOS X. The current indication is that events just aren't being triggered. But we don't know where they're being lost: In MacOS X itself? In the USB adapters or their drivers? In RXTX? Any pointers would be greatly appreciated. Bob -- -------------- Bob_Jacobsen at lbl.gov, +1-510-486-7355, fax +1-510-643-8497, AIM JacobsenRG From taj at www.linux.org.uk Wed Jun 23 02:49:47 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 09:49:47 +0100 (BST) Subject: [Rxtx] Error-Logs In-Reply-To: References: Message-ID: On Tue, 15 Jun 2004, Moritz Gmelin wrote: > Hi, > > can anybody tell me why RXTX is crashing at that point ? I'm not > calling setEndOfInputChar anywhere ! > > M. > > If you are compiling rxtx for win32, make sure you are generating the symbols from the object files rather than reusing the old Serial.def file. I'm not sure thats shy the jvm is reporting the odd function there but it could be. With rxtx and jre 1.4, we tested the initial 1.4 releases and it worked but there are some problems with more recent versions that need attention. The majority of the testing was done with jre 1.3. I suspect if you try jre 1.3 or an early 1.4 the problem will go away. Verifying current 1.4 JREs is on the top of the todo list here. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:00:21 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:00:21 +0100 (BST) Subject: [Rxtx] Events on MacOS X? In-Reply-To: References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, Bob Jacobsen wrote: > Can somebody please confirm whether RXTX on MacOS X should be > notifying about SerialPortEvents from the serial port? I'm > particularly interested in whether the program gets told about > "OUTPUT_BUFFER_EMPTY" and "CTS". > > The longer story is that the JMRI project (http://jmri.sf.net) uses > RXTX to attach to various model railroad electronics. There's one > system, called the Lenz LI101, that requires spacing between > messages. We do this using the CTS and OUTPUT_BUFFER_EMPTY events, > which works elsewhere but _not_ on MacOS X. The current indication > is that events just aren't being triggered. But we don't know where > they're being lost: In MacOS X itself? In the USB adapters or their > drivers? In RXTX? > > Any pointers would be greatly appreciated. > Hi Bob RXTX was first written for Linux. Linux has a nonstandard ioctl call 'TIOCSERGETLSR' which allows one to check if the output buffer is empty. This is done via the event loop. W32 also has capabilities to probe the LSR and find out if the output buffer is empty so a TIOCSERGETLSR ioctl was implemented there too. Then came Solaris. A more traditional SysV system. You cant touch the LSR on solaris but you can call tcdrain(). When tcdrain() completes, the output buffer is empty. So a thread is spawned and it just calls tcdrain() after write() is called. when tcdrain() completes, it makes sure the event is sent. I'm not sure how Mac OS X does this. If TIOCSERGETLSR is not there (probably) then its going to use the code in #ifndef TIOCSERGETLSR I suspect that I put some ifdef __sun__ in there while doing the Solaris port. This is very hard to figure out without a machine to see whats going on. The code is all in SerialImp.c. Look at the following functions: init_threads (struct event_info_struct *eis) //spawns the drain loop if //needed drain_loop (void *arg) //loop that calls tcdrain //and sets event flag writeByte/writeArray //sets the 'writing' flag //so drain_loop triggers check_line_status_register (struct event_info_struct *eis) // #else sends event on // event flag. So except for linux and w32, rxtx isnt doing great things for you. In fact, you can call flush() after write and know the output buffer is empty. Thats essentially what the native code is doing. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:16:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:16:43 +0100 (BST) Subject: [Rxtx] RXTX does not work In-Reply-To: <40D067A0.8020503@free.fr> References: <40D067A0.8020503@free.fr> Message-ID: On Wed, 16 Jun 2004, alexandre ricciardi wrote: > Hi, > > I'm new to this mailing list and to rxtx > > I have folowed the HOWTO install RXTX and sun's COMMAPI but it does not > work ! > I have messages as : > > root at 0[BlackBox]# java -cp BlackBox.jar BlackBox > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/PortInUseException > root at 0[BlackBox]# java -cp /home/alex/Desktop/tini1.12/bin/tini.jar > JavaKit > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/comm/CommPort > > > I tried to put comm.jar in the classpath and i get this > > root at 0[BlackBox]# java -cp > BlackBox.jar:/home/alex/Desktop/commapi/comm.jar BlackBox > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while > loading driver com.sun.comm.SolarisDriver > No serial ports found! > > I don't get what's wrong in my installation > > Thanks for reply > Hi Alexandre, This usually means that the javax.comm.properties file is not installed properly. It is possible Sun no longer supports the file, double check the documentation in their package. It used to mention how to install the javax.comm.properties file. You could use strace and grep just to confirm it is looking for the file. The "Error loading SolarisSerial" means you do have the proper package. The javax.comm.properties will force rxtxSerial to be loaded instead. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:18:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:18:00 +0100 (BST) Subject: [Rxtx] Re: Reading from pseudo terminals using RXTX (fwd) Message-ID: I see this was asked on the mail list too so I'll forward my reply. (cleaning out the inbox after vacation) -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Wed, 23 Jun 2004 10:25:19 +0100 (BST) From: Trent Jarvi To: t.neumann at stream-line.de Subject: Re: Reading from pseudo terminals using RXTX On Thu, 17 Jun 2004 t.neumann at stream-line.de wrote: > Hello Trent, > > I'm a newbie to programming serial ports and to RXTX in special. > > I currently try to open the slave side of a pseudo terminal (/dev/ttys0) on debian linux using RXTX 2.1.6 and the BlackBox application. And it won't work. I only see my standard serial ports in the BlackBox application. I've tracked my problem down to the function testRead() in SerialImp.h. The OPEN call fails with errno 5 (input/output error). > > As far as I know it should be possible to open the slave side of a pseudo terminal as a regular serial port. The permissions of the slave device look also correct to me. Everybody is allowed to read or write to the device file and it belongs to root and the tty groupe. > > Can you please confirm to me if I'm right with my approach of accessing a pseudo terminal using RXTX. Or am I wrong and its not possible for any reason I currently do not know. > > Thanks in advance > > Thomas > rxtx does not check /dev/ttys* I've not really looked into using pseudo terminals but if you wish to try, you will have to add "ttys" to the list of ports rxtx enumerates in RXTXCommDriver.java. Just search for ttyS and add it to the list. rxtx will work out the 0-256 and /dev/ portion. just add "ttys" I'd be interested in hearing how things go. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:30:44 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:30:44 +0100 (BST) Subject: [Rxtx] gnu/io/CommPort : Class not found In-Reply-To: <40D02294.5000200@saadian.com> References: <40CF19D0.3090900@saadian.com> <40CF1C27.7030400@nentec.de> <40D02294.5000200@saadian.com> Message-ID: On Wed, 16 Jun 2004, JD Evora wrote: > Hi, > > Thank you for your reply. > I used the version 2.0.x because the library uses the Sun CommAPI on > windows, but looks like it detects when it is running on Linux and uses > gnu.io.* instead. > I installed 2.1.x and it worked perfectly. > > Cheers > JD > It should be possible to use rxtx 2.0 with Sun's commapi. I'm a little confused because the errors look like a mix of rxtx 2.0 and 2.1. I suspect you tried to use rxtx 2.1 with Sun's commapi. That wont work. > Fabien Renaud wrote: > > > Hi, > > > > If you type jar -tf RXTXcomm.jar you should have a line like this : > > gnu/io/CommPort.class > > Oh I didn?t see it. You use 2.0.x version. > > You should use 2.1.x version. With this one you don?t need CommAPI > > from SUN and you put your classes in gnu/io/ whereas it?s different > > with 2.0.x. > > > > Humm I hope you?ll understand what I wanted to say ^^ > > So use 2.1-7pre17 and everything will be ok. > > > > Fabien > > > > > > > > JD Evora wrote: > > > >> Hi, > >> > >> I download rxtx-2.0-7pre1 and did a make install it seams to > >> install OK > >> > >> I am trying to use them with a program that relays on Sun's comm API > >> and when I run it I get > >> > >> java.lang.NoClassDefFoundError: gnu/io/CommPort > >> > >> From the INSTALL document I saw that it happens when RXTXcomm.jar is > >> not in the class path, but it is. (and in the > >> jre/lib/ext/RXTXcomm.jar as well) > >> > >> I opened the jar file and I didn't see the CommPort class there are > >> LPRPort*.class and RXTXPort*.class files but not just a > >> CommPort.class one > >> > >> Did I miss a configuration step somewhere? > >> > >> Thank you very much > >> JD Evora > >> > >> > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at linuxgrrls.org > >> http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > >> > >> > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Jun 23 04:43:39 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 23 Jun 2004 11:43:39 +0100 (BST) Subject: [Rxtx] Unexpected Signal : 11 occurred at PC=0x8062b35 (solutiuon?) In-Reply-To: <1087294076.7548.55.camel@academia.thybaria.local> References: 20040430061841.23AF17327D@mail.linuxgrrls.org <1087294076.7548.55.camel@academia.thybaria.local> Message-ID: On Tue, 15 Jun 2004, Bernd Pachur wrote: > Hi! > > I had similar Problems with the CVS-Version from yesterday and with the > latest release version. > > I am running gentoo too (for insiders: ~x86)! > > uname -a: > > Linux academia 2.6.5-gentoo-r1 #6 Mon May 31 18:04:44 CEST 2004 i686 > Celeron (Mendocino) GenuineIntel GNU/Linux > > java -version: > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > I do not add the error output, because it is similar to the one of Rico. > The error also occurs, when you call getReceiveTimeout(). > > It seems that I managed to solve the problem. > > I compiled my rxtx version with debugging on and tried to find the > error. > > To pin down the lines in the native code that caused the problem, I > tried to add "report(message)" lines to "NativeisReceiveTimeoutEnabled" > and "NativegetReceiveTimeout" in "SerialImpl.c" . > > When I added the lines at the following location in both methods: > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > char message[80]; > > sprintf(message,"ReceiveTimeout: trace"); > report(message); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > The problem suddenly disappeared. > > This combined with the fact that all problems occured on systems that > use nptl threads suggested to me, that the problem is some kind of > timing problem, when doing "tcgetattr". I then changed my addition to > the code from adding "report(messsage)" lines to adding a "usleep" line: > > > > { > int fd = get_java_var (env, jobj, "fd", "I"); > struct termios ttyset; > > usleep(1000); > > ENTER ("RXTXPort:NativeisRecieveTimeoutEnabled()"); > if (tcgetattr (fd, &ttyset) < 0) > goto fail; > > > > And guess what, the error is gone! > I don't know if this is a feasible solution on all systems, because I > normally do not code in C but in JAVA and only remeber some basics from > my C course, but at least for me it works. > It should probably be tested on other systems too before permanently > adding it to the code. > > Cheers, > > Bernd Pachur Hi Bernd hehe... I did basically the same thing on 3 OS's for jre 1.3. I was sure that if I turned my ximian monkey on top of my monitor the right direction before running tests it helped. The basic problem as we understand it now is rxtx is keeping pointers to objects inside the jvm between multiple native threads. This was done to deal with bob's issue before (output buffer empty events on non w32/linux systems). Turns out thats a big no no. So it was no big suprise that as the jvm changed, the problem came back. I guess this is documented in Sun's JNI book. Its showing up in some other web links now too. Getting rid of the pointers in the event_info_struct is the first priority before the next release. > > > Hello folks, > > > > I think I have the same problem Willem Riede reported on March 21, > 2004. I get > > the following: > > > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.0-7pre1 > > Java lib Version = RXTX-2.0-7pre1 > > RXTX Warning: Removing stale lock file. /var/lock/LCK..0 > > Port: /dev/usb/tts/0 - Serial > > Unexpected Signal : 11 occurred at PC=0x8062b35 > > Function name=(N/A) > > Library=(N/A) > > > > NOTE: We are unable to locate the function name symbol for the error > > just occurred. Please refer to release documentation for > possible > > reason and solutions. > > > > Current Java thread: > > at gnu.io.RXTXPort.NativeisReceiveTimeoutEnabled(Native > Method) > > at gnu.io.RXTXPort.isReceiveTimeoutEnabled(RXTXPort.java:411) > > at Ctest.main(Ctest.java:14) > > > > > > whenever my program invokes isReceiveTimeoutEnabled(). The other > isXXX() methods > > seem to work fine. I was initially running this on: > > > > Gentoo Linux 2004.0 > > Linux kernel 2.6.5 (gentoo-dev-sources) > > Sun JDK 1.4.2.04 > > > > After I found Trent Jarvi's recommendation to run a 1.3.1 series JDK, > > I tried with > > > > Sun JDK 1.3.1.09 > > > > Same behavior. Does anyone have any other suggestions? > > > > Rico Juinio > > > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Jun 24 20:43:00 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 03:43:00 +0100 (BST) Subject: [Rxtx] Re: [Fwd: Linux install problem for RXTX] In-Reply-To: <40DB8AC8.9070607@Sun.COM> References: <40DB8AC8.9070607@Sun.COM> Message-ID: On Thu, 24 Jun 2004, Bhaskar Bhumkar wrote: > -------- Original Message -------- > Subject: Linux install problem for RXTX > Date: Thu, 24 Jun 2004 19:11:46 -0700 > From: Bhaskar Bhumkar > Reply-To: Bhaskar.Bhumkar at Sun.COM > To: rxtx-bounces at linuxgrrls.org > > HI, > > I am trying to install rxtx package for Comm support on Linx but getting > strange errors. I have set the classpath properly to point to jcl.jar > (for 1.4) or rxtx.jar(for 2.0) I also have the correct version of > javax.comm.properties that contains only the following line: > > Driver=gnu.io.RXTXCommDriver > > However, I am having problems with ver1.4 as well as ver2.0 of rxtx as > follows: > > > (1) Initally I tried to use the latest version(2.0) of shared library, > but it gave me following errors: > > //////////////// > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: No > SolarisSerialParallel in java.library.path > ........ > ........ > ///////// This could only be a problem with the javax.comm.properties file. Sun's commapi did not even try to load rxtx as suggested by the attempt to load Sun's native library. > > > (2) Afterwards, I referred to the mailing list and somebody had > mentioned that the rxtx1.4 is a correct version to use for commapi. > However, when I tried to use the binary version > (../rxtx-bins.1/1.4/i386-pc-linux/libSerial.so), it gave me following > errors: > > ///////////////// > [bb145443 at qt-pc lib]$ java BlackBox > Warning: Cannot convert string "MetaCtrlInsert" to type VirtualBinding > 54 1075299340 I dont think this message is important. > > > > RXTX WARNING: This library requires the user running applications to be in > group uucp. Please consult the INSTALL documentation. More information is > avaiable under the topic 'How can I use Lock Files with rxtx?' > check_lock_status: No permission to create lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > ///////////////// > > I changed the /etc/group file for "uucp" and added myself as a uucp > user, but still I am getting similar error. Some(?) Linux distributions have changed group uucp to group lock. You may check with ls -ld /var/lock/ > > (2) Since the binary version failed to start, I tried to do a build by > specifying "configure --disable-lockfiles". But the make fails with > following errors: > > ///////////////////// > [bb145443 at qt-pc rxtx-1.4-15]$ make > /usr/java/j2sdk1.4.1_01/bin/javac -classpath > .:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15:/home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/src:/usr/java/j2sdk1.4.1_01/jre/lib/ext/comm.jar > > -d /home/bb145443/serialPort/rxtx1.4/rxtx-1.4-15/ -O > ./src/Configure.java ./src/LPRPort.java ./src/RXTXCommDriver.java > ./src/RXTXPort.java ./src/RXTXVersion.java > Note: ./src/RXTXPort.java uses or overrides a deprecated API. > Note: Recompile with -deprecation for details. > /usr/java/j2sdk1.4.1_01/bin/jar cf jcl.jar gnu/* > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > libtool: ltconfig version `' does not match ltmain.sh version `1.3.5' > Fatal configuration error. See the libtool docs for more information. > make: *** [i686-pc-linux/libSerial.la] Error 1 > ///////////////////// > > So, effectively, I am not able to make it work! Could you help me in > specifying the correct version of rxtx that I can use along with Commapi? > > > I will appreciate your help on this. > > The problem here is that the auto* scripts are not matching the tools installed on your system. You can try running the autogen.sh script to update the files in rxtx. With the rxtx 1.4 and Sun's Java, It appears current rxtx does work fine with the 1.3 jre but there are problems on newer 1.4 version (older versions of the 1.4 jre did not show the problem when I went through more complete testing on the various OS's)s. Its rather timing specific as a post to the rxtx mail list recently pointed out. This is on the first of the todo list but we will have to run everything through the tests when that change happens - it will be a change on all OS's. Its going to take a while. Again, current rxtx with jdk 1.3 is known to be fairly good. I know some need the 1.4 jre though. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 03:51:10 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 11:51:10 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Hi all, I have a **serious** problem with occational VM-crashes!! The symptom includes the output - # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # This happens with some frequency - a couple of days, perhaps. We use RXTX to communicate with a GSM-modem at 9600 baud only - communication can hardly be any more basic than the setup, which we use. As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and upgraded RXTX the the latest "2.1-7pre17", but it does not make any difference. We have also tried using "-Xrs" on the VM, since we suspect, that the combination of the VM and RXTX has some sort of problem handling interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an impact upon the frequency with which the crash happens. But it does not solve the problem. It is not stable at all. If anyone can help, we would like to hear about it. Below are some more information reguarding version-numbers and the dump from the VM. Regards, Morten Sabroe Mortensen ----- > uname -a 2.4.21-215-smp4G > java -version java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) -------------------------------------------------------------------- Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 # # HotSpot Virtual Machine Error, Internal Error # Please report this error at # http://java.sun.com/cgi-bin/bugreport.cgi # # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) # # Error ID: 53414645504F494E540E4350500175 # # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable # Heap at VM Abort: Heap def new generation total 640K, used 507K [0x44860000, 0x44910000, 0x44d40000) eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, 0x48860000) the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, 0x454fe000) compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, 0x4c860000) the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, 0x49120000) -------------------------------------------------------------------- ----- From taj at www.linux.org.uk Fri Jun 25 05:18:27 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 12:18:27 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B44863E@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Hi all, > > I have a **serious** problem with occational VM-crashes!! > The symptom includes the output - > > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > > This happens with some frequency - a couple of days, perhaps. We use > RXTX to communicate with a GSM-modem at 9600 baud only - communication > can hardly be any more basic than the setup, which we use. > > As a last try, we upgraded the VM from a 1.4.1 to the latest 1.4.2 and > upgraded RXTX the the latest "2.1-7pre17", but it does not make any > difference. > > We have also tried using "-Xrs" on the VM, since we suspect, that the > combination of the VM and RXTX has some sort of problem handling > interrupts with C-signals.... guessing. Apparently, using "-Xrs" has an > impact upon the frequency with which the crash happens. But it does not > solve the problem. > > It is not stable at all. > > If anyone can help, we would like to hear about it. Below are some more > information reguarding version-numbers and the dump from the VM. > > Regards, > Morten Sabroe Mortensen > > ----- > > > uname -a > > 2.4.21-215-smp4G > > > java -version > > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) > > -------------------------------------------------------------------- > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > # > # HotSpot Virtual Machine Error, Internal Error > # Please report this error at > # http://java.sun.com/cgi-bin/bugreport.cgi > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_04-b05 mixed mode) > # > # Error ID: 53414645504F494E540E4350500175 > # > # Problematic Thread: prio=1 tid=0x4d716128 nid=0x79eb runnable > # > > Heap at VM Abort: > Heap > def new generation total 640K, used 507K [0x44860000, 0x44910000, > 0x44d40000) > eden space 576K, 87% used [0x44860000, 0x448deb68, 0x448f0000) > from space 64K, 1% used [0x448f0000, 0x448f03d0, 0x44900000) > to space 64K, 0% used [0x44900000, 0x44900000, 0x44910000) > tenured generation total 7928K, used 7829K [0x44d40000, 0x454fe000, > 0x48860000) > the space 7928K, 98% used [0x44d40000, 0x454e5658, 0x454e5800, > 0x454fe000) > compacting perm gen total 8960K, used 8802K [0x48860000, 0x49120000, > 0x4c860000) > the space 8960K, 98% used [0x48860000, 0x490f89a8, 0x490f8a00, > 0x49120000) > -------------------------------------------------------------------- > > ----- > two comments. 1) rxtx was only lightly tested on very early 1.4 releases. Most testing was done on 1.3. The problem you mention has shown up for others. There is a thread with a possible fix posted to the list: http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. So right now, you can drop to a 1.3 vm, or try the fix mentioned. -- Trent Jarvi taj at www.linux.org.uk From morten.mortensen at tietoenator.com Fri Jun 25 05:58:15 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 13:58:15 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Aha! -Sounds like something! For us, down-grading the VM to a 1.3.x is not an option. Must be a newer 1.4.2_XX. Which impact does inserting "usleep(1000)" have? -I mean - how often are the containing methods "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? Does the hack delay regular use like connecting, actual communication and closing - or is it a timeout occuring only when there is no communication on the serial-line for some period of time? It would be real nice to know a bit about this. Can you tell me a bit about it? Regards, Morten Sabroe Mortensen > two comments. > > 1) rxtx was only lightly tested on very early 1.4 releases. Most testing > was done on 1.3. The problem you mention has shown up for others. There > is a thread with a possible fix posted to the list: > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From morten.mortensen at tietoenator.com Fri Jun 25 06:13:22 2004 From: morten.mortensen at tietoenator.com (Morten S. Mortensen) Date: Fri, 25 Jun 2004 14:13:22 +0200 Subject: [Rxtx] VM-crash on Linux Message-ID: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both talk "Linux" now - or what? You mean, that since Windows-machines have problems with SMP, then Linux-kernels might happen to have the same kind of problems?? > two comments. > > 2) You are using an smp kernel. I've had a report of smp machines having problems on w32. No more details yet but I thought I would mention there is a possible issue there. Swapping out the kernel on a uniprocessor machine would probably make no difference. > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > -- > Trent Jarvi > taj at www.linux.org.uk _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx From taj at www.linux.org.uk Fri Jun 25 06:15:35 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:15:35 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448641@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > Aha! -Sounds like something! > > For us, down-grading the VM to a 1.3.x is not an option. Must be a newer > 1.4.2_XX. > > Which impact does inserting "usleep(1000)" have? -I mean - how often are > the containing methods > "NativeisReceiveTimeoutEnabled"/"NativegetReceiveTimeout" activated? > Does the hack delay regular use like connecting, actual communication > and closing - or is it a timeout occuring only when there is no > communication on the serial-line for some period of time? > > It would be real nice to know a bit about this. Can you tell me a bit > about it? > The followup has what I (we?) think is going on http://marc.theaimsgroup.com/?l=rxtx&m=108798744401772&w=2 This would explain why some have luck with rxtx 1.4 which was before the Solaris fixes went into rxtx. -- another option you could try but search the archives when (not if) you run into runtime/compile errors there. > > > > two comments. > > > > 1) rxtx was only lightly tested on very early 1.4 releases. Most > testing > > was done on 1.3. The problem you mention has shown up for others. > There > > is a thread with a possible fix posted to the list: > > > > http://marc.theaimsgroup.com/?l=rxtx&m=108729411003443&w=2 > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Jun 25 06:20:31 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 25 Jun 2004 13:20:31 +0100 (BST) Subject: [Rxtx] VM-crash on Linux In-Reply-To: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> References: <2CC763883B72EB43BF36B484F01B304B448642@balder.tefs.corpdk.inside> Message-ID: On Fri, 25 Jun 2004, Morten S. Mortensen wrote: > > > ...Ehh, what do you mean with "w32"? Can hardly be Win32, since we both > talk "Linux" now - or what? > You mean, that since Windows-machines have problems with SMP, then > Linux-kernels might happen to have the same kind of problems?? There may be a problem with smp machines. Its not well characterized. There was also a linux report some time ago that may be related. Again, I'm just mentioning it because that appeared to be the only thing different when I couldnt reproduce the problem. > > > > two comments. > > > > 2) You are using an smp kernel. I've had a report of smp machines > having problems on w32. No more details yet but I thought I would > mention there is a possible issue there. Swapping out the kernel on a > uniprocessor machine would probably make no difference. > > > > So right now, you can drop to a 1.3 vm, or try the fix mentioned. > > > > -- > > Trent Jarvi > > taj at www.linux.org.uk _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org:8080/mailman/listinfo/rxtx > -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:00:37 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:00:37 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: <40B604DC.3030908@nentec.de> References: <40B604DC.3030908@nentec.de> Message-ID: <40BDB355.30304@nentec.de> Hello, I can communicate via my serial interfaces using minicom but when I want to use rxtx I have some problems : The program stops here : public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // if (portId.getName().equals("COM1")) { if (portId.getName().equals("/dev/ttyS3")) { System.out.println("test 1"); try { serialPort = (SerialPort) portId.open("SimpleWriteApp", 2000); } catch (PortInUseException e) {} ### After this nothing is executed What are the values SimpleWriteApp and 2000 ?? Fabien From taj at www.linux.org.uk Wed Jun 2 05:24:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 12:24:43 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDB355.30304@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Hello, > > I can communicate via my serial interfaces using minicom but when I want > to use rxtx I have some problems : > > The program stops here : > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > // if (portId.getName().equals("COM1")) { > if (portId.getName().equals("/dev/ttyS3")) { > System.out.println("test 1"); > try { > serialPort = (SerialPort) > portId.open("SimpleWriteApp", 2000); > } catch (PortInUseException e) {} > ### After this nothing is executed > > What are the values SimpleWriteApp and 2000 ?? > Application name and timeout in milliseconds. Are you sure the 'test 1' printed out? I wouldnt worry about the parameters. Something else is wrong. /*------------------------------------------------------------------------------ open() accept: application makeing the call and milliseconds to block during open. perform: open the port if possible return: CommPort if successfull exceptions: PortInUseException if in use. comments: ------------------------------------------------------------------------------*/ private boolean HideOwnerEvents; public synchronized CommPort open(String TheOwner, int i) throws gnu.io.PortInUseException ... You probably want to print out the exception rather than silently ignoring it. For some reason the port is not opening. Make sure you have the user in group lock (some older distros use uucp). Try the application as root to see if it is a lock/permission problem. You should also have something in /var/log/messages showing /dev/ttyS3 was picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following shows that from when the machine booted: Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a custom card/setup, that may not be true - check the log above.. -- Trent Jarvi taj at www.linux.org.uk From renaud at nentec.de Wed Jun 2 05:47:18 2004 From: renaud at nentec.de (Fabien Renaud) Date: Wed, 02 Jun 2004 13:47:18 +0200 Subject: [Rxtx] SimpleWriter In-Reply-To: References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> Message-ID: <40BDBE46.4030105@nentec.de> Trent Jarvi wrote: >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > >>Hello, >> >>I can communicate via my serial interfaces using minicom but when I want >>to use rxtx I have some problems : >> >>The program stops here : >>public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> // if (portId.getName().equals("COM1")) { >> if (portId.getName().equals("/dev/ttyS3")) { >> System.out.println("test 1"); >> try { >> serialPort = (SerialPort) >>portId.open("SimpleWriteApp", 2000); >> } catch (PortInUseException e) {} >>### After this nothing is executed >> >>What are the values SimpleWriteApp and 2000 ?? >> >> >> > >Application name and timeout in milliseconds. Are you sure the 'test 1' >printed out? I wouldnt worry about the parameters. Something else is >wrong. > > Yes ?test 1? is printed out. >/*------------------------------------------------------------------------------ > open() > accept: application makeing the call and milliseconds to block > during open. > perform: open the port if possible > return: CommPort if successfull > exceptions: PortInUseException if in use. > comments: >------------------------------------------------------------------------------*/ > private boolean HideOwnerEvents; > > public synchronized CommPort open(String TheOwner, int i) > throws gnu.io.PortInUseException >... > >You probably want to print out the exception rather than silently ignoring >it. For some reason the port is not opening. > >Make sure you have the user in group lock (some older distros use uucp). >Try the application as root to see if it is a lock/permission problem. > I only have root user on this machine. > >You should also have something in /var/log/messages showing /dev/ttyS3 was >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following >shows that from when the machine booted: > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ >8 ports, IRQ sharing enabled >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a >custom card/setup, that may not be true - check the log above.. > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 Fabien From taj at www.linux.org.uk Wed Jun 2 06:12:14 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Jun 2004 13:12:14 +0100 (BST) Subject: [Rxtx] SimpleWriter In-Reply-To: <40BDBE46.4030105@nentec.de> References: <40B604DC.3030908@nentec.de> <40BDB355.30304@nentec.de> <40BDBE46.4030105@nentec.de> Message-ID: On Wed, 2 Jun 2004, Fabien Renaud wrote: > Trent Jarvi wrote: > > >On Wed, 2 Jun 2004, Fabien Renaud wrote: > > > > > > > >>Hello, > >> > >>I can communicate via my serial interfaces using minicom but when I want > >>to use rxtx I have some problems : > >> > >>The program stops here : > >>public static void main(String[] args) { > >> portList = CommPortIdentifier.getPortIdentifiers(); > >> > >> while (portList.hasMoreElements()) { > >> portId = (CommPortIdentifier) portList.nextElement(); > >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > >> // if (portId.getName().equals("COM1")) { > >> if (portId.getName().equals("/dev/ttyS3")) { > >> System.out.println("test 1"); > >> try { > >> serialPort = (SerialPort) > >>portId.open("SimpleWriteApp", 2000); > >> } catch (PortInUseException e) {} > >>### After this nothing is executed > >> > >>What are the values SimpleWriteApp and 2000 ?? > >> > >> > >> > > > >Application name and timeout in milliseconds. Are you sure the 'test 1' > >printed out? I wouldnt worry about the parameters. Something else is > >wrong. > > > > > Yes ?test 1? is printed out. > > >/*------------------------------------------------------------------------------ > > open() > > accept: application makeing the call and milliseconds to block > > during open. > > perform: open the port if possible > > return: CommPort if successfull > > exceptions: PortInUseException if in use. > > comments: > >------------------------------------------------------------------------------*/ > > private boolean HideOwnerEvents; > > > > public synchronized CommPort open(String TheOwner, int i) > > throws gnu.io.PortInUseException > >... > > > >You probably want to print out the exception rather than silently ignoring > >it. For some reason the port is not opening. > > > >Make sure you have the user in group lock (some older distros use uucp). > >Try the application as root to see if it is a lock/permission problem. > > > I only have root user on this machine. > > > > >You should also have something in /var/log/messages showing /dev/ttyS3 was > >picked up by the driver. I dont have ttyS3 (just 0 & 1) but the following > >shows that from when the machine booted: > > > >Mar 2 09:28:00 (none) kernel: Serial: 8250/16550 driver $Revision: 1.90 $ > >8 ports, IRQ sharing enabled > >Mar 2 09:28:00 (none) kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A > >Mar 2 09:28:00 (none) kernel: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A > > > >You probably know that /dev/ttyS3 is COM4 in DOS/w32. Though if this is a > >custom card/setup, that may not be true - check the log above.. > > > > > The log indicates me /dev/ttyS03 but with minicom all works with /dev/ttyS3 > > > > We would need more output before helping more. Exceptions (you are just catching them now) would help. If your test message did print out, then rxtx has already opened and closed the port once to test if its valid during enumeration. Maybe you need to look further on in your code. Also, dont run minicom and the java application at the same time, they will conflict over the port. Also make sure you dont have other applications (including another instance of your SimpleWriter) sitting around with the port open. My guess is it opened the port fine and you are looking for something else. "test 1" would not be printing out if ttyS3 could not be opened unless you have somehow deliberatly made a change to how rxtx enumerates ports (open, timed out read, close, next port..) -- Trent Jarvi taj at www.linux.org.uk From jls at sco.com Wed Jun 2 07:09:00 2004 From: jls at sco.com (Jonathan Schilling) Date: Wed, 2 Jun 2004 09:09 EDT Subject: [Rxtx] SimpleWriter Message-ID: <200406021311.i52DBCZ22762@nimbus.nj.caldera.com> Don't know if it's still in Sun's current version, but at one time SimpleWrite.java failed to close the port, and I hit various problems due to that. The close needs to be here: *** 65,70 **** --- 69,75 ---- try { outputStream.write(messageString.getBytes()); } catch