2002-06-18 13:32:11

by Vamsi Krishna S.

[permalink] [raw]
Subject: Re: [PATCH] Multi-threaded core dumps for 2.5.21.

Mark,

You are capturing the registers of the thread dumping core
twice in this patch. Please apply on top of your patch:

--- tcore/fs/binfmt_elf.c.ori Mon Jun 17 15:02:27 2002
+++ tcore/fs/binfmt_elf.c Mon Jun 17 15:02:49 2002
@@ -1203,22 +1203,6 @@

}

- memset(&prstatus, 0, sizeof(prstatus));
- /*
- * This transfers the registers from regs into the standard
- * coredump arrangement, whatever that is.
- */
-#ifdef ELF_CORE_COPY_REGS
- ELF_CORE_COPY_REGS(prstatus.pr_reg, regs)
-#else
- if (sizeof(elf_gregset_t) != sizeof(struct pt_regs))
- {
- printk("sizeof(elf_gregset_t) (%ld) != sizeof(struct pt_regs) (%ld)\n",
- (long)sizeof(elf_gregset_t), (long)sizeof(struct pt_regs));
- }
- else
- *(struct pt_regs *)&prstatus.pr_reg = *regs;
-#endif

/* capture the status of all other threads */
if (signr) {


Same problem is there on the patch you posted for 2.4.18 too, the above will
apply with a slight offset.

Vamsi Krishna S.
Linux Technology Center,
IBM Software Lab, Bangalore.
Ph: +91 80 5044959
Internet: [email protected]

On Sat, 15 Jun 2002 04:45:56 +0530, mgross wrote:

> Attached is a re-base of the 2.5.18 patch posted last week.
>
> This patch has been tested on my SMP system and seems very stable, so far. I
> would like very much to see this feature added to the 2.5.x kernels and more
> milage given to it.
>
> For ISV's not having the ability to create core dumps for pthread applications
> is a strong justification for not using Linux. Now is a good time for Linux
> support the ISV's WRT core files for multi-threaded applications.
>
> To use the core files from multi-threaded applications, created with this patch
> you may need to strip the objects from /lib/libpthread. For my system 'strip
> /lib/libpthread-0.9.so makes things good, YMMV.
>
> Please apply this patch.
>
> --mgross


2002-06-18 15:56:02

by mgross

[permalink] [raw]
Subject: Re: [PATCH] Multi-threaded core dumps for 2.5.21.

On Tuesday 18 June 2002 09:41 am, Vamsi Krishna S. wrote:
> Mark,
>
> You are capturing the registers of the thread dumping core
> twice in this patch. Please apply on top of your patch:

You are so right! That same code is defined as an inline in elfcore.h, and
is executed just a few lines down from there. I'll incorporate this into a
couple of new patches for a posting later today.

Thanks for the review.

--mgross



>
> --- tcore/fs/binfmt_elf.c.ori Mon Jun 17 15:02:27 2002
> +++ tcore/fs/binfmt_elf.c Mon Jun 17 15:02:49 2002
> @@ -1203,22 +1203,6 @@
>
> }
>
> - memset(&prstatus, 0, sizeof(prstatus));
> - /*
> - * This transfers the registers from regs into the standard
> - * coredump arrangement, whatever that is.
> - */
> -#ifdef ELF_CORE_COPY_REGS
> - ELF_CORE_COPY_REGS(prstatus.pr_reg, regs)
> -#else
> - if (sizeof(elf_gregset_t) != sizeof(struct pt_regs))
> - {
> - printk("sizeof(elf_gregset_t) (%ld) != sizeof(struct pt_regs) (%ld)\n",
> - (long)sizeof(elf_gregset_t), (long)sizeof(struct pt_regs));
> - }
> - else
> - *(struct pt_regs *)&prstatus.pr_reg = *regs;
> -#endif
>
> /* capture the status of all other threads */
> if (signr) {
>
>
> Same problem is there on the patch you posted for 2.4.18 too, the above
> will apply with a slight offset.
>
> Vamsi Krishna S.
> Linux Technology Center,
> IBM Software Lab, Bangalore.
> Ph: +91 80 5044959
> Internet: [email protected]
>
> On Sat, 15 Jun 2002 04:45:56 +0530, mgross wrote:
> > Attached is a re-base of the 2.5.18 patch posted last week.
> >
> > This patch has been tested on my SMP system and seems very stable, so
> > far. I would like very much to see this feature added to the 2.5.x
> > kernels and more milage given to it.
> >
> > For ISV's not having the ability to create core dumps for pthread
> > applications is a strong justification for not using Linux. Now is a good
> > time for Linux support the ISV's WRT core files for multi-threaded
> > applications.
> >
> > To use the core files from multi-threaded applications, created with this
> > patch you may need to strip the objects from /lib/libpthread. For my
> > system 'strip /lib/libpthread-0.9.so makes things good, YMMV.
> >
> > Please apply this patch.
> >
> > --mgross

2002-06-18 22:20:44

by mgross

[permalink] [raw]
Subject: Re: [PATCH] Multi-threaded core dumps for 2.5.21.

Done.

See attached ;)

--mgross

On Tuesday 18 June 2002 09:03 am, mgross wrote:
> On Tuesday 18 June 2002 09:41 am, Vamsi Krishna S. wrote:
> > Mark,
> >
> > You are capturing the registers of the thread dumping core
> > twice in this patch. Please apply on top of your patch:
>
> You are so right! That same code is defined as an inline in elfcore.h, and
> is executed just a few lines down from there. I'll incorporate this into a
> couple of new patches for a posting later today.
>
> Thanks for the review.
>
> --mgross
>
> > --- tcore/fs/binfmt_elf.c.ori Mon Jun 17 15:02:27 2002
> > +++ tcore/fs/binfmt_elf.c Mon Jun 17 15:02:49 2002
> > @@ -1203,22 +1203,6 @@
> >
> > }
> >
> > - memset(&prstatus, 0, sizeof(prstatus));
> > - /*
> > - * This transfers the registers from regs into the standard
> > - * coredump arrangement, whatever that is.
> > - */
> > -#ifdef ELF_CORE_COPY_REGS
> > - ELF_CORE_COPY_REGS(prstatus.pr_reg, regs)
> > -#else
> > - if (sizeof(elf_gregset_t) != sizeof(struct pt_regs))
> > - {
> > - printk("sizeof(elf_gregset_t) (%ld) != sizeof(struct pt_regs)
> > (%ld)\n", - (long)sizeof(elf_gregset_t), (long)sizeof(struct pt_regs));
> > - }
> > - else
> > - *(struct pt_regs *)&prstatus.pr_reg = *regs;
> > -#endif
> >
> > /* capture the status of all other threads */
> > if (signr) {
> >
> >
> > Same problem is there on the patch you posted for 2.4.18 too, the above
> > will apply with a slight offset.
> >
> > Vamsi Krishna S.
> > Linux Technology Center,
> > IBM Software Lab, Bangalore.
> > Ph: +91 80 5044959
> > Internet: [email protected]
> >
> > On Sat, 15 Jun 2002 04:45:56 +0530, mgross wrote:
> > > Attached is a re-base of the 2.5.18 patch posted last week.
> > >
> > > This patch has been tested on my SMP system and seems very stable, so
> > > far. I would like very much to see this feature added to the 2.5.x
> > > kernels and more milage given to it.
> > >
> > > For ISV's not having the ability to create core dumps for pthread
> > > applications is a strong justification for not using Linux. Now is a
> > > good time for Linux support the ISV's WRT core files for multi-threaded
> > > applications.
> > >
> > > To use the core files from multi-threaded applications, created with
> > > this patch you may need to strip the objects from /lib/libpthread. For
> > > my system 'strip /lib/libpthread-0.9.so makes things good, YMMV.
> > >
> > > Please apply this patch.
> > >
> > > --mgross
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/


Attachments:
tcore-2521-061802.pat (27.90 kB)