[Crash-utility] [PATCH] GDB started inside crash should not read any .gdbinit
Johan.Erlandsson at sony.com
Johan.Erlandsson at sony.com
Wed Mar 10 10:34:39 UTC 2021
> -----Original Message-----
> > -----Original Message-----
> > > I don't think we want .gdbinit files to impact functions in
> > > crash. Example of bad behavior, a .gdbinit file with:
> > > set logging on
> > >
> > > then when starting crash there is segmentation fault.
> >
> > Thanks for the report and patch.
> >
> > Reading .gdbinit is the intended functionality of crash:
> >
> > crash> define func
> > crash: restricted gdb command: define
> > "define" may only be used in a .gdbinit file or in a command file.
> > The .gdbinit file is read automatically during crash initialization.
> > ...
> >
> > and I would like to avoid changing the default behavior, so how about
> > adding --no_gdbinit option like --no_crashrc ?
Ok, so there is a need to read .gdbinit file for GDB embedded in
crash. Also it looks for the file in same default path as regular GDB.
Adding a --no_gdbinit option, then there is a possibility to avoid
segmentation fault. It could be good enough.
>
> or if "set logging on" is the only reason to drop .gdbinit, stop
> execution of "set logging on" ? "gdb set logging on" is also bad..
> It might be a bit hard to do this though.
>
I am not sure if there are other commands that cause problems.
> crash> gdb set logging on
> Copying output to gdb.txt.
> crash> ptype
> <segmentation violation in gdb>
> crash>
>
> Thanks,
> Kazu
>
> >
> > (btw, the crash mailing list accepts only emails posted by member.
> > I accepted this email but if someone replies only to the list,
> > you will miss it. Please subscribe to the list if possible.)
I was actually subscribed, but with slightly different email domain. I
think its solved now.
Thanks
Johan
> >
> > Thanks,
> > Kazu
> >
> > > ---
> > > gdb_interface.c | 1 +
> > > 1 file changed, 1 insertion(+)
> > >
> > > diff --git a/gdb_interface.c b/gdb_interface.c
> > > index f4f4dd3..cfa9f1e 100644
> > > --- a/gdb_interface.c
> > > +++ b/gdb_interface.c
> > > @@ -42,6 +42,7 @@ gdb_main_loop(int argc, char **argv)
> > > {
> > > argc = 1;
> > >
> > > + argv[argc++] = "--nx";
> > > if (pc->flags & SILENT) {
> > > if (pc->flags & READNOW)
> > > argv[argc++] = "--readnow";
> > > --
> > > 2.17.1
> > >
> > >
> > >
> > > --
> > > Crash-utility mailing list
> > > Crash-utility at redhat.com
> > > https://listman.redhat.com/mailman/listinfo/crash-utility
> >
> >
> > --
> > Crash-utility mailing list
> > Crash-utility at redhat.com
> > https://listman.redhat.com/mailman/listinfo/crash-utility
More information about the Crash-utility
mailing list