I am using an ATEN RS-232C converter and I've got it enumerated with Kernel 2.4.20.
I am a long time RS-232 programmer who is investigating USB alternatives by using a 
converter to get my feet wet, so to speak.  I am using my own C library called from 
Java, which works quite nicely on /dev/ttySx devices, but isn't quite so happy on 
/dev/usb/ttyUSB0.

My code opens ttyUSB0 and reads from/writes to it just fine, however when it closes I 
get a segmentation fault.  I've attached my console output from my test program below: 
sends are non-echoed transmissions, calls are echoed transmissions.  I am very happy 
with opening & reading/writing.  

Immediately after the step "send: GOODBYE" my C library issues close(stream); to the 
open USB/RS232 serial stream.  This causes the segmentation fault, but only when using 
ttyUSB.  DMESG output is provided below my output.  I've tested this with minicom and 
it works just fine there opening, reading/writing, and closing.  Is there something 
special about closing a USB serial port?

- James


MY OUTPUT:
opening hd02 communicatorStream /dev/usb/ttyUSB0
set comm parameters
HD02 (@34e838d9): MeterCommunicator opened. (10)                                
send: HELLO
call: PR_STAT @ >H
echo: PR_STAT @ >H
reply: 0x20 0xff 0xff 0x20 0xd 0xa
unread bytes: 0
(0xffffffffffffffff)
send: GOODBYE
closing hd02 communicatorStream
./runmc: line 4:   869 Segmentation fault      LD_LIBRARY_PATH=./ java 
TestMeterCommunicator


DMESG Output:
usb.c: registered new driver serial
usbserial.c: USB Serial support registered for Generic
usbserial.c: USB Serial Driver core v1.4
usbserial.c: USB Serial support registered for PL-2303
usbserial.c: PL-2303 converter detected
usbserial.c: PL-2303 converter now attached to ttyUSB0 (or usb/tts/0 for devfs)
usb.c: serial driver claimed interface c1217e00
pl2303.c: Prolific PL2303 USB to serial adaptor driver v0.9

Unable to handle kernel NULL pointer dereference at virtual address 00000014
 printing eip:
c01c2665
*pde = 00000000
Oops: 0000
CPU:    0
EIP:    0010:[<c01c2665>]    Not tainted
EFLAGS: 00010006
eax: c407d600   ebx: ffffff8d   ecx: c655d400   edx: 00000000
esi: cb8752c0   edi: 00000000   ebp: 00000246   esp: c6231e64
ds: 0018   es: 0018   ss: 0018
Process java (pid: 869, stackpage=c6231000)
Stack: ffffff8d cb8752c0 00000000 00000282 c01c3e18 cb8752c0 cb8752c8 cb8752c0
       00000286 c122a260 00000001 00000000 c407da00 c404d198 c01c3304 cb8752c0
       c655d400 ffffffff c655d41c c655d400 c404d198 c01b72ae cb8752c0 cc833f19
Call Trace:    [<c01c3e18>] [<c01c3304>] [<c01b72ae>] [<cc833f19>] [<cc82d4b4>]
  [<cc82d574>] [<c0162e10>] [<c0166941>] [<c016343e>] [<c012f624>] [<c012e675>]
  [<c012e6c3>] [<c0108677>]

Code: 8b 52 14 8b 42 e8 8b 7a ec 25 00 00 00 2f 0d 00 00 80 01 81


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to