[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

syslog failure on Itanium (LP64 problem?)



This test (test 86) from syslog core dumps
on Itanium. This looks like a dubious test,
as the SUS tells me:

"The format can contain either numbered argument
specifications (that is %n$ or *m$), or unnumbered
argument specifications (that is % or *), but
normally not both.  ...  The results of mixing
numbered and unnumbred argument specifications in 
a format string are undefined.

Note that the format string beloe contains three
numbered specifications, followed by '%d', which
is unnumbered.  When I change the last specifier
to %4$d the test runs without core dumping.
However, it does not seem to do what one might
expect - I'm reading intent as:
1. Print arg 1 as a string
2. Save bytes transferred so far into arg3
3. Print arg 2 as a string
4. Print arg 4 as a string

After the "fix", the output is zero for arg4
(I verified the same thing on ia32).

Does this look like a valid bug?


static void
sub_test86(int type, char **result)
{
	char *s1 = "hello";
	char *s2 = "world";
	int	n1 = 0;

	if (type == CALL_SPRINTF)
	{
		(void) sprintf(*result, "%1$s%3$n %2$s %d", s1, s2, &n1,
n1);
	}

	if (type == CALL_SYSLOG)
	{
		syslog(LOG_DEBUG, "%1$s%3$n %2$s %d", s1, s2, &n1, n1);
	}

	return;
}




-- 
To UNSUBSCRIBE, email to lsb-test-request@lists.linuxbase.org
with subject of "unsubscribe". Trouble? Email listmaster@lists.linuxbase.org



Reply to: