Hi,

I'm having some real grief with "java.io.IOException: Bad file descriptor"
messages.  I'm getting these not only on data file I'm reading (cached web
docs in this case), but also on class files, which causes the
NoClassDefFoundErrors of my previous few posts.  I've tried stracing it,
and here's a little excerpt.  I'm very very far from a kernel and/or c
hacker, so it's entirely possible I've missed something important.  I just
ran my app until one of these happened (didn't take long), did a
System.out.println about it, and matched up the URL that was printed with
the socket calls made (ie, if the URL is /bob and there is a write(18,
"GET /bob ...") call then 18 is naughty one.  I then looked back in the
strace for 18 :)  Isn't grep great?

There don't seem to be any system calls gone wrong... weird.

Sorry if this isn't very useful...  I really want to get this fixed, since
I basically can't do any work until I can run my app.  I can try to
provide more info if required.

Thanks,
dstn.

Here's the excerpt:

# Make naughty socket number 18...
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 18
setsockopt(18, SOL_SOCKET, SO_REUSEADDR, [-1], 4) = 0
#snip
fcntl(18, F_GETFL)                      = 0x2 (flags O_RDWR)
fcntl(18, F_SETFL, O_RDWR|O_NONBLOCK|FASYNC) = 0
getpid()                                = 3177
fcntl(18, F_SETOWN, 3177)               = 0
sigprocmask(SIG_BLOCK, [IO], [])        = 0
sigprocmask(SIG_SETMASK, [], NULL)      = 0

# connect to the SOCKS proxy server...
connect(18, {sin_family=AF_INET, sin_port=htons(1080),
        sin_addr=inet_addr("9.1.40.50")},
        16) = -1 EINPROGRESS (Operation now in progress)
select(19, [], [18], [], {0, 0})        = 0 (Timeout)

#snip

select(19, [], [18], [], {0, 0})        = 1 (out [18], left {0, 0})
connect(18, {sin_family=AF_INET, sin_port=htons(1080),
        sin_addr=inet_addr("9.1.40.50")}, 16) = 0
getsockname(18, {sin_family=AF_INET, sin_port=htons(2186),
        sin_addr=inet_addr("9.1.23.6")}, [16]) = 0

#snip

# make the SOCKS request...
send(18, "\4\1\0P\234b#\317dustinl\0", 16, 0) = 16
#snip
read(18, 0x418e8fd4, 8)                 = -1 EAGAIN (Try again)
#snip
select(19, [18], [], [], {0, 50000})    = 0 (Timeout)
#snip
select(19, [18], [], [], {0, 50000})    = 1 (in [18], left {0, 50000})
#snip
select(19, [18], [], [], {0, 50000})    = 1 (in [18], left {0, 50000})
#snip

# read the SOCKS response...
read(18, "\0Z\0\0\0\0\0\0", 8)          = 8

#snip
setsockopt(18, IPPROTO_TCP1, [1], 4)    = 0
#snip

# Make the HTTP request (a page about tree frogs)
send(18, "GET /fish_and_wildlife/frogs/tre"..., 165, 0) = 165

#snip
read(18, 0x418e9140, 2048)              = -1 EAGAIN (Try again)
#snip
select(19, [18], [], [], {0, 50000})    = 1 (in [18], left {0, 50000})
#snip
select(19, [18], [], [], {0, 50000})    = 1 (in [18], left {0, 50000})
#snip

# Read the HTTP response (500 bytes total)
read(18, "HTTP/1.1 200 OK\r\nDate: Fri, 23"..., 2048) = 500
brk(0x89eb000)                          = 0x89eb000
brk(0x89ef000)                          = 0x89ef000
brk(0x89f3000)                          = 0x89f3000
brk(0x89f7000)                          = 0x89f7000
ioctl(18, FIONREAD, [0])                = 0
ioctl(18, FIONREAD, [0])                = 0

# Exception is thrown here.

# System.out.println the exception
write(1, "Cache: Uh oh: java.io.IOException: Bad file descriptor") = 54





----------------------------------------------------
--     Dustin Lang, [EMAIL PROTECTED]    --
(java developer, linux guy, freak with rainbow hair)

User, n.: a particularly  slow and unreliable input/
output  device  that  is  attached by default to the
standard input and output streams.
     (stolen from a Gamelan article, author unknown)
----------------------------------------------------


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to