Bug 560757 - the global variable: files in tcf_elf.c hold old inode value
Summary: the global variable: files in tcf_elf.c hold old inode value
Status: RESOLVED FIXED
Alias: None
Product: TCF
Classification: Tools
Component: Agent (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 1.7   Edit
Assignee: Project Inbox CLA
QA Contact: Eugene Tarassov CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-03 22:22 EST by wenyan xin CLA
Modified: 2021-06-25 16:23 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wenyan xin CLA 2020-03-03 22:22:30 EST
terminate one execute file when debugging it on eclipse, then modify and reload it with "Stop at main" does not work when launching the execute file for the second time.

I found when reload the execute file, the inode value updates in read_memory_map_item() function. but the "files" global variable in tcf_elf.c file still hold old inode value, then it fail in function elf_open_memory_region_file().


1250     if (file->error == NULL) {
1251         if (r->dev != 0 && file->dev != r->dev) return NULL;
1252         if (r->ino != 0 && file->ino != r->ino) return NULL;
1253         return file;
1254     }


at line 1252 the r->ino is new inode value, but the file->ino hold the old inode value.

the issue can not reproduce on Windows.
Comment 1 wenyan xin CLA 2020-03-03 23:07:37 EST
when debug a execute with "stop at main".

for the first time, it works well; for the second time, it doesn't work; for the third time, it works again; then does not work again...... so it works once every other time
Comment 2 Eugene Tarassov CLA 2020-03-09 17:54:37 EDT
I have implemented more aggressive invalidation of ELF cache.
In particular, the agent now checks for invalid cache entries when Linux process is started.

Fixed.
Thanks!