Pete Bentley <pete@sorted.org> writes:
> I haven't read any squid code for *months*, so I probably have no
> business commenting...but what the heck. :)
>
> At 24 Oct 1997 17:01:57 +0800, "Michael O'Reilly" writes:
> >A few minor problems (I'm trying to compile the USE_ASYNC_IO stuff against
> >linuxthreads-0.6).
> >
> >Big one: aiops.h doesn't seem to exist??
> >
> >Can't seem to find this anywhere. Found a version in squid-1.1.1, but
> >the function prototypes et al don't match.
>
> aiops.h my be an IRIX-specific header [ .. ]
turns out not to be needed. Substitute "squid.h" and all is
well. Delete any other reference to aiops.h. *shrug*.
On Linux, with linuxthread-0.6 installed, I did
CFLAGS="-g -D_REENTRANT -DUSE_ASYNC_IO=1" \
LDFLAGS="-lpthread" \
./configure ...
I suspect it would probably be easier to have a configure option like
--threaded or something.
> >structs.h:858 defines a variable called 'errno'. The problem here is
> >that linuxthreads want to '#define' errno to be a thread specific
> >variable, and needless to say, it breaks badly.
>
> I don't have an ANSI standard to hand, but I have a sneaking feeling
> that making errno a macro rather than an int is changing "defined
> behaviour"... but I guess I shouldn't comment on that either till I
> have a standard to hand :)
No idea. Certainly changing the errno fixed it. :)
Other issues discovered so far:
Linuxthread uses SIGUSR1 and USR2 internally for signalling. Thus far,
I've just commented out the handlers in squid/src/main.c.
Now the really fun stuff. As soon as you run the ASYNC_IO squid, it
core dumps. Trace is..
(gdb) where
#0 0x400888ad in __kill ()
#1 0x4005a6b5 in raise (sig=-1)
#2 0x807fa80 in storeSwapOutHandle (fd=15, flag=0, len=350, data=0x81ec518) at store.c:911
#3 0x805b160 in diskHandleWriteComplete (data=0x0, len=350, errcode=0) at disk.c:345
#4 0x80506b0 in aioCheckCallbacks () at async_io.c:353
#5 0x8058cfd in comm_select (sec=0) at comm.c:999
#6 0x8071e62 in main (argc=1, argv=0xbffffdbc) at main.c:656
#7 0x804abbe in ___crt_dummy__ ()
which is the
assert(fd >= 0);
failing in file_close().
(gdb) up
#2 0x807fa80 in storeSwapOutHandle (fd=15, flag=0, len=350, data=0x81ec518) at store.c:911
911 file_close(mem->swapout.fd);
(gdb) print mem->swapout.fd
$1 = -1
(gdb) print *mem
$3 = {data = 0x81ec550, inmem_hi = 350, inmem_lo = 0, clients = 0x0,
nclients = 0, swapout = {queue_offset = 700, done_offset = 700, fd = -1},
reply = 0x81ed078, request = 0x0, start_ping = {tv_sec = 0, tv_usec = 0},
icp_reply_callback = 0, ircb_data = 0x0, fd = 0,
abort = {callback = 0, data = 0x0},
log_url = 0x8185188 "http://internal.squid/icons/anthony-dir.gif"}
which is ... umm... interesting. :)
The object supposedly being swapped out was only 350 bytes in length,
so I suspect it did an extra callback.
Any ideas???
Last few lines in cache.log for debug ALL, 10 were
97/10/24 17:36:09| storeEntryValidLength: hdr_sz = 213
97/10/24 17:36:09| storeEntryValidLength: content_length = 124
97/10/24 17:36:09| storeUnlockObject: key 'http://internal.squid/icons/anthony-link.gif' count=0
97/10/24 17:36:09| storeInMemAdd: http://internal.squid/icons/anthony-link.gif
97/10/24 17:36:09| 24577: 2 -> 1
97/10/24 17:36:09| 25620: 2 -> 1
97/10/24 17:36:09| 24577: 2 -> 1
97/10/24 17:36:09| 25620: 2 -> 1
97/10/24 17:36:09| comm_select: 19 sockets ready at 877685769
97/10/24 17:36:09| comm_select: FD 15 ready for writing
97/10/24 17:36:09| comm_select: FD 16 ready for writing
97/10/24 17:36:09| comm_select: FD 17 ready for writing
97/10/24 17:36:09| comm_select: FD 18 ready for writing
97/10/24 17:36:09| comm_select: FD 19 ready for writing
97/10/24 17:36:09| comm_select: FD 20 ready for writing
97/10/24 17:36:09| comm_select: FD 21 ready for writing
97/10/24 17:36:09| comm_select: FD 22 ready for writing
97/10/24 17:36:09| comm_select: FD 23 ready for writing
97/10/24 17:36:09| comm_select: FD 24 ready for writing
97/10/24 17:36:09| comm_select: FD 25 ready for writing
97/10/24 17:36:09| comm_select: FD 26 ready for writing
97/10/24 17:36:09| comm_select: FD 27 ready for writing
97/10/24 17:36:09| comm_select: FD 28 ready for writing
97/10/24 17:36:09| comm_select: FD 29 ready for writing
97/10/24 17:36:09| comm_select: FD 30 ready for writing
97/10/24 17:36:09| comm_select: FD 31 ready for writing
97/10/24 17:36:09| comm_select: FD 32 ready for writing
97/10/24 17:36:09| comm_select: FD 33 ready for writing
97/10/24 17:36:09| 24577: 2 -> 2
97/10/24 17:36:09| WRITE on fd: 12
97/10/24 17:36:09| DONE: 132 -> 0
97/10/24 17:36:09| commSetSelect: FD 12 type 2
97/10/24 17:36:09| 25620: 2 -> 2
97/10/24 17:36:09| WRITE on fd: 13
97/10/24 17:36:09| DONE: 115 -> 0
97/10/24 17:36:09| commSetSelect: FD 13 type 2
97/10/24 17:36:09| 26626: 2 -> 2
97/10/24 17:36:09| WRITE on fd: 15
97/10/24 17:36:09| DONE: 350 -> 0
97/10/24 17:36:09| storeSwapOutHandle: 'http://internal.squid/icons/anthony-dir.gif', len=350
Received on Tue Jul 29 2003 - 13:15:44 MDT
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:11:27 MST