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

Re: ulogd unaligned trap



On Tue, Jan 24, 2006 at 05:44:39PM -0800, Steve Langasek wrote:
> On Wed, Jan 25, 2006 at 12:49:04AM +0000, Carlos Rodrigues wrote:
> > On 1/24/06, Jay Estabrook <Jay.Estabrook@hp.com> wrote:
> > > I think you can use "ldd /wherever/you/find/ulogd" to print the
> > > libraries used by "ulogd" and where they are relocated to; that should
> > > at least give the library the unaligned accesses come from...

> > Ok, so here it is...

> > ulisses:~# ldd /usr/sbin/ulogd
> >         libdl.so.2.1 => /lib/libdl.so.2.1 (0x0000020000038000)
> >         libc.so.6.1 => /lib/libc.so.6.1 (0x000002000004c000)
> >         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x0000020000000000)

> > Not much there. So, it seems that those addresses belong to something
> > related to glibc.

> > Any ideas how I can trace this down? One of the machines isn't on
> > production, so I can try to see exactly where these messages are
> > triggered. However, I don't exactly see how to do this using
> > ltrace/strace... (since the messages are generated by the kernel).

> http://lists.debian.org/debian-alpha/2005/08/msg00051.html

> It might be nice if someone would be willing to take this code and merge it
> with the existing prctl package (currently ia64-only).

So, attached is a fun little kernel patch for people to play with.  To make
use of it, just grab the prctl source package, add "alpha" to the
Architecture: list in debian/control, and build.

Working on getting this included in the Debian kernel, and pushed upstream;
see Debian bug #349765 for details.

Cheers,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
vorlon@debian.org                                   http://www.debian.org/
diff --git a/include/asm-alpha/thread_info.h b/include/asm-alpha/thread_info.h
index 69ffd93..011daaf 100644
--- a/include/asm-alpha/thread_info.h
+++ b/include/asm-alpha/thread_info.h
@@ -92,5 +92,27 @@ register struct thread_info *__current_t
 #define _TIF_ALLWORK_MASK	(_TIF_WORK_MASK		\
 				 | _TIF_SYSCALL_TRACE)
 
+#define ALPHA_UAC_SHIFT		6
+#define ALPHA_UAC_MASK		(1 << TIF_UAC_NOPRINT | 1 << TIF_UAC_NOFIX | \
+				 1 << TIF_UAC_SIGBUS)
+
+#define SET_UNALIGN_CTL(task,value)	({				     \
+	(task)->thread_info->flags = (((task)->thread_info->flags &	     \
+		~ALPHA_UAC_MASK)					     \
+		| (((value) << ALPHA_UAC_SHIFT) & (1 << TIF_UAC_NOPRINT))    \
+		| (((value) << ALPHA_UAC_SHIFT + 1) & (1 << TIF_UAC_SIGBUS)) \
+		| (((value) << ALPHA_UAC_SHIFT - 1) & (1 << TIF_UAC_NOFIX)));\
+	0; })
+
+#define GET_UNALIGN_CTL(task,value)	({				\
+	put_user(((task)->thread_info->flags & (1 << TIF_UAC_NOPRINT))	\
+		  >> ALPHA_UAC_SHIFT					\
+		 | ((task)->thread_info->flags & (1 << TIF_UAC_SIGBUS))	\
+		  >> ALPHA_UAC_SHIFT + 1				\
+		 | ((task)->thread_info->flags & (1 << TIF_UAC_NOFIX))	\
+		  >> ALPHA_UAC_SHIFT - 1,				\
+		 (int __user *)(value));				\
+	})
+
 #endif /* __KERNEL__ */
 #endif /* _ALPHA_THREAD_INFO_H */

Attachment: signature.asc
Description: Digital signature


Reply to: