does rtems 5.1 support create a core dump file when accessing a invalid address or other fatal errors?

Gedare Bloom gedare at rtems.org
Tue Sep 15 21:22:48 UTC 2020


On Tue, Sep 15, 2020 at 2:25 PM Peter Dufault <dufault at hda.com> wrote:
>
> I think that stating that "Due to a shared address space" RTEMS can't generate a "core dump" is wrong.
>
> For example, when a thread de-references a NULL pointer the rest of the application will be intact enough to create a "core dump".
>
That's fair. It depends on the fatal error though, and what has been
corrupted already in memory. This is in general an unsafe thing to do
without taking extra precautions, for example, by loading up a clean
driver for your storage.

Anyway, there isn't a general facility to do it.

> In general, when you're developing an application I don't think you want a "core dump", you want to have a debugger attached.
>
> In the field, if your multi-threaded application is functional and has a place to store a "core dump", I think it would be great to do so if possible.
>
> > On Sep 15, 2020, at 12:03 , Joel Sherrill <joel at rtems.org> wrote:
> >
> >
> >
> > On Tue, Sep 15, 2020 at 10:26 AM Gedare Bloom <gedare at rtems.org> wrote:
> > No, there is no facility to generate a core dump. Due to shared
> > address space, once there is a fatal error you can't really trust
> > anything running in the target. You wouldn't necessarily want to try
> > writing to a mounted filesystem.
> >
> > You could probably set up a debugger to do something like this by
> > triggering it in the fatal exception handler. You'd need to make use
> > of whatever the debugger can do already though. You really can't rely
> > on the executing target.
> >
> > On the more popular architectures, if you get an exception, the BSP
> > will print out a lot of information. Included in that is usually the address
> > of the fault and register set. You can use the symbol table (from nm)
> > or addr2line to map that back to source code. Look at the generated
> > assembly and you can often tell what went wrong.
> >
> > Better is to attach a debugger and set a breakpoint on the exception
> > handler address and then poke around to see more details.
> >
> > --joel
> >
> > Gedare
> >
> > On Tue, Sep 15, 2020 at 4:58 AM smallphd at aliyun.com <smallphd at aliyun.com> wrote:
> > >
> > > I am developing applications in rtems 5.1. As we know, my application and rtems kernel are both in the same address space.
> > > So if my application access an invalid address or encounter other fatal errors, I want the kernel not just being hunging, but create a core dump file.
> > > This file contains the whole contents of memory and I could use a debuger to analyse the file to handle the bug.
> > > The question arise because I do not want always debug rtems in the bsp.
> > >
> > > ________________________________
> > > smallphd at aliyun.com
> > > _______________________________________________
> > > devel mailing list
> > > devel at rtems.org
> > > http://lists.rtems.org/mailman/listinfo/devel
> > _______________________________________________
> > devel mailing list
> > devel at rtems.org
> > http://lists.rtems.org/mailman/listinfo/devel
> > _______________________________________________
> > devel mailing list
> > devel at rtems.org
> > http://lists.rtems.org/mailman/listinfo/devel
>
> Peter
> -----------------
> Peter Dufault
> HD Associates, Inc.      Software and System Engineering
>
> This email is delivered through the public internet using protocols subject to interception and tampering.
>


More information about the devel mailing list