Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Apr 2021 17:06:54 -0300
From:      =?utf-8?Q?Lucas_Nali_de_Magalh=C3=A3es?= <rollingbits@gmail.com>
To:        freebsd-hackers@freebsd.org
Subject:   Re: Debugging signal 11
Message-ID:  <D25406A0-FBDB-48FA-94B2-0367A0527797@gmail.com>
In-Reply-To: <9d3b5c0cc7051f410fd04ff9ffba8aa0b5b32167.camel@freebsd.org>
References:  <9d3b5c0cc7051f410fd04ff9ffba8aa0b5b32167.camel@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Apr 18, 2021, at 4:18 PM, Ian Lepore <ian@freebsd.org> wrote:
>=20
> =EF=BB=BFOn Sun, 2021-04-18 at 15:53 -0300, Lucas Nali de Magalh=C3=A3es w=
rote:
>> This also isn't the usual. Debugging a running process is possible but
>> the process you used is the wrong one. Debugging init, OTOH, is a
>> completely different story: init is the first process and is the most
>> important process of any unix. The actual command varies from
>> debugger to debugger but in gdb, "attach pid"  may do the trick for
>> you. You will need to be extra cautious because of you are aiming init.
>> Ideally, init is the process supposed to catch the signals and keep
>> the system running. So a break into it may cause your system to crash.
>=20
> Given that it is init that is segfaulting, how to you propose that the
> OP lauch gdb in order to do an attach to init?  In other words: there
> is a reason the OP is trying to use the kernel debugger to examine
> what's going on here.

First the OP was able to modify init. Then it was asked the command
to do a stack trace. Thus the OP clearly hasn't the full knowledge of
the procedure and the risks. Besides this, kgdb is based on gdb. I
thought they should know.

--=20
rollingbits =E2=80=94 =F0=9F=93=A7 rollingbits@icloud.com =F0=9F=93=A7 rolli=
ngbits@gmail.com =F0=9F=93=A7 rollingbits@yahoo.com =F0=9F=93=A7 rollingbits=
@terra.com.br =F0=9F=93=A7 rollingbits@globo.com




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D25406A0-FBDB-48FA-94B2-0367A0527797>