Unable to attach debug process after overwriting file

Source: Internet
Author: User

Repro steps:

1. Installing Nginx

2. Start the Nginx process

3. Uninstall Nginx, delete files on disk

4. Installing Nginx

5. Resulting in the inability to GDB attach PID

1. Query process start time

[Email protected]_js_011_174 home]# ps-p 181300-o Lstart

STARTED

Wed Dec 10 12:42:52 2014

2. Query file time

[Email protected]_js_011_174 home]# Stat/usr/sbin/nginx

File: '/usr/sbin/nginx '

size:1713256 blocks:3360 IO block:4096 Regular file

device:802h/2050d inode:27265 links:1

Access: (0755/-rwxr-xr-x) Uid: (0/root) Gid: (0/root)

Access:2015-01-27 16:42:42.000000000 +0800

modify:2014-12-09 13:26:43.000000000 +0800

change:2014-12-11 03:46:11.000000000 +0800

3. Although the same version of Nginx, the process started to overwrite the original file, the process startup time than the disk file last modified time, resulting in the process/pro/pid/exe soft connection and disk files are not on the number, can not directly gdb attach the process

[[Email protected]_js_011_174 home]# gdb-p 181300

GNU gdb (gdb) Red Hat Enterprise Linux (7.2-64.el6_5.2)

Copyright (C) Free Software Foundation, Inc.

License gplv3+: GNU GPL version 3 or later

This was free software:you was free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law. Type "Show copying"

and "Show warranty" for details.

This GDB is configured as "X86_64-redhat-linux-gnu".

For bugs reporting instructions, please see:

Attaching to process 181300

/usr/sbin/nginx (Deleted): No such file or directory.

(GDB) bt

#0 0x0050e7ea in?? ()

Cannot access memory at address 0x8a70ff24

4. Install the corresponding version of Debuginfo

5. Use Gdb/proc/181300/exe 181300 to successfully attach the process

Unable to attach debug process after overwriting file

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.