[OpenAFS] crash on AIX 5.2
Horst Birthelmer
horst@riback.net
Tue, 11 Jan 2005 20:36:49 +0100
On Jan 11, 2005, at 8:10 PM, Douglas E. Engert wrote:
>
>
> Jim Rees wrote:
>> I don't think this is your problem, but this looks wrong to me:
>> if (inSize > AFS_LRALLOCSIZ) {
>> inData = osi_AllocLargeSpace(inSize+1);
>> } else {
>> inData = osi_AllocLargeSpace(AFS_LRALLOCSIZ);
>> }
>> That first one should be osi_Alloc, not osi_AllocLargeSpace.
>
> Yes that looks like a bug. A few lines later, osi_Free will be used
> to free the area. It also looks like insize is not greater then
> AFS_LRALLOCSIZE as osi_AllocLargeSize tests for this and would
> panic: osi_Panic("osi_AllocLargeSpace: size=%d\n", size);
>
>> Also I think this code could use a comment. It's a bit confusing that
>> osi_AllocLargeSpace is being used for small allocs, and osi_Alloc is
>> being
>> used for large ones.
>
> Looks like osi_AllocLargeSize and osi_FreeLargeSpace will keep a pool
> of
> 4K blocks off of freePacketList. Thus any size < 4K get a full 4K. If
> there
> is really a large packet like aticket with a big MS PAC, then 4K may
> not be
> big enough, so osi_Alloc is used directly.
>
I changed that a long time ago just for testing.
You can use any kernel allocation there. If you allocate those 12k+ the
system will crash.
Horst