This is sources Bugzilla
Bugzilla Version 2.17.5
Bugzilla Bug 3333
  localedef crash under PaX kernels Last modified: 2006-10-11 08:18:46
     Query page      Enter new bug
Bug#: 3333   Hardware:   Reporter: Robert Connolly <robert@linuxfromscratch.org>
Host: Target: Build:
Product:     Add CC:
Component:   Version:   CC:
Remove selected CCs
Status: RESOLVED   Priority:  
Resolution: INVALID   Severity:  
Assigned To: Ulrich Drepper <drepper@redhat.com>   Target Milestone:  
Flags: Requestee:
  backport ()
  examined ()
  testsuite ()
Summary:
Keywords:

Attachment Description Type Created Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 3333 depends on: Show dependency tree
Show dependency graph
Bug 3333 blocks:

Additional Comments:


Leave as RESOLVED INVALID
Reopen bug
Mark bug as VERIFIED

View Bug Activity   |   Format For Printing


Description:   Last confirmed: 0000-00-00 00:00 Opened: 2006-10-11 08:12
localdef crashes when run on kernels with PaX, and some non-x86 architectures. 
This patch fixes the issue:

diff -Naur glibc-2.5.orig/locale/programs/3level.h 
glibc-2.5/locale/programs/3level.h
--- glibc-2.5.orig/locale/programs/3level.h	2005-12-07 05:47:27.000000000 
+0000
+++ glibc-2.5/locale/programs/3level.h	2006-10-11 08:05:00.000000000 +0000
@@ -202,6 +202,42 @@
 	}
     }
 }
+
+/* GCC ATM seems to do a poor job with pointers to nested functions passed
+   to inlined functions.  Help it a little bit with this hack.  */
+#define wchead_table_iterate(tp, fn) \
+do									      \
+  {									      \
+    struct wchead_table *t = (tp);					      \
+    uint32_t index1;							      \
+    for (index1 = 0; index1 < t->level1_size; index1++)			      
\
+      {									      
\
+	uint32_t lookup1 = t->level1[index1];				      \
+	if (lookup1 != ((uint32_t) ~0))					      \
+	  {								      \
+	    uint32_t lookup1_shifted = lookup1 << t->q;			      \
+	    uint32_t index2;						      \
+	    for (index2 = 0; index2 < (1 << t->q); index2++)		      \
+	      {								      \
+		uint32_t lookup2 = t->level2[index2 + lookup1_shifted];	      \
+		if (lookup2 != ((uint32_t) ~0))				      \
+		  {							      \
+		    uint32_t lookup2_shifted = lookup2 << t->p;		      \
+		    uint32_t index3;					      \
+		    for (index3 = 0; index3 < (1 << t->p); index3++)	      \
+		      {							      \
+			struct element_t *lookup3			      \
+			  = t->level3[index3 + lookup2_shifted];	      \
+			if (lookup3 != NULL)				      \
+			  fn ((((index1 << t->q) + index2) << t->p) + index3, \
+			      lookup3);					      \
+		      }							      \
+		  }							      \
+	      }								      \
+	  }								      \
+      }									      
\
+  } while (0)
+
 #endif
 
 #ifndef NO_FINALIZE

------- Additional Comment #1 From Ulrich Drepper 2006-10-11 08:18 -------
The code is fine.  If you need patches for your kernel apply them yourself.

     Query page      Enter new bug
Actions: New | Query | bug # | Reports | Requests   New Account | Log In