Re: Interpreting program core dump in mdb



Noob wrote:
Mr. Uh Clem wrote:

# mdb prog core
Loading modules: [ libc.so.1 ld.so.1 ]
> ::stack
strncpy+0x5d0(20, 7182f4, 1b, 726f6f74, 0, 20)
secure+0x1b8(2e4088, b1978, c6068, 1f, 717298, 0)
process_request+0x41c(2e7d8, 1, c60e4, 1, 5750bc, 0)
open_socket+0x310(0, c8bf0, 5, 7efefeff, 81010100, ffbff9bc)
main+0x664(1, ffbffc1c, ffbffc24, c6000, c80fc, 3)
_start+0x108(0, 0, 0, 0, 0, 0)


I've googled up countless articles telling me that ::stack gets a
stack dump, but have yet to find one which tells me what the
values in the display **ARE**.


char user_name[USER_LENGTH + 1]; /* global in .c containing secure */
...
secure(host)
char *host;
{
...
struct passwd *pw;
...

pw = getpwuid(getuid());
if (pw != NULL)
strncpy(user_name, pw->pw_name, sizeof(user_name)-1);

Is it possible for pw->pw_name to be NULL?

I suspect I could determine that if I could interpret the stack frame.
That 72ff6f74 ('root') occurs in the stack dump is real suspicious.
USER_LENGTH, btw, is 31.

--
Clem
"If you push something hard enough, it will fall over."
- Fudd's first law of opposition
.


Quantcast