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

Re: Bug#731806: debian-installer: FTBFS on sparc: genisoimage errors



Le 28/04/2014 14:15, Thomas Schmitt a écrit :
Hi,

Sébastien Bernard:
result from strcmp('\0000','\0001' is 0)
result from strcmp('\0000','\0001' is -1)
Typicaly, an endianness error.
But one in strcmp(), not in your code or the one of genisoimage.
You compare an empty string with a string that contains one
character 0x01.
This is under no endianness allowed to strcmp() == 0.
Ok, you are correct.
strcmp yields a bad result. I wasn't sure strcmp was doing byte comparaison.
However, memcmp function is ok.


-    if (strcmp(rpnt, lpnt) == 0) {
+    if (strcmp(rpnt, lpnt) == 0 && rpnt[0] == lpnt[0]) {
Are you sure that it does not miscompare other strings too ?
Basically, the fix is just to check, in case of strcmp() == 0 that the first byte of each string is the same. It's should be redundant operation if strcmp == 0 but not in the case of strcmp is misbehaving.
It's just a workaround. The correct fix is, of course, to fix the strcmp.
Another workaround would be to use :

-    if (strcmp(rpnt, lpnt) == 0) {
+    if (memcmp(rpnt, lpnt,MAX_ISONAME+1) == 0) {




I think that genisoimage with that test is
unable to generated any iso at all on big endian machines.
I cannot agree with this diagnosis.
Not having a big-endian machine at hand now, i can confirm from
my old SunOS-4-on-SPARC days that strcmp() is supposed to yield
a non-zero result with your example char arrays.

strcmp() may well be implemented by word comparisons. But then it
is the duty of the implementation to properly handle the ends of
the strings even if those are not word aligned.
Indeed, the correct fix is using strcmp. Meanwhile, the package is broken.



I filed a bug with xorriso. Waiting for the number to show up.
I will hopefully get a notification via the pkg-libburnia-devel
list. Else i will bother you.

Hum, still no answer. I'm going to fill it again.



Steve McIntyre:
We build all the release images on an amd64 machine, pettersson.d.o
Ok. That explains why there are sparc-bootable ISOs from xorriso.
I didn't imagine it could be doable.



Have a nice day :)

Thomas


Thanks for your time and dedication.

Seb


Reply to: