Regarding <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8230>: Eric Blake wrote: > If you compiled with debugging, then it might help to show a gdb session > of rpl_fcntl in lib/fcntl.c while stepping enough to prove the loop, as > well as a backtrace that leads to that loop, might be worthwhile.
After compiling with debugging on Solaris 9, and running on Solaris 10, I get this stack trace from the end of the endless recursion: #3 0x00019e98 in futimens (fd=0, times=0x0) at futimens.c:36 #4 0xff2b6310 in futimesat () from /lib/libc.so.1 #5 0x0001fd38 in fdutimens (fd=0, file=0x0, timespec=0x0) at utimens.c:339 #6 0x00019e98 in futimens (fd=0, times=0x0) at futimens.c:36 #7 0xff2b6310 in futimesat () from /lib/libc.so.1 #8 0x0001fd38 in fdutimens (fd=0, file=0x0, timespec=0x0) at utimens.c:339 #9 0x00019e98 in futimens (fd=0, times=0x0) at futimens.c:36 #10 0xff2b6310 in futimesat () from /lib/libc.so.1 and this one from the beginning: #0 futimens (fd=0, times=0x0) at futimens.c:36 #1 0xff2b6310 in futimesat () from /lib/libc.so.1 #2 0x0001fd38 in fdutimens (fd=0, file=0x0, timespec=0x0) at utimens.c:339 #3 0x00019e98 in futimens (fd=0, times=0x0) at futimens.c:36 #4 0x00013c6c in fdutimensat (fd=0, dir=-3041965, file=0xffbffd4a <error reading variable>, ts=0x0, atflag=0) at fdutimensat.c:48 #5 0x00012be8 in touch (file=0xffbffd4a <error reading variable>) at touch.c:168 #6 0x00013b48 in main (argc=2, argv=0xffbffc5c) at touch.c:434 So the situation is this: - On Solaris 9, futimesat() exists in libc, but futimens() doesn't. - On Solaris 10, both exist, and futimesat() invokes futimens(), but the latter is redefined in the executable with code from gnulib. In gnulib, we have invocations fdutimensat -> futimens -> fdutimens -> {futimesat,utimes} and Solaris 10 libc has an invocation futimens <-------------- futimesat There is also a second cycle: gnulib has invocations utimensat -> utimens -> futimesat and Solaris 10 libc has an invocation utimensat <------------ futimesat I propose to change gnulib so that it uses #define futimens rpl_futimens #define utimensat rpl_utimensat also on Solaris 9 (with the usual idioms for the C++ and the gnulib namespace). I have verified that when these two macro definitions are added to config.h, the 'touch' program no longer goes into an infinite recursion. Bruno -- In memoriam Eulogius of Córdoba <http://en.wikipedia.org/wiki/Eulogius_of_Córdoba>