I guess it would be helpful if you could provide the profiles that caused the 
crash. I've coding a higher level OSX LCMS wrapper for 2 weeks now and did not 
have a crash.

Mark



On 10.06.2010, at 22:32, Paul Cezanne wrote:

> I'm in the middle of porting my Little CMS application to 2.0 and once I got 
> it to compile I've encountered a crash. This is under OS X, running 10.6.2, 
> with Xcode 3.2.1 as the build environment. I'm running from sources found in 
> lcms2-2.0a.tar.gz.
> 
> This is what my stack looks like:
> 
> #0    0x00049bff in cmsPipelineCheckAndRetreiveStages at cmslut.c:131 
>       // line #s are not exact since I had put some debugging code in, 
>       // I've removed the debugging code below and indicated the line
> #1    0x00030fd5 in FixWhiteMisalignment at cmsopt.c:475
> #2    0x00032622 in OptimizeByResampling at cmsopt.c:661
> #3    0x0003278c in _cmsOptimizePipeline at cmsopt.c:1620
> #4    0x000467be in cmsCreateExtendedTransform at cmsxform.c:541
> #5    0x00046b7e in cmsCreateMultiprofileTransformTHR at cmsxform.c:643
> #6    0x00046bf6 in cmsCreateTransformTHR at cmsxform.c:684
> #7    0x00046c43 in cmsCreateTransform at cmsxform.c:694
> #8    0x00016b59 in MakeColorTransform at FineEyeCMS.cpp:341
> 
> You can see the crashing line here:
> 
> cmsBool  CMSEXPORT cmsPipelineCheckAndRetreiveStages(const cmsPipeline* Lut, 
> cmsUInt32Number n, ...)
> {
>     va_list args;
>     cmsUInt32Number i;
>     cmsStage* mpe;
>     cmsStageSignature Type;
>     void** ElemPtr;
> 
>     // Make sure same number of elements
>     if (cmsPipelineStageCount(Lut) != n) return FALSE;
> 
>     va_start(args, n);
> 
>     // Iterate across asked types
>     mpe = Lut ->Elements;
>     for (i=0; i < n; i++) {
>         // Get asked type
>         Type  = va_arg(args, cmsStageSignature);      // <<------ crashes here
>         if (mpe ->Type != Type) {
> 
> 
> 
> 
> It certainly looks like the call to va_arg() is what is dying. I do have a 
> complier warning, cmsStageSignature is promoted to 'int' when passed through 
> '...' 
> 
> That may just be a red herring or it may be important.
> 
> Here is the caller:
> 
> 
> 
> // Locate the node for the white point and fix it to pure white in order to 
> avoid scum dot.
> static
> cmsBool FixWhiteMisalignment(cmsPipeline* Lut, cmsColorSpaceSignature 
> EntryColorSpace, cmsColorSpaceSignature ExitColorSpace)
> {
>     cmsUInt16Number *WhitePointIn, *WhitePointOut;
>     cmsUInt16Number  WhiteIn[cmsMAXCHANNELS], WhiteOut[cmsMAXCHANNELS], 
> ObtainedOut[cmsMAXCHANNELS];
>     cmsUInt32Number i, nOuts, nIns;
>     cmsStage *PreLin = NULL, *CLUT = NULL, *PostLin = NULL;
>     
>     if (!_cmsEndPointsBySpace(EntryColorSpace,
>         &WhitePointIn, NULL, &nIns)) return FALSE;
> 
>     if (!_cmsEndPointsBySpace(ExitColorSpace,
>         &WhitePointOut, NULL, &nOuts)) return FALSE;
> 
>     // It needs to be fixed?
> 
>     cmsPipelineEval16(WhitePointIn, ObtainedOut, Lut);
> 
>     if (WhitesAreEqual(nOuts, WhitePointOut, ObtainedOut)) return TRUE; // 
> whites already match 
>     
>     // Check if the LUT comes as Prelin, CLUT or Postlin. We allow all 
> combinations
>     if (!cmsPipelineCheckAndRetreiveStages(Lut, 3, cmsSigCurveSetElemType, 
> cmsSigCLutElemType, cmsSigCurveSetElemType, &PreLin, &CLUT, &PostLin))
>         if (!cmsPipelineCheckAndRetreiveStages(Lut, 2, 
> cmsSigCurveSetElemType, cmsSigCLutElemType, &PreLin, &CLUT))
>             if (!cmsPipelineCheckAndRetreiveStages(Lut, 2, 
> cmsSigCLutElemType, cmsSigCurveSetElemType, &CLUT, &PostLin))
>                 if (!cmsPipelineCheckAndRetreiveStages(Lut, 1, 
> cmsSigCLutElemType, &CLUT))
>                     return FALSE;
> 
> 
> 
> Lut seem to be ok, CLUT is still NULL.
> 
> I had to talk my boss into the 2.0 port and he really doesn't want me 
> debugging this so unless it is quick I'm going to have to put this aside for 
> now. But I know I'll need to look at again someday. Thank you and merci!
> 
> Paul
> 
> 
> 
> 
> 
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate 
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
> lucky parental unit.  See the prize list and enter to win: 
> http://p.sf.net/sfu/thinkgeek-promo_______________________________________________
> Lcms-user mailing list
> Lcms-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lcms-user

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user

Reply via email to