[ccan] ciniparser test failed on PowerPC

Tim Post echo at echoreply.us
Thu Jul 16 02:59:03 EST 2009


On Wed, 2009-07-15 at 01:43 -0400, Joseph Adams wrote:
> I did a make check on CCAN with my eMac G4 (PowerPC) under Fedora 10
> today.  Everything passed except ciniparser, which failed 8/12 tests,
> the first being:
> 
> ok(itmp = ciniparser_getnsec(ini),
> 		"ciniparser_getnsec()   : %d entries in dictionary %s",
> 			itmp, ini_name);

I just love when bugs are found on platforms that I've never used (much
less tested with).

> I found out that it only seems to happen when ciniparser is compiled
> with -O3 (-fstrict-aliasing doesn't seem to change matters).  Note
> that on PowerPC, GCC defaults to char being unsigned instead of
> signed.  When I add -fsigned-char, ciniparser passes the tests.
> However, when I try -O3 -funsigned-char on my x86, ciniparser still
> passes.

My first suspect is the simple hashing, however, if that was the case
the tests should have failed prior to when they did. So, I'm kind of
scratching my head.

> Thus, from what I've gathered, ciniparser only seems to fail on
> PowerPC when -O3 and unsigned chars are enabled.  Any ideas why?  To
> test, perhaps someone should write tests specifically for
> dictionary.[ch] .

I'll try to kickstart your environment under QEMU and duplicate it. I am
sad to admit, I am a very x86 centric programmer, though I am expecting
my first beagle board any day now :)

> By the way, one crazy idea to consider would be to use my new
> stringmap module (
> http://ccan.ozlabs.org/repo/?cmd=content;path=ccan/stringmap/_info )
> instead of dictionary here :)

A lot of people using iniparser also use the dictionary and often use
the dictionary just as a dictionary, it almost became two modules. I
have been making more improvements to the code base that was forked to
ciniparser, I'll try my latest tip under QEMU and make sure that I did
not (unwittingly) fix that.

Switching from the dictionary basically means re-writing the module. I
am not the original author, I just took something that was abandoned and
useful and cleaned it up a bit.

I've also done stuff like add transactions to the dictionary, basic
tokens (include another ini file, set / unset env variables, etc) .. so
its probably high time that I update it anyway.

I'll work on it tomorrow and probably through the weekend. Thanks for
pointing it out :)

Cheers,
--Tim




More information about the ccan mailing list