NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/40651: kmem_alloc() returns misaligned pointers



The following reply was made to PR kern/40651; it has been noted by GNATS.

From: yamt%mwd.biglobe.ne.jp@localhost (YAMAMOTO Takashi)
To: gnats-bugs%NetBSD.org@localhost
Cc: kern-bug-people%netbsd.org@localhost, gnats-admin%netbsd.org@localhost, 
netbsd-bugs%netbsd.org@localhost
Subject: Re: kern/40651: kmem_alloc() returns misaligned pointers
Date: Mon, 16 Feb 2009 09:16:12 +0900 (JST)

 > and tp is 0xf41b4c0c - which is only 32bit aligned, but struct tty contains
 > a 64 bit t_dev, which needs 64 bit alignement.
 > 
 > >How-To-Repeat:
 > 
 > Just boot a -current sparc kernel (should probably happen on other 32bit
 > alignement picky archs too)
 
 is it with DEBUG?
 
 YAMAMOTO Takashi
 
 
 Index: subr_kmem.c
 ===================================================================
 RCS file: /cvsroot/src/sys/kern/subr_kmem.c,v
 retrieving revision 1.24
 diff -u -p -r1.24 subr_kmem.c
 --- subr_kmem.c        6 Feb 2009 22:58:49 -0000       1.24
 +++ subr_kmem.c        16 Feb 2009 00:15:12 -0000
 @@ -119,7 +119,7 @@ static void kmem_poison_check(void *, si
  #endif /* defined(KMEM_REDZONE) */
  
  #if defined(KMEM_SIZE)
 -#define       SIZE_SIZE       (min(KMEM_QUANTUM_SIZE, sizeof(size_t)))
 +#define       SIZE_SIZE       (max(KMEM_QUANTUM_SIZE, sizeof(size_t)))
  static void kmem_size_set(void *, size_t);
  static void kmem_size_check(void *, size_t);
  #else
 


Home | Main Index | Thread Index | Old Index