The Samba-Bugzilla – Bug 8090
full_fname out of memory error on missing file SunOS 5.8
Last modified: 2013-02-18 13:30:52 UTC
When attempting to copy a non-existent file to another file on Solaris 5.8, a out-of-memory error is shown rather than a file-not-found error.
I've attached 'truss' output showing the sequence.
$ uname -a
SunOS xxx 5.8 Generic_117350-45 sun4u sparc SUNW,Sun-Fire-V440
$ cd /tmp
$ rsync missingfile /tmp
ERROR: out of memory in full_fname [sender]
rsync error: error allocating core memory buffers (code 22) at util.c(117) [sender=3.0.7]
The relevant portion of the truss output:
29718: lstat64("missingfile", 0xFFBEE3E8) Err#2 ENOENT
29718: write(2, 0xFFBEBDD0, 43) = 43
The problem does not manifest on Solaris 10.
Created attachment 6409 [details]
truss output of problem.
full_fname() is calling asprintf(). Perhaps that is not supported on Solaris 5.8? You could try using the version supplied by lib/snprintf.c (e.g. manipulating the defines in config.h, and perhaps some function-name trickery).
If asprintf() isn't the issue, I'd suggest either using a debugger to look at the string pointers that will be passed to asprintf(), or outputting them via debug fprintf(stderr, "...") calls.
The asprintf() call in question is only 1 of 2 in all of rsync that tests the success of the function via "<= 0" rather than "< 0". Perhaps just removing the '=' in those calls would fix the issue? Is asprintf() working OK if it returns 0?
I'll assume that this is fixed unless I hear otherwise.