Bug 63720 - powerpc64: failed to save ICC file, requested 20993800142848bytes and limit is 16Mb
Summary: powerpc64: failed to save ICC file, requested 20993800142848bytes and limit i...
Status: RESOLVED FIXED
Alias: None
Product: colord
Classification: Unclassified
Component: libcolord (show other bugs)
Version: unspecified
Hardware: PowerPC Linux (All)
: medium normal
Assignee: Richard Hughes
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-19 11:01 UTC by Dinar Valeev
Modified: 2013-04-29 13:29 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
full build log (25.22 KB, text/plain)
2013-04-19 11:01 UTC, Dinar Valeev
Details
Verbose build log (149.47 KB, text/plain)
2013-04-19 23:26 UTC, Dinar Valeev
Details
Proposed fix, works for me on OpenBSD/sparc64. (1.26 KB, patch)
2013-04-29 12:29 UTC, Stefan Sperling
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Dinar Valeev 2013-04-19 11:01:44 UTC
Created attachment 78230 [details]
full build log

colord 0.1.33 fails to build on ppc64.

The failure is:  
GEN      AdobeRGB1998.icc
failed to save ICC file, requested 20993800142848bytes and limit is 16Mb
make[3]: *** [AdobeRGB1998.icc] Error 1
Comment 1 Richard Hughes 2013-04-19 18:47:37 UTC
Can you build with V=1 and repost the log please? Thanks.
Comment 2 Dinar Valeev 2013-04-19 23:26:21 UTC
Created attachment 78257 [details]
Verbose build log
Comment 3 Landry Breuil 2013-04-25 10:41:54 UTC
0.1.33 also fails to build the same on OpenBSD/sparc64 and OpenBSD/mips64. amd64 seems fine.

colord 0.1.30 was fine.
see http://dawn.rhaalovely.net/~landry/build-failures/mips64/2013-04-17/graphics/colord.log
Comment 4 Richard Hughes 2013-04-25 11:29:43 UTC
Hmm, thanks. That's coming from cmsSaveProfileToMem -- I wonder if lcms2 has some kind of alignment error. Is there a way to detect anything fishy using tools like valgrind?

I've only got i386, x64 and armhf here, and those all seem to work fine.
Comment 5 Landry Breuil 2013-04-27 07:53:50 UTC
(In reply to comment #4)
> Hmm, thanks. That's coming from cmsSaveProfileToMem -- I wonder if lcms2 has
> some kind of alignment error. Is there a way to detect anything fishy using
> tools like valgrind?

No valgrind on OpenBSD, sorry..
Comment 6 Jasper Lievisse Adriaanse 2013-04-28 18:45:42 UTC
With the default compiler flags there are few warnings when compiling lcms2 on OpenBSD/mips64, except for these:

cc -std=gnu99 -DPACKAGE_NAME="lcms2" -DPACKAGE_TARNAME="lcms2" -DPACKAGE_VERSION="2.4" -DPACKAGE_STRING="lcms2 2.4" -DPACKAGE_BUGREPORT="" -DPACKAGE_URL="" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=".libs/" -DWORDS_BIGENDIAN=1 -DHasJPEG=1 -DHasZLIB=1 -DHasTIFF=1 -DHAVE_TIFFCONF_H=1 -I. -I../include -I../include -I/usr/local/include -O2 -pipe -MT cmstypes.lo -MD -MP -MF .deps/cmstypes.Tpo -c cmstypes.c -fPIC -DPIC -o .libs/cmstypes.o
cmstypes.c: In function 'Type_LUT8_Read':
cmstypes.c:1780: warning: comparison is always false due to limited range of data type
cmstypes.c: In function 'Type_LUT8_Write':
cmstypes.c:1908: warning: comparison is always false due to limited range of data type
cmstypes.c: In function 'Type_LUT16_Read':
cmstypes.c:2084: warning: comparison is always false due to limited range of data type
cmstypes.c: In function 'Type_LUT16_Write':
cmstypes.c:2225: warning: comparison is always false due to limited range of data type
cc -std=gnu99 -DPACKAGE_NAME="lcms2" -DPACKAGE_TARNAME="lcms2" -DPACKAGE_VERSION="2.4" -DPACKAGE_STRING="lcms2 2.4" -DPACKAGE_BUGREPORT="" -DPACKAGE_URL="" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=".libs/" -DWORDS_BIGENDIAN=1 -DHasJPEG=1 -DHasZLIB=1 -DHasTIFF=1 -DHAVE_TIFFCONF_H=1 -I. -I../include -I../include -I/usr/local/include -O2 -pipe -MT cmstypes.lo -MD -MP -MF .deps/cmstypes.Tpo -c cmstypes.c -o cmstypes.o
cmstypes.c: In function 'Type_LUT8_Read':
cmstypes.c:1780: warning: comparison is always false due to limited range of data type
cmstypes.c: In function 'Type_LUT8_Write':
cmstypes.c:1908: warning: comparison is always false due to limited range of data type
cmstypes.c: In function 'Type_LUT16_Read':
cmstypes.c:2084: warning: comparison is always false due to limited range of data type
cmstypes.c: In function 'Type_LUT16_Write':
cmstypes.c:2225: warning: comparison is always false due to limited range of data type

Also, we do have some patches against the lcms2 port in OpenBSD, they can be found here: http://www.openbsd.org/cgi-bin/cvsweb/ports/graphics/lcms2/ They're all yours :)
Comment 7 Stefan Sperling 2013-04-29 12:29:34 UTC
Created attachment 78599 [details] [review]
Proposed fix, works for me on OpenBSD/sparc64.

sizeof(size_t) is 8 on OpenBSD/sparc64, so it cannot be
written via a pointer to an unsigned 32 bit integer:

(gdb)
1274               *BytesNeeded =  cmsSaveProfileToIOhandler(hProfile, NULL);
(gdb)
1275                return TRUE;
(gdb) p *BytesNeeded
$2 = 4888
(gdb) up
#1  0x0000002926de4b84 in cd_icc_save_file (icc=0x292bad1810,                   
    file=0x2932535ce0, flags=CD_ICC_SAVE_FLAGS_NONE, cancellable=0x0,
    error=0xfffffffffffd2478) at cd-icc.c:1286
1286            ret = cmsSaveProfileToMem (priv->lcms_profile,
(gdb) p length
$3 = 20993800142848
(gdb)

My proposed fix is to change the type of 'length' to cmsUInt32Number.
Comment 8 Jasper Lievisse Adriaanse 2013-04-29 12:38:41 UTC
Thanks Stephan, this fixes colord for me on OpenBSD/sgi.
Comment 9 Dinar Valeev 2013-04-29 12:59:53 UTC
Fixes build on openSUSE/Factory ppc64 too
Comment 10 Richard Hughes 2013-04-29 13:29:49 UTC
Pushed to master, thanks all!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct.