This is the mail archive of the mailing list for the elfutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Support live PIDs with deleted files

Hi Mark,

I forgot the demo:

# cd tests;make deleted;./deleted&p=$!;sleep 0.1;rm deleted;../src/stack -m -p $p
TID 7712:
#0  0x00000033472bd360 __nanosleep - /usr/lib64/
#1  0x00000033472bd214 sleep - /usr/lib64/
#2  0x00007f9aa725b6d6 libfunc - .../elfutils/tests/ (deleted)
#3  0x000000000040089f main - .../elfutils/tests/deleted (deleted)
#4  0x0000003347221b45 __libc_start_main - /usr/lib64/
#5  0x0000000000400779 _start - .../elfutils/tests/deleted (deleted)
$ gdb -q -p $p
Attaching to process 12280
.../elfutils/tests/deleted (deleted): No such file or directory.
(gdb) bt
#0  0x472bd360 in ?? ()
Cannot access memory at address 0x2cc946e8
(gdb) _

Also not completely sure if ' (deleted)' should be left there but I think it
is right as long as Linux kernel finds it right there.  I had there first:
          size_t last_file_len = strlen (last_file);
          const char deleted[] = " (deleted)";
          const size_t deleted_len = strlen (deleted);
          if (last_file_len > deleted_len
              && strcmp (&last_file[last_file_len - deleted_len], deleted) == 0)
            last_file[last_file_len - deleted_len] = 0;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]