Hello!
I need help with examining of bug # 3462452. Problem happens in
libfm. Exactly what happens:
1) libfm detects that bookmark isn't directory but file;
2) it says:
** (pcmanfm:21245): DEBUG: FmJob error: The specified directory is not valid
3) it does not change directory and tries to free invalid object it got:
#12 0x00637d78 in fm_dir_list_job_finalize (object=0x9e826c0) at
job/fm-dir-list-job.c:91
91 fm_file_info_unref(self->dir_fi);
#10 0x00630f8f in fm_file_info_unref (fi=0xb6b18f88) at base/fm-file-info.c:297
297 fm_file_info_clear( fi );
#9 0x00630f2c in fm_file_info_clear (fi=0xb6b18f88) at base/fm-file-info.c:261
261 g_free(fi->disp_name);
where:
(gdb) p *fi
$2 = {path = 0x0, mode = 0, {fs_id = 0x807 <Address 0x807 out of bounds>, dev =
2055}, uid = 500,
gid = 70, size = 0, mtime = 1336601702, atime = 1337631971, blksize = 0,
blocks = 0,
disp_name = 0xad303e11 "a.txt", collate_key = 0x0, disp_size = 0x0,
disp_mtime = 0x0,
type = 0x0, icon = 0x0, target = 0x0, n_ref = 0}
but fi->disp_name seems to be out of scope so program aborted (SIGABRT):
*** glibc detected *** pcmanfm: free(): invalid pointer: 0xad303e11 ***
I think the problem is in two questionable places:
src/base/fm-file-info.c:91:
if( strcmp(tmp, fi->path->name) == 0 )
fi->disp_name = fi->path->name;
else
fi->disp_name = g_strdup(tmp);
src/base/fm-file-info.c:330:
if(src->disp_name == src->path->name)
fi->disp_name = src->disp_name;
else
fi->disp_name = g_strdup(src->disp_name);
What I cannot find out and want help - why it is just set? I think it
should be g_strdup() unconditionally because it will be freed later. Or
have I missed the point? Anyway one of those places makes that crash so
should be fixed.
With best wishes.
Andriy.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Pcmanfm-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pcmanfm-develop