Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion process/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,10 @@ func parseMappings(mapsFile io.Reader) ([]Mapping, uint32, error) {
path = VdsoPathName
device = 0
inode = vdsoInode
} else if path == "" {
// This is an anonymous mapping, keep it
} else {
// Ignore mappings that are invalid, non-existent or are special pseudo-files
// Ignore other mappings that are invalid, non-existent or are special pseudo-files
continue
}
} else {
Expand Down
12 changes: 11 additions & 1 deletion process/process_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ var testMappings = `55fe82710000-55fe8273c000 r--p 00000000 fd:01 1068432
7f63c8eef000-7f63c8fdf000 r-xp 0001c000 1fd:01
7f63c8eef000-7f63c8fdf000 r-xp 0001c000 1fd.01 1075944
7f63c8eef000-7f63c8fdf000 r- 0001c000 1fd:01 1075944
7f63c8eef000 r-xp 0001c000 1fd:01 1075944`
7f63c8eef000 r-xp 0001c000 1fd:01 1075944
7f8b929f0000-7f8b92a00000 r-xp 00000000 00:00 0 `

func TestParseMappings(t *testing.T) {
mappings, numParseErrors, err := parseMappings(strings.NewReader(testMappings))
Expand Down Expand Up @@ -98,6 +99,15 @@ func TestParseMappings(t *testing.T) {
FileOffset: 114688,
Path: "/tmp/usr_lib_x86_64-linux-gnu_libopensc.so.6.0.0",
},
{
Vaddr: 0x7f8b929f0000,
Device: 0x0,
Flags: elf.PF_R + elf.PF_X,
Inode: 0,
Length: 0x10000,
FileOffset: 0,
Path: "",
},
}
assert.Equal(t, expected, mappings)
}
Expand Down