Skip to contentSkip to conversation

Random crashes when calling git

DISCUSSION Rolf Eike Beer 2 participants 8 messages Dec 27, 2012 – Jan 8, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

The CMake test suite includes running some git operations. I see the git test failing every some days, e.g. here:

http://open.cdash.org/testDetails.php?test=164070366&build=2734103

The syslog output to this event is this:

Dec 27 05:14:38 voyager kernel: 
Dec 27 05:14:38 voyager kernel: do_page_fault() pid=21120 command='git' type=6 
address=0x00000003
Dec 27 05:14:38 voyager kernel: 
Dec 27 05:14:38 voyager kernel: YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
Dec 27 05:14:38 voyager kernel: PSW: 00000000000001000000000000001111 Not 
tainted
Dec 27 05:14:38 voyager kernel: r00-03  0004000f 4083bb40 00000000 00000007
Dec 27 05:14:38 voyager kernel: r04-07  4036e6f8 4103b480 00000000 4083c000
Dec 27 05:14:38 voyager kernel: r08-11  000000fb 4036b624 403709a4 00000000
Dec 27 05:14:38 voyager kernel: r12-15  402ffc60 fffff000 00800000 001397ae
Dec 27 05:14:38 voyager kernel: r16-19  fb217954 fb217964 4083c000 00000000
Dec 27 05:14:38 voyager kernel: r20-23  00000003 00000054 00000049 4103b900
Dec 27 05:14:38 voyager kernel: r24-27  0000000e 00123ec2 00000000 001350fc
Dec 27 05:14:38 voyager kernel: r28-31  00000000 00000002 4083c280 fefefeff
Dec 27 05:14:38 voyager kernel: sr00-03  0000002c 00000000 00000000 0000002c
Dec 27 05:14:38 voyager kernel: sr04-07  0000002c 0000002c 0000002c 0000002c
Dec 27 05:14:38 voyager kernel: 
Dec 27 05:14:38 voyager kernel: VZOUICununcqcqcqcqcqcrmunTDVZOUI
Dec 27 05:14:38 voyager kernel: FPSR: 00000000000000000000000000000000
Dec 27 05:14:38 voyager kernel: FPER1: 00000000
Dec 27 05:14:38 voyager kernel: fr00-03  0000000000000000 0000000000000000 
0000000000000000 0000000000000000
Dec 27 05:14:38 voyager kernel: fr04-07  0000000000000000 7d00000000000000 
00000004e2000000 4097700000000000
Dec 27 05:14:38 voyager kernel: fr08-11  0000000000000000 0000000000000000 
00000004019ff37b 2ecf5011101b4ce8
Dec 27 05:14:38 voyager kernel: fr12-15  4097700000000000 0000000000000000 
41d436ef72347f39 0000000050d30cd9
Dec 27 05:14:38 voyager kernel: fr16-19  0004fe0f105ad000 1012db6800000006 
0000000000000000 0000000000000031
Dec 27 05:14:38 voyager kernel: fr20-23  105ad00010605800 000000061060580a 
0000000000000088 00229d5b00000000
Dec 27 05:14:38 voyager kernel: fr24-27  0000000000000000 00000000a0b5ed8d 
00000000000000ff 0000000000000000
Dec 27 05:14:38 voyager kernel: fr28-31  00000005000203f9 105ad2b810592000 
105ad2a4000000ff 2f8302001011b974
Dec 27 05:14:38 voyager kernel: 
Dec 27 05:14:38 voyager kernel: IASQ: 0000002c 0000002c IAOQ: 00000003 
00000007
Dec 27 05:14:38 voyager kernel: IIR: 43ffff80    ISR: 0000002c  IOR: 4103b504
Dec 27 05:14:38 voyager kernel: CPU:        0   CR30: 2f100000 CR31: ffffffff
Dec 27 05:14:38 voyager kernel: ORIG_R28: 00000000
Dec 27 05:14:38 voyager kernel: IAOQ[0]: 00000003
Dec 27 05:14:38 voyager kernel: IAOQ[1]: 00000007
Dec 27 05:14:38 voyager kernel: RP(r2): 00000000

Kernel is up to date:

Linux voyager 3.7.1 #1 Thu Dec 20 12:22:22 CET 2012 parisc PA8600 (PCX-W+) 9000/785/C3600 GNU/Linux

Glibc is 2.14.1.

Any ideas?

Eike

#1 lore raw
Quoted 1 line · Rolf Eike Beer

Any ideas?

Try running the test under gdb. Git has branched to location 0 causing a page fault. We need a backtrace(s) to learn something useful. There may be multiple backtraces (info thread).

Enable core dumps if not enabled. Might find something useful by examining it (gdb -c core /usr/bin/git).

Git uses threads. I expect the problem is thread related since it doesn't happen all the time, and for that reason it might not be reproducible running under gdb..

You might try building git and running its testsuite. I remember that some thread related tests used to fail for me. I think it may be possible to build git without pthread support.

Dave
--
John David Anglin [email protected]

#2 lore raw
Quoted 6 lines · John David Anglin
Quoted 1 line · Rolf Eike Beer

Any ideas?

Try running the test under gdb. Git has branched to location 0 causing a page fault. We need a backtrace(s) to learn something useful. There may be multiple backtraces (info thread).

I have not managed to reproduce this this way.

Quoted 11 lines

Enable core dumps if not enabled. Might find something useful by examining it (gdb -c core /usr/bin/git).

Git uses threads. I expect the problem is thread related since it doesn't
happen all the time, and for that reason it might not be reproducible running under gdb..

You might try building git and running its testsuite. I remember that some thread related tests used to fail for me. I think it may be possible to build git without pthread support.

I got 2 failures in 5400, 1 in 5406 and one in 5500 so far (in 4 runs).

Eike

#3 lore raw
In reply to John David Anglin
Quoted 6 lines · John David Anglin
Quoted 1 line · Rolf Eike Beer

Any ideas?

Try running the test under gdb. Git has branched to location 0 causing a page fault. We need a backtrace(s) to learn something useful. There may be multiple backtraces (info thread).

This did not lead anywhere. I tried running the test only with strace, but even that did not lead to any crash.

Quoted 7 lines

Enable core dumps if not enabled. Might find something useful by examining it (gdb -c core /usr/bin/git).

Git uses threads. I expect the problem is thread related since it doesn't
happen all the time, and for that reason it might not be reproducible running under gdb..

I've put together the used git executable as well as 4 core dumps at
http://opensource.sf-tec.de/git-crash.tar.bz2

It would be nice if you could take a look and tell me if this gives you anything.

Greetings,

Eike

#4 lore raw
Quoted 5 lines · Rolf Eike Beer

I've put together the used git executable as well as 4 core dumps at
http://opensource.sf-tec.de/git-crash.tar.bz2

It would be nice if you could take a look and tell me if this gives you anything.

I looked at the first one:

(gdb) p/x $pc
$1 = 0x0
(gdb) info threads

  Id   Target Id         Frame
  2    LWP 28212         0x000e054c in receive_status (in=1077339896,
    refs=0x19e578) at send-pack.c:163
* 1    LWP 28214         0x00000000 in ?? ()
(gdb) info reg
flags          0x4000f	262159
r1             0x40fe7b40	1090419520
rp             0x0	0
r3             0x7	7
r4             0x4036e6f8	1077339896
r5             0x417e7480	1098806400
r6             0x0	0
r7             0x40fe8000	1090420736
r8             0xfb	251
r9             0x4036b624	1077327396
r10            0x403709a4	1077348772
r11            0x0	0
r12            0x402ffc60	1076886624
r13            0xfffff000	4294963200
r14            0x800000	8388608
r15            0x14fcb2	1375410
r16            0xfb03d9d4	4211333588
r17            0xfb03d9e4	4211333604
r18            0x40fe8000	1090420736
r19            0x0	0
r20            0x3	3
r21            0x54	84
r22            0x49	73
---Type <return> to continue, or q <return> to quit---
r23            0x0	0
r24            0xe	14
r25            0x136bb2	1272754
r26            0x0	0
dp             0x14b0fc	1356028
ret0           0x0	0
ret1           0x2	2
sp             0x40fe8280	1090421376
r31            0xfefefeff	4278124287
sar            0x1d	29
pcoqh          0x3	3
pcsqh          0x2e	46
pcoqt          0x7	7
pcsqt          0x2e	46
eiem           0xfe000000	4261412864
iir            0x43ffff80	1140850560
isr            0x2e	46
ior            0x417e7504	1098806532
ipsw           0x4fe0f	327183
goto           *value not available*
sr4            0x2e	46
sr0            0x2e	46
sr1            0x0	0

(gdb) p/x $sp
$3 = 0x40fe8280
(gdb) x/64x $sp-64
0x40fe8240: 0x00000000 0x00000000 0x00000000 0x00000000
0x40fe8250: 0x00000000 0x00000000 0x00000000 0x00000000
0x40fe8260: 0x00000000 0x00000000 0x00000000 0x00000000
0x40fe8270: 0x00000000 0x00000000 0x00000000 0x00000000
0x40fe8280: 0x00000000 0x00000000 0x00000000 0x00000000
0x40fe8290: 0x00007265 0x6d6f7465 0x3a013030 0x3065756e
0x40fe82a0: 0x7061636b 0x206f6b0a 0x30303139 0x6f6b2072
0x40fe82b0: 0x6566732f 0x68656164 0x732f6d61 0x73746572
0x40fe82c0: 0x0a303030 0x30000000 0x00000000 0x00000000
0x40fe82d0: 0x00000000 0x00000000 0x00000000 0x00000000
0x40fe82e0: 0x00000000 0x00000000 0x00000000 0x00000000
0x40fe82f0: 0x00000000 0x00000000 0x00000000 0x00000000
0x40fe8300: 0x00000000 0x00000000 0x00000000 0x00000000
0x40fe8310: 0x00000000 0x00000000 0x00000000 0x00000000
0x40fe8320: 0x00000000 0x00000000 0x00000000 0x00000000
0x40fe8330: 0x00000000 0x00000000 0x00000000 0x00000000

I think this is the infamous thread stack corruption bug. There are numerous discussions about it on the list.

It's just a guess but I believe my kernel patch may help. Attaching latest version for 3.7.1.

If the patch doesn't help, then I think we need to review the glibc patch sets for debian and gentoo. I have installed an unmodified version of 2.13-37.

Happy New Year,
Dave
--
John David Anglin [email protected]

arch/parisc/hpux/wrappers.S +2 -2
index 58c53c8..bdcea33 100644
@@ -88,7 +88,7 @@ ENTRY(hpux_fork_wrapper)
 
 	STREG	%r2,-20(%r30)
 	ldo	64(%r30),%r30
-	STREG	%r2,PT_GR19(%r1)	;! save for child
+	STREG	%r2,PT_SYSCALL_RP(%r1)	;! save for child
 	STREG	%r30,PT_GR21(%r1)	;! save for child
 
 	LDREG	PT_GR30(%r1),%r25
@@ -132,7 +132,7 @@ ENTRY(hpux_child_return)
 	bl,n	schedule_tail, %r2
 #endif
 
-	LDREG	TASK_PT_GR19-TASK_SZ_ALGN-128(%r30),%r2
+	LDREG	TASK_PT_SYSCALL_RP-TASK_SZ_ALGN-128(%r30),%r2
 	b fork_return
 	copy %r0,%r28
 ENDPROC(hpux_child_return)
arch/parisc/include/asm/cacheflush.h +2 -0
index 9f21ab0..79f694f 100644
@@ -115,7 +115,9 @@ flush_anon_page(struct vm_area_struct *vma, struct page *page, unsigned long vma
 {
 	if (PageAnon(page)) {
 		flush_tlb_page(vma, vmaddr);
+		preempt_disable();
 		flush_dcache_page_asm(page_to_phys(page), vmaddr);
+		preempt_enable();
 	}
 }
 
arch/parisc/include/asm/compat_rt_sigframe.h deleted +0 -50

50 lines not on this page · raw message

arch/parisc/include/asm/mmzone.h +2 -3
index e67eb9c..31835b9 100644
@@ -1,9 +1,10 @@
 #ifndef _PARISC_MMZONE_H
 #define _PARISC_MMZONE_H
 
+#define MAX_PHYSMEM_RANGES 8 /* Fix the size for now (current known max is 3) */
+
 #ifdef CONFIG_DISCONTIGMEM
 
-#define MAX_PHYSMEM_RANGES 8 /* Fix the size for now (current known max is 3) */
 extern int npmem_ranges;
 
 struct node_map_data {
@@ -60,7 +61,5 @@ static inline int pfn_valid(int pfn)
 	return 0;
 }
 
-#else /* !CONFIG_DISCONTIGMEM */
-#define MAX_PHYSMEM_RANGES 	1 
 #endif
 #endif /* _PARISC_MMZONE_H */
arch/parisc/include/asm/page.h +16 -4
index 4e0e7db..d9812d8 100644
@@ -21,15 +21,27 @@
 #include <asm/types.h>
 #include <asm/cache.h>
 
-#define clear_page(page)	memset((void *)(page), 0, PAGE_SIZE)
-#define copy_page(to,from)      copy_user_page_asm((void *)(to), (void *)(from))
+#define clear_page(page)	clear_page_asm((void *)(page))
+#define copy_page(to,from)	copy_page_asm((void *)(to), (void *)(from))
 
 struct page;
 
-void copy_user_page_asm(void *to, void *from);
+void clear_page_asm(void *page);
+void copy_page_asm(void *to, void *from);
+void clear_user_page(void *vto, unsigned long vaddr, struct page *pg);
 void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
 			   struct page *pg);
-void clear_user_page(void *page, unsigned long vaddr, struct page *pg);
+
+// #define CONFIG_PARISC_TMPALIAS
+
+#ifdef CONFIG_PARISC_TMPALIAS
+void clear_user_highpage(struct page *page, unsigned long vaddr);
+#define clear_user_highpage clear_user_highpage
+struct vm_area_struct;
+void copy_user_highpage(struct page *to, struct page *from,
+	unsigned long vaddr, struct vm_area_struct *vma);
+#define __HAVE_ARCH_COPY_USER_HIGHPAGE
+#endif
 
 /*
  * These are used to make use of C type-checking..
arch/parisc/include/asm/pgtable.h +12 -3
index ee99f23..563724d 100644
@@ -12,11 +12,10 @@
 
 #include <linux/bitops.h>
 #include <linux/spinlock.h>
+#include <linux/mm_types.h>
 #include <asm/processor.h>
 #include <asm/cache.h>
 
-struct vm_area_struct;
-
 /*
  * kern_addr_valid(ADDR) tests if ADDR is pointing to valid kernel
  * memory.  For the return value to be meaningful, ADDR must be >=
@@ -40,7 +39,14 @@ struct vm_area_struct;
         do{                                                     \
                 *(pteptr) = (pteval);                           \
         } while(0)
-#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
+
+extern void purge_tlb_entries(struct mm_struct *, unsigned long);
+
+#define set_pte_at(mm,addr,ptep, pteval)                        \
+        do{                                                     \
+                set_pte(ptep,pteval);                           \
+                purge_tlb_entries(mm,addr);                     \
+        } while(0)
 
 #endif /* !__ASSEMBLY__ */
 
@@ -462,10 +468,13 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
 #ifdef CONFIG_SMP
 	unsigned long new, old;
 
+	/* ??? This might be racy because the page table updates in
+	   entry.S don't use the same lock.  */
 	do {
 		old = pte_val(*ptep);
 		new = pte_val(pte_wrprotect(__pte (old)));
 	} while (cmpxchg((unsigned long *) ptep, old, new) != old);
+	purge_tlb_entries(mm, addr);
 #else
 	pte_t old_pte = *ptep;
 	set_pte_at(mm, addr, ptep, pte_wrprotect(old_pte));
arch/parisc/kernel/asm-offsets.c +2 -0
index dcd5510..5df1597 100644
@@ -141,6 +141,7 @@ int main(void)
 	DEFINE(TASK_PT_IAOQ0, offsetof(struct task_struct, thread.regs.iaoq[0]));
 	DEFINE(TASK_PT_IAOQ1, offsetof(struct task_struct, thread.regs.iaoq[1]));
 	DEFINE(TASK_PT_CR27, offsetof(struct task_struct, thread.regs.cr27));
+	DEFINE(TASK_PT_SYSCALL_RP, offsetof(struct task_struct, thread.regs.pad0));
 	DEFINE(TASK_PT_ORIG_R28, offsetof(struct task_struct, thread.regs.orig_r28));
 	DEFINE(TASK_PT_KSP, offsetof(struct task_struct, thread.regs.ksp));
 	DEFINE(TASK_PT_KPC, offsetof(struct task_struct, thread.regs.kpc));
@@ -230,6 +231,7 @@ int main(void)
 	DEFINE(PT_IAOQ0, offsetof(struct pt_regs, iaoq[0]));
 	DEFINE(PT_IAOQ1, offsetof(struct pt_regs, iaoq[1]));
 	DEFINE(PT_CR27, offsetof(struct pt_regs, cr27));
+	DEFINE(PT_SYSCALL_RP, offsetof(struct pt_regs, pad0));
 	DEFINE(PT_ORIG_R28, offsetof(struct pt_regs, orig_r28));
 	DEFINE(PT_KSP, offsetof(struct pt_regs, ksp));
 	DEFINE(PT_KPC, offsetof(struct pt_regs, kpc));
arch/parisc/kernel/cache.c +185 -36

286 lines not on this page · raw message

arch/parisc/kernel/entry.S +24 -23

106 lines not on this page · raw message

arch/parisc/kernel/inventory.c +2 -0
index 08324aa..3295ef4 100644
@@ -186,12 +186,14 @@ pat_query_module(ulong pcell_loc, ulong mod_index)
 
 	if (status != PDC_OK) {
 		/* no more cell modules or error */
+		kfree(pa_pdc_cell);
 		return status;
 	}
 
 	temp = pa_pdc_cell->cba;
 	dev = alloc_pa_dev(PAT_GET_CBA(temp), &(pa_pdc_cell->mod_path));
 	if (!dev) {
+		kfree(pa_pdc_cell);
 		return PDC_OK;
 	}
 
arch/parisc/kernel/irq.c +6 -4
index c0b1aff..8094d3e 100644
@@ -379,14 +379,14 @@ void do_cpu_irq_mask(struct pt_regs *regs)
 static struct irqaction timer_action = {
 	.handler = timer_interrupt,
 	.name = "timer",
-	.flags = IRQF_DISABLED | IRQF_TIMER | IRQF_PERCPU | IRQF_IRQPOLL,
+	.flags = IRQF_TIMER | IRQF_PERCPU | IRQF_IRQPOLL,
 };
 
 #ifdef CONFIG_SMP
 static struct irqaction ipi_action = {
 	.handler = ipi_interrupt,
 	.name = "IPI",
-	.flags = IRQF_DISABLED | IRQF_PERCPU,
+	.flags = IRQF_PERCPU,
 };
 #endif
 
@@ -410,11 +410,13 @@ void __init init_IRQ(void)
 {
 	local_irq_disable();	/* PARANOID - should already be disabled */
 	mtctl(~0UL, 23);	/* EIRR : clear all pending external intr */
-	claim_cpu_irqs();
 #ifdef CONFIG_SMP
-	if (!cpu_eiem)
+	if (!cpu_eiem) {
+		claim_cpu_irqs();
 		cpu_eiem = EIEM_MASK(IPI_IRQ) | EIEM_MASK(TIMER_IRQ);
+	}
 #else
+	claim_cpu_irqs();
 	cpu_eiem = EIEM_MASK(TIMER_IRQ);
 #endif
         set_eiem(cpu_eiem);	/* EIEM : enable all external intr */
arch/parisc/kernel/pacache.S +294 -51

533 lines not on this page · raw message

arch/parisc/kernel/parisc_ksyms.c +3 -2
index ceec85d..6795dc6 100644
@@ -157,5 +157,6 @@ extern void _mcount(void);
 EXPORT_SYMBOL(_mcount);
 #endif
 
-/* from pacache.S -- needed for copy_page */
-EXPORT_SYMBOL(copy_user_page_asm);
+/* from pacache.S -- needed for clear/copy_page */
+EXPORT_SYMBOL(clear_page_asm);
+EXPORT_SYMBOL(copy_page_asm);
arch/parisc/kernel/ptrace.c +1 -1
index 857c2f5..534abd4 100644
@@ -26,7 +26,7 @@
 #include <asm/asm-offsets.h>
 
 /* PSW bits we allow the debugger to modify */
-#define USER_PSW_BITS	(PSW_N | PSW_V | PSW_CB)
+#define USER_PSW_BITS	(PSW_N | PSW_B | PSW_V | PSW_CB)
 
 /*
  * Called by kernel/ptrace.c when detaching..
arch/parisc/kernel/signal.c +4 -2
index 5379969..52c85b2 100644
@@ -190,8 +190,10 @@ get_sigframe(struct k_sigaction *ka, unsigned long sp, size_t frame_size)
 	DBG(1,"get_sigframe: ka = %#lx, sp = %#lx, frame_size = %#lx\n",
 			(unsigned long)ka, sp, frame_size);
 	
+	/* Align alternate stack and reserve 64 bytes for the signal
+	   handler's frame marker.  */
 	if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && ! sas_ss_flags(sp))
-		sp = current->sas_ss_sp; /* Stacks grow up! */
+		sp = (current->sas_ss_sp + 0x7f) & ~0x3f; /* Stacks grow up! */
 
 	DBG(1,"get_sigframe: Returning sp = %#lx\n", (unsigned long)sp);
 	return (void __user *) sp; /* Stacks grow up.  Fun. */
@@ -310,7 +312,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
 #if DEBUG_SIG
 	/* Assert that we're flushing in the correct space... */
 	{
-		int sid;
+		unsigned long sid;
 		asm ("mfsp %%sr3,%0" : "=r" (sid));
 		DBG(1,"setup_rt_frame: Flushing 64 bytes at space %#x offset %p\n",
 		       sid, frame->tramp);
arch/parisc/kernel/sys_parisc.c +5 -4
index f76c108..a047b32 100644
@@ -94,11 +94,12 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
 {
 	if (len > TASK_SIZE)
 		return -ENOMEM;
-	/* Might want to check for cache aliasing issues for MAP_FIXED case
-	 * like ARM or MIPS ??? --BenH.
-	 */
-	if (flags & MAP_FIXED)
+	if (flags & MAP_FIXED) {
+		if ((flags & MAP_SHARED) &&
+		    (addr - (pgoff << PAGE_SHIFT)) & (SHMLBA - 1))
+			return -EINVAL;
 		return addr;
+	}
 	if (!addr)
 		addr = TASK_UNMAPPED_BASE;
 
arch/parisc/kernel/syscall.S +4 -1
index 86742df..c893ec4 100644
@@ -309,10 +309,13 @@ tracesys_next:
 	LDREG   TASK_PT_GR25(%r1), %r25
 	LDREG   TASK_PT_GR24(%r1), %r24
 	LDREG   TASK_PT_GR23(%r1), %r23
-#ifdef CONFIG_64BIT
 	LDREG   TASK_PT_GR22(%r1), %r22
 	LDREG   TASK_PT_GR21(%r1), %r21
+#ifdef CONFIG_64BIT
 	ldo	-16(%r30),%r29			/* Reference param save area */
+#else
+	stw	%r22, -52(%r30)			/* 5th argument */
+	stw	%r21, -56(%r30)			/* 6th argument */
 #endif
 
 	comiclr,>>=	__NR_Linux_syscalls, %r20, %r0
arch/parisc/kernel/time.c +1 -1
index 70e105d..4a24ba7 100644
@@ -77,7 +77,7 @@ irqreturn_t __irq_entry timer_interrupt(int irq, void *dev_id)
 
 	cycles_elapsed = now - next_tick;
 
-	if ((cycles_elapsed >> 6) < cpt) {
+	if ((cycles_elapsed >> 7) < cpt) {
 		/* use "cheap" math (add/subtract) instead
 		 * of the more expensive div/mul method
 		 */
arch/parisc/math-emu/cnv_float.h +4 -5
index 9071e09..37299c7 100644
@@ -347,16 +347,15 @@
     Sgl_isinexact_to_fix(sgl_value,exponent)
 
 #define Duint_from_sgl_mantissa(sgl_value,exponent,dresultA,dresultB)	\
-  {Sall(sgl_value) <<= SGL_EXP_LENGTH;  /*  left-justify  */		\
+  {unsigned int val = Sall(sgl_value) << SGL_EXP_LENGTH;		\
     if (exponent <= 31) {						\
     	Dintp1(dresultA) = 0;						\
-    	Dintp2(dresultB) = (unsigned)Sall(sgl_value) >> (31 - exponent); \
+    	Dintp2(dresultB) = val >> (31 - exponent);			\
     }									\
     else {								\
-    	Dintp1(dresultA) = Sall(sgl_value) >> (63 - exponent);		\
-    	Dintp2(dresultB) = Sall(sgl_value) << (exponent - 31);		\
+    	Dintp1(dresultA) = val >> (63 - exponent);			\
+    	Dintp2(dresultB) = exponent <= 62 ? val << (exponent - 31) : 0;	\
     }									\
-    Sall(sgl_value) >>= SGL_EXP_LENGTH;  /* return to original */	\
   }
 
 #define Duint_setzero(dresultA,dresultB) 	\
arch/parisc/mm/fault.c +24 -5
index 18162ce..524bf5a 100644
@@ -175,10 +175,12 @@ void do_page_fault(struct pt_regs *regs, unsigned long code,
 	struct mm_struct *mm = tsk->mm;
 	unsigned long acc_type;
 	int fault;
+	unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
 
 	if (in_atomic() || !mm)
 		goto no_context;
 
+retry:
 	down_read(&mm->mmap_sem);
 	vma = find_vma_prev(mm, address, &prev_vma);
 	if (!vma || address < vma->vm_start)
@@ -201,7 +203,12 @@ good_area:
 	 * fault.
 	 */
 
-	fault = handle_mm_fault(mm, vma, address, (acc_type & VM_WRITE) ? FAULT_FLAG_WRITE : 0);
+	fault = handle_mm_fault(mm, vma, address,
+		flags | ((acc_type & VM_WRITE) ? FAULT_FLAG_WRITE : 0));
+
+	if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current))
+		return;
+
 	if (unlikely(fault & VM_FAULT_ERROR)) {
 		/*
 		 * We hit a shared mapping outside of the file, or some
@@ -214,10 +221,22 @@ good_area:
 			goto bad_area;
 		BUG();
 	}
-	if (fault & VM_FAULT_MAJOR)
-		current->maj_flt++;
-	else
-		current->min_flt++;
+	if (flags & FAULT_FLAG_ALLOW_RETRY) {
+		if (fault & VM_FAULT_MAJOR)
+			current->maj_flt++;
+		else
+			current->min_flt++;
+		if (fault & VM_FAULT_RETRY) {
+			flags &= ~FAULT_FLAG_ALLOW_RETRY;
+
+			/* No need to up_read(&mm->mmap_sem) as we would
+			 * have already released it in __lock_page_or_retry
+			 * in mm/filemap.c.
+			 */
+
+			goto retry;
+		}
+	}
 	up_read(&mm->mmap_sem);
 	return;
 
kernel/irq/chip.c +4 -1
index 57d86d0..f1b49d3 100644
@@ -581,6 +581,7 @@ out_eoi:
 void
 handle_percpu_irq(unsigned int irq, struct irq_desc *desc)
 {
+	struct irqaction *action;
 	struct irq_chip *chip = irq_desc_get_chip(desc);
 
 	kstat_incr_irqs_this_cpu(irq, desc);
@@ -588,7 +589,9 @@ handle_percpu_irq(unsigned int irq, struct irq_desc *desc)
 	if (chip->irq_ack)
 		chip->irq_ack(&desc->irq_data);
 
-	handle_irq_event_percpu(desc, desc->action);
+	action = desc->action;
+	if (action)
+		handle_irq_event_percpu(desc, action);
 
 	if (chip->irq_eoi)
 		chip->irq_eoi(&desc->irq_data);
kernel/softirq.c +1 -1
index cc96bdc..6d68000 100644
@@ -259,7 +259,7 @@ restart:
 		}
 		h++;
 		pending >>= 1;
-	} while (pending);
+	} while (pending && h >= (struct softirq_action *)0x1000);
 
 	local_irq_disable();
 
#5 lore raw
Quoted 8 lines · You
Quoted 6 lines · Rolf Eike Beer

I've put together the used git executable as well as 4 core dumps at
http://opensource.sf-tec.de/git-crash.tar.bz2

It would be nice if you could take a look and tell me if this gives you
anything.

Quoted 8 lines

I looked at the first one:

I think this is the infamous thread stack corruption bug. There are numerous discussions about it on the list.

It's just a guess but I believe my kernel patch may help. Attaching latest
version for 3.7.1.

Thx, I'll have a look when I'm back in the office next week.

Until next year,

Eike

#6 lore raw
In reply to John David Anglin
Quoted 11 lines · John David Anglin
Quoted 5 lines · Rolf Eike Beer

I've put together the used git executable as well as 4 core dumps at
http://opensource.sf-tec.de/git-crash.tar.bz2

It would be nice if you could take a look and tell me if this gives you anything.

I think this is the infamous thread stack corruption bug. There are numerous discussions about it on the list.

Quoted 6 lines

It's just a guess but I believe my kernel patch may help. Attaching latest version for 3.7.1.

If the patch doesn't help, then I think we need to review the glibc patch sets for debian and gentoo. I have installed an unmodified version of 2.13-37.

I have now applied this patch and while at it added another 1GB of RAM, but I don't think the latter will make any difference.

I was now able to run the CMake git test for more than a dozen times in a row without a single failure and also the git testsuite is now in the range of the 6000 with it's tests, which is far beyond anything it was able to reach until now. So I think that your patch indeed makes things better.

Time to split it up and submit it upstream ;)

Eike

#7 lore raw
Quoted 1 line · Rolf Eike Beer

I was now able to run the CMake git test for more than a dozen times in a row without a single failure and also the git testsuite is now in the range of the 6000 with it's tests, which is far beyond anything it was able to reach until now. So I think that your patch indeed makes things better.

I have have built git several times and run the full testsuite successfully.

Quoted 3 lines

Time to split it up and submit it upstream ;)

Helge has recently setup a new parisc-linux git tree on kernel.org and is going to help with pushing patches upstream. So, there is hope :-)

Dave

Signature · 1 line
John David Anglin    [email protected]