dthain/basekernel

Local variables not safe during function call

Closed this issue · 1 comments

In fs_dirent_dup (fs.c:360, temp/dup-volume branch) after the call to fs_dirent_lookup returns, all of the local pointers that have been declared in the function up to that point have changed. buffer, name, new_src, and new_dst all point to random, invalid memory addresses, where before they were all either valid references or null pointers. This leads to page access faults later in the program.

At some level, that must be to a wild pointer, buffer overrun, or similar. Suggest that you debug it by stepping through fs_dirent_lookup and examining the local variables in the previous call frame at each step. You might be able to get a "watchpoint" to do the work for you.