mpiexec bug fix

Pete Wyckoff pw at osc.edu
Fri Apr 22 18:18:08 EDT 2005


kai.germaschewski at unh.edu wrote on Thu, 21 Apr 2005 20:53 -0400:
> after some non too trivial debugging, I tracked down a bug in
> mpiexec-0.79. The symptoms were a seg fault when trying to use mpiexec
> with a long command line on a Linux x86_64 system. (First thing which
> wasn't so easy to figure was that the command line length was the
> trigger).
> 
> The growstr_printf() function doesn't get the varargs handling right -- in 
> case the string size isn't long enough, more space is allocated and the 
> vnsprintf() call is repeated, however, we don't reinitialize the va_list, 
> which then causes the seg fault.

Thanks for finding and fixing this.  I'm testing and will check in
a similar patch soon.  This is not the first time I've screwed up
va_list handling, and I continue to find its behavior surprising.  I'll
stick a note on the webpage, but not bother with an emergency release
as your 5-line-long command-line arguments are pretty weird.  :)

> The fix is simple, the attached patch also fixes a small inconsistency, 
> where each string would be grown twice right away, which doesn't seem 
> intended.

I removed the growstr_grow from growstr_init_empty instead, to fit with
the initial point of "empty".  It's used in stdio.c to avoid allocating
buffer space for connections that do not produce output.  It seems to be
passing testing.  Thanks again.

		-- Pete


More information about the mpiexec mailing list