search for: do_basename

Displaying 1 result from an estimated 1 matches for "do_basename".

2007 Mar 24
2
Subtle bug in do_basename
Hello, I've been wondering why my no-optimization R-devel builds have been hanging during "building/updating package indices ...". I tracked it down with gdb to this line from do_basename in utils.c: while ( *(p = buf + strlen(buf) - 1) == fsp ) *p = '\0'; Now, imagine if your compiler places the variable fsp immediately before buf on the stack, and strlen(buf) is 0. Yup, you get an infinite loop because p will always be assigned the address of fsp. I'm not quite sur...