Re: [Lcms-user] Release candidate of lcms2-2.6 now available
On 18 February 2014 17:00, marti.ma...@littlecms.com wrote: Another release candidate, this time with the pthreads dependency. Built fine on armv7hl, x86_64, i686 and passes the colord test suite, thanks! Richard -- Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk ___ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user
Re: [Lcms-user] Release candidate of lcms2-2.6 now available
Hello Richard, Excellent! thanks for doing the testing. Best regards Marti Quoting Richard Hughes hughsi...@gmail.com: On 18 February 2014 17:00, marti.ma...@littlecms.com wrote: Another release candidate, this time with the pthreads dependency. Built fine on armv7hl, x86_64, i686 and passes the colord test suite, thanks! Richard -- Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk ___ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user
Re: [Lcms-user] Release candidate of lcms2-2.6 now available
Hello, Another release candidate, this time with the pthreads dependency. The level of testing on this one is notably increased. Hopefully it would take very few more to get this powerful but difficult release up and working. http://www.littlecms.com/lcms2-2.6rc3.tar.gz GIT also can be used. Best regards Marti Maria The Little CMS project http://www.littlecms.com -- Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk ___ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user
Re: [Lcms-user] Release candidate of lcms2-2.6 now available
Am 13.02.2014 23:05, schrieb Graeme Gill: marti.ma...@littlecms.com wrote: Yep, that is how actually works, and this is the source of all pain. What I really need is a sort function that given a pointer, would guess if this points to a cmsContext internal structure or to used supplied data. If the client code has to be changed anyway to use the new cmsContext (ie. to get one and then supply it to each function call), then another approach would be to use different function names for the cmsContext, ie. cmsCreate_sRGBProfileLCX() etc., so that the _THR functions can remain unchanged, and internally there is then no doubt about what sort of context it is. 1+ Escaping the incompatible APIs appears to me as the best suggestion so far. _THR functions can be deprecated and a new function set can be introduced at the same release. THR would be removed on the next major. The changes on user side would not involve more work on making them ready for the new APIs. But it would satisfy old code demands, which makes sense to many users. kind regards Kai-Uwe -- Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk ___ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user
Re: [Lcms-user] Release candidate of lcms2-2.6 now available
On 14 February 2014 10:14, Kai-Uwe Behrmann k...@gmx.de wrote: Escaping the incompatible APIs appears to me as the best suggestion so far. I don't think it's required: commit 3e31c44f4cd6c44280cd18708cc2223dcddf670a Author: Marti Maria i...@littlecms.com Date: Fri Feb 14 09:44:26 2014 +0100 Fixed context guessing This fixes all the problems I had with the pre-release on old (using a private address) and new (using cmsContext) versions of colord. The libcolord tests pass, so I'm happy again :) Marti, if you can roll second pre-release tarball then I'll put it in fedora rawhide for some further real-world testing. Thanks. Richard. -- Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk ___ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user
Re: [Lcms-user] Release candidate of lcms2-2.6 now available
Hello everybody, Thanks the feedback I got from you, I have spotted some issues in release candidate 0, and tried to fix them. As a result, we have now release candidate 1, which can be downloaded from GIT or by using this tarball: http://www.littlecms.com/lcms2-2.6rc1.tar.gz - In this candidate, the ABI compatibility is not broken, so there is no need of a .soname bump. Release will be a minor 2.6 I think a major version bump would be a big issue for most packagers, and tried to avoid that. Yet existing applications using lcms2 should compile and work with absolutely no modifications. - System keeps track of issued contexts, so there is no longer any guessing of pointers or magic numbers. This approach is more robust and fully portable. - Unfortunately this makes cmsCreateContext() not thread-safe, I am searching for solutions to this issue. Anyway, that would not be a problem for yet existing apps, and neither for new apps that are aware of this limitation. Otherwise the code has been tested on several linux, Mac, Big-endian PPC, Several windows and cygwin. All are found to work fine. I wish to thank you again for all your aid in finding the issues the previous candidate had. Best regards Marti Maria The Little CMS project http://www.littlecms.com -- Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk ___ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user
Re: [Lcms-user] Release candidate of lcms2-2.6 now available
On 14 February 2014 11:22, marti.ma...@littlecms.com wrote: - Unfortunately this makes cmsCreateContext() not thread-safe Can't you just wrap it in a mutex? I wish to thank you again for all your aid in finding the issues the previous candidate had. Thanks for fixing them :) I've built the pre-release for rawhide[1] for wider testing. Richard. [1] http://koji.fedoraproject.org/koji/taskinfo?taskID=6530213 -- Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk ___ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user
Re: [Lcms-user] Release candidate of lcms2-2.6 now available
Quoting Richard Hughes hughsi...@gmail.com: On 14 February 2014 11:22, marti.ma...@littlecms.com wrote: - Unfortunately this makes cmsCreateContext() not thread-safe Can't you just wrap it in a mutex? This is actually my big headache. To do that, I need to add a pthreads dependency. Quite probably this is the best option at all. And pthreads will be used as a default for read/write profile locking, which may be overriden by locking plug-in. Any thoughts? Marti -- Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk ___ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user
Re: [Lcms-user] Release candidate of lcms2-2.6 now available
On 14/02/2014 10:59, Richard Hughes wrote: On 14 February 2014 11:58, marti.ma...@littlecms.com wrote: This is actually my big headache. To do that, I need to add a pthreads dependency. Is that a problem? pthreads is available everywhere isn't it? Well, not on Windows. But presumably we can have some #ifdeffery that uses windows equivalents on appropriate platforms. Quite probably this is the best option at all. And pthreads will be used as a default for read/write profile locking, which may be overriden by locking plug-in. We'd have to be sure to use the 'inbuilt' locking for the context in all cases though, and use the plugin stuff for everything else. Robin -- Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk ___ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user
Re: [Lcms-user] Release candidate of lcms2-2.6 now available
On Fri, 14 Feb 2014, marti.ma...@littlecms.com wrote: This is actually my big headache. To do that, I need to add a pthreads dependency. Quite probably this is the best option at all. And pthreads will be used as a default for read/write profile locking, which may be overriden by locking plug-in. Any thoughts? GraphicsMagick adds a pthreads dependency by default so we have a lot of experience with this. It is good to be aware that libtool will then impact you by adding whatever option enables pthreads in the compiler to its installed .la file so the option is replayed when software depending on the library is compiled. Systems with multiple compilers might not all use the same options to enable pthreads and so you might hear some new complaints due to unexpected compilation failure of dependent software. I encounter this issue on Solaris between GCC and the Sun/Oracle C compiler. There do exist systems which have different threading modes and pthreads is one of several threading modes. SGI's defunct IRIX is a good example of this. It is possible (I am not completely sure) that the GO language implementation has a threading model which is funky with posix mutexes because it uses a multi-tier threading strategy mixing both green and native threading models. GO language code can link with C language libraries. By depending on pthreads one is hoping that the pthread mutex will work with whatever threading model is actually used (i.e. everything funnels down to a consisting locking implementation). This is a safe assumption on most systems. Bob -- Bob Friesenhahn bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer,http://www.GraphicsMagick.org/ -- Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk ___ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user
Re: [Lcms-user] Release candidate of lcms2-2.6 now available
On 13 February 2014 00:01, marti.ma...@littlecms.com wrote: Please feel free to download and check the CMM in your application I've run the colord test suite against the new lcms2. There are a lot of compiler warnings now like this: In file included from cd-create-profile.c:27:0: /usr/include/lcms2.h:1568:14: note: expected ‘cmsContext’ but argument is of type ‘struct CdIcc *’ CMSAPI cmsHPROFILE CMSEXPORT cmsCreate_sRGBProfileTHR(cmsContext ContextID); This is the backtrace, which isn't always the same: /colord/icc{clear}: Program received signal SIGSEGV, Segmentation fault. __GI___libc_free (mem=0x140) at malloc.c:2892 2892 if (chunk_is_mmapped(p)) /* release mmapped memory. */ Missing separate debuginfos, use: debuginfo-install gvfs-1.18.3-2.fc20.x86_64 lcms2-2.6-999.60.20140213git.fc20.x86_64 libbluray-0.5.0-2.fc20.x86_64 libffi-3.0.13-5.fc20.x86_64 libgcc-4.8.2-7.fc20.x86_64 libselinux-2.2.1-6.fc20.x86_64 pcre-8.33-4.fc20.x86_64 systemd-libs-208-9.fc20.x86_64 xz-libs-5.1.2-6alpha.fc20.x86_64 (gdb) bt #0 __GI___libc_free (mem=0x30) at malloc.c:2892 #1 0x7724473b in cmsMLUfree (mlu=0x65e3a0) at cmsnamed.c:286 #2 0x77231e43 in cmsCloseProfile (hProfile=0x62c810) at cmsio0.c:1393 #3 0x77bc052c in cd_icc_finalize (object=0x63b380) at cd-icc.c:4404 #4 0x76a76fcb in g_object_unref (_object=0x63b380) at gobject.c:3197 #5 0x0040cf22 in colord_icc_clear_func () at cd-test-private.c:1168 #6 0x7659f5e1 in test_case_run (tc=0x6242a0) at gtestutils.c:2067 #11 0x00405acc in main (argc=1, argv=0x7fffdd88) at cd-test-private.c:2091 This test case is creating model mluc tag in a simple V4 profile. I'm slightly confused about the new context work after reading the docs. This program fails: //gcc -o test test.c `pkg-config --cflags --libs lcms2` ./test #include lcms2.h #include stdlib.h int main(int argc, char *argv[]) { cmsHPROFILE p; void *myuserdata = 0x12345; p = cmsCreate_sRGBProfileTHR (myuserdata); cmsCloseProfile(p); return 0; } i.e. any program that's been using the _THR() functions with their own static userdata rather than using the new cmsCreateContext() is going to explode with: Program received signal SIGSEGV, Segmentation fault. _cmsGetContext (ContextID=0x12345) at cmsplugin.c:673 673if (ctx -Magic != cmsContextMagicNumber) i.e. you're trying to dereference ctx when it's not a memory location. The same thing happens when trying to read Magic from a small struct (which all of the GObject programs typically are): typedef struct { int test; } teststruct; int main(int argc, char *argv[]) { cmsHPROFILE p; teststruct ctx; p = cmsCreate_sRGBProfileTHR (ctx); cmsCloseProfile(p); return 0; } gives 43 *different* versions of this in valgrind: ==14270== Conditional jump or move depends on uninitialised value(s) ==14270==at 0x4E4F02F: _cmsGetContext (cmsplugin.c:673) ==14270==by 0x4E4F0B0: _cmsContextGetClientChunk (cmsplugin.c:694) ==14270==by 0x4E40AEA: _cmsFree (cmserr.c:286) ==14270==by 0x4E48EAB: cmsCloseProfile (cmsio0.c:1406) ==14270==by 0x40072A: main (in /home/hughsie/Code/colord/lib/colord/test) I'm _really_not_happy_ with the guessing in _cmsGetContext as it's going to blow-up in hard-to-detect ways. CMS_CONTEXT_IN_LEGACY_MODE doesn't work in this case as it's only affecting the compile warning, rather than the underlying ABI issue. I guess the new functioanlity could be worked around without the soname bump if you could compile the *library* with CMS_CONTEXT_IN_LEGACY_MODE (rather than the user program) although I was slightly surprised at the need to define a new #ifdef to have the old behaviour. In Fedora I guess we'd have to just do -DCMS_CONTEXT_IN_LEGACY_MODE=1 when compiling lcms2, and patch '#define CMS_CONTEXT_IN_LEGACY_MODE' into the top of lcms2.h which probably makes the ghostscript guys sad. The alternative means we anything using _THR() crashes and when valgrinding we get thousands of invalid reads from deep in the lcms2 library. What might be a better thing to do is have a global function cmsSetContextMode() which enables the new functionality at runtime *if* the project has ported to the new cmsCreateContext() code. The alternative is you have to bump the soname. Sorry to be grumpy. Richard. -- Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk ___ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user
Re: [Lcms-user] Release candidate of lcms2-2.6 now available
On 13/02/2014 10:18, Richard Hughes wrote: On 13 February 2014 00:01, marti.ma...@littlecms.com wrote: I've run the colord test suite against the new lcms2. There are a lot of compiler warnings now like this: In file included from cd-create-profile.c:27:0: /usr/include/lcms2.h:1568:14: note: expected ‘cmsContext’ but argument is of type ‘struct CdIcc *’ CMSAPI cmsHPROFILE CMSEXPORT cmsCreate_sRGBProfileTHR(cmsContext ContextID); That's because the meaning of the 'cmsContext' has now changed in this new version. Previously cmsContext was 'any opaque void * value that the caller wanted to provide'. Now the cmsContext is a pointer to a (private) library defined structure that holds the library state. One element of this structure is a userdata pointer that is 'any opaque void * value that the caller wanted to provide'. This change in behaviour is unfortunate but is necessary to solve some nasty issues with threading and/or with multiple callers to the same shared library. This means that any code that uses the old THR functions will need to be updated. The update is not hard, but I appreciate this isn't much solace to people whose code now fails. The only thing I can say is that if you were using the old THR functions in a shared library build, then there was every possibility that it'd end up crashing anyway due to interference between callers. To mitigate against this, 2 things have been done. Firstly, people can build the library with CMS_CONTEXT_IN_LEGACY_MODE and they will get the old behaviour. Hopefully people should only do this for static library builds. Secondly, for people who happen to be using small positive integers for the cmsContext value, Marti has a horrible hack/clever piece of engineering in there that recognises this case and works around it. What might be a better thing to do is have a global function cmsSetContextMode() which enables the new functionality at runtime *if* the project has ported to the new cmsCreateContext() code. The alternative is you have to bump the soname. Sorry to be grumpy. A global function to set a global state would require a global variable. This would entirely break the whole intention of this work which is enable multiple callers to be able to use the same library independently. If you're resigning yourself to adding a new call to the code, you might as well just change to the newer context handling. A .soname bump might be nice though, yes. That's Martis call. Robin -- Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk ___ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user
Re: [Lcms-user] Release candidate of lcms2-2.6 now available
On 13 February 2014 11:36, Robin Watts robin.wa...@artifex.com wrote: Secondly, for people who happen to be using small positive integers for the cmsContext value, Marti has a horrible hack/clever piece of engineering in there that recognises this case and works around it. Sure, and I fully agree the number of people going to be using integer values in the callback should be very small, but this does not fix the problem with passing the address of a small struct and valgrind issuing hundreds of warnings about uninitialised values. At the moment if you ship lcms2 as an update in fedora, colord crashes at boot and sends an automated abrt bug to the bugtracker against the colord component. As the backtraces are similar, but not the same, the bugs won't be auto-duped. I'm sure colord isn't the only app that using the _THR() functions for it's own purposes. I'm scrambling to convert the colord codebase to the new API so I can issue an unplanned-update along with the lcms2 update. If you're resigning yourself to adding a new call to the code, you might as well just change to the newer context handling. Well, my point was that without this new runtime method we'd use the old ABI, although I agree what you say about the global variable thing. If Marti does go with an API bump, it might be a good time to get rid of the cruft, i.e. remove cmsOpenProfileFromMemTHR and just have a cmsOpenProfileFromMem() with a cmsContext parameter. If there's no API bump to be done, we need to communicate this much better to lcms2 consumers and give them time to test against the new ABI. FWIW, a soname bump would be a huge pain for the distros as there is a ton of stuff all depending on lcms2 that needs rebuilding and testing, but possibly preferable than apps and services randomly crashing. Richard -- Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk ___ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user
Re: [Lcms-user] Release candidate of lcms2-2.6 now available
Hi Richard, Much has been discussed about this new functionality and the impact it will surely have on yet existing apps using THR functions. The main drivers I used to take the decision were: 1) Any client using THR functions and the lib as shared object is basically broken. if a client sets a listener or plug-in, it got events from any other clients of the .so, with obviously unexpected user data format. This causes segfaults. 2) Anybody using the library as static can use the flag to revert to old behavior. Otherwise the compiler issues a warning on places where things have changed. 3) Some cases (small integers, pointers to structures) are detected automatically. Those cases were NOT WORKING previously because rule 1) and now are fixed. So basically this is breaking the ABI compatibility, but the cases where ABI is broken were not working anyway. So hence the decision of fixing the whole thing at the expense of ABI compatibility. I agree a .soname bump should be required here. I can even do a major version bump to lcms2-3.0, your feedback would be appreciated. Regards Marti -- Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk ___ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user
Re: [Lcms-user] Release candidate of lcms2-2.6 now available
On 13 February 2014 12:35, marti.ma...@littlecms.com wrote: 1) Any client using THR functions and the lib as shared object is basically broken. if a client sets a listener or plug-in, it got events from any other clients of the .so, with obviously unexpected user data format. This causes segfaults. Right, and in the case of the ghostscript guys that makes complete sense. If you're a single threaded application or command line program using lcms that argument breaks down somewhat. 3) Some cases (small integers, pointers to structures) are detected automatically. Those cases were NOT WORKING previously because rule 1) and now are fixed. They might be detected automatically in most cases, but if you try to run valgrind on any program using the new version of lcms you get: ==2376== More than 1000 total errors detected. I'm not reporting any more. ==2376== Final error counts will be inaccurate. Go fix your program! So basically this is breaking the ABI compatibility, but the cases where ABI is broken were not working anyway. So hence the decision of fixing the whole thing at the expense of ABI compatibility. Okay, I agree. But you can't pretend you're not breaking ABI by fixing bugs in the API. The argument this was broken for some users doesn't mean you can break it for most users. I agree a .soname bump should be required here. I can even do a major version bump to lcms2-3.0, your feedback would be appreciated. Well, you *have* to bump LT_REVISION and I would argue that LT_CURRENT is required as well. Of course, if you bump LT_CURRENT then world and dog will want liblcms2.so.3 parallel installable with liblcms2.so.2. It's not that hard to package the two versions in parallel. Whether it should be called lcms3 is another issue altogether. Richard. -- Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk ___ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user
Re: [Lcms-user] Release candidate of lcms2-2.6 now available
On 13 February 2014 13:22, Robin Watts robin.wa...@artifex.com wrote: Personally, I have to say that I dislike the 'magically detect small integer values' hack. I'd vote for ditching it if that's the thing that's causing problems. I think you nailed it with hack. Possibly a stupid question, but could we build the current library twice? Once with the CMS_CONTEXT_IN_LEGACY_MODE to give liblcms2.so.2 and once without to give liblcms2.so.3 ? Sure, we could do that, although a configure --enable-new-style-ctx that spits out the correct name would certainly be helpful. Richard. -- Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk ___ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user
Re: [Lcms-user] Release candidate of lcms2-2.6 now available
On 13 February 2014 00:01, marti.ma...@littlecms.com wrote: if something does not work, let us know Another regression: //gcc -o test test.c `pkg-config --cflags --libs lcms2` ./test #include lcms2.h #include stdlib.h #include assert.h int main(int argc, char *argv[]) { cmsHPROFILE p; cmsMLU *mlu; int ret; p = cmsCreate_sRGBProfileTHR(NULL); /* set value */ mlu = cmsMLUalloc (NULL, 1); ret = cmsMLUsetASCII (mlu, en, US, bar); assert (ret); ret = cmsWriteTag (p, cmsSigDeviceMfgDescTag, mlu); assert (ret); cmsMLUfree (mlu); /* remove the tag -- NOTE: this fails, it probably should succeed */ ret = cmsWriteTag (p, cmsSigDeviceMfgDescTag, NULL); //assert (ret); /* THIS EXPLODES */ cmsCloseProfile(p); return 0; } Using 2.5 I get a profile without a cmsSigDeviceMfgDescTag, using 2.6 I get: double free or corruption; bt looks like this: #2 0x77839d04 in __libc_message (do_abort=do_abort@entry=2, fmt=fmt@entry=0x77940528 *** Error in `%s': %s: 0x%s ***\n) at ../sysdeps/posix/libc_fatal.c:175 #3 0x77840ff8 in malloc_printerr (ptr=optimized out, str=0x77940600 double free or corruption (!prev), action=3) at malloc.c:4930 #4 _int_free (av=0x77b7c760 main_arena, p=optimized out, have_lock=0) at malloc.c:3782 #5 0x77bad72a in cmsMLUfree (mlu=0x605100) at cmsnamed.c:285 #6 0x77b9ae43 in cmsCloseProfile (hProfile=0x6041b0) at cmsio0.c:1393 #7 0x00400965 in main () Note. If I'm not supposed to use cmsWriteTag(NULL) to remove a tag, then I need some other way to do this. And if cmsWriteTag() is supposed to fail, it should probably not make the cmsCloseProfile() explode... Richard. -- Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk ___ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user
Re: [Lcms-user] Release candidate of lcms2-2.6 now available
Another regression: [...] Note. If I'm not supposed to use cmsWriteTag(NULL) to remove a tag, then I need some other way to do this. And if cmsWriteTag() is supposed to fail, it should probably not make the cmsCloseProfile() explode... A genuine bug, thank you. On 2.6 erasing tags by using NULL *is* supported and documented (though you discovered to be buggy) Regards Marti -- Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk ___ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user
Re: [Lcms-user] Release candidate of lcms2-2.6 now available
On 13 February 2014 13:29, marti.ma...@littlecms.com wrote: Valgrid complains and I'm concerned about that, but in some cases it keeps working. Fixing the cases it does not work is actually my first headache. So, I can certainly port the libcolord stuff to using the new context stuff in two weeks, and I can also do a release the same time you do the 2.6 release. What I think might be a good idea is a function to get the *runtime* (rather than the compile time) version of lcms. In that way I can check for 0,2,6 at runtime and just abort, rather than crash in strange ways. Richard. -- Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk ___ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user
Re: [Lcms-user] Release candidate of lcms2-2.6 now available
On Thu, 13 Feb 2014, Robin Watts wrote: That's because the meaning of the 'cmsContext' has now changed in this new version. Previously cmsContext was 'any opaque void * value that the caller wanted to provide'. Now the cmsContext is a pointer to a (private) library defined structure that holds the library state. One element of this structure is a userdata pointer that is 'any opaque void * value that the caller wanted to provide'. I just woke up to this discussion thread. A quick look at GraphicsMagick code causes me to believe that this clearly causes the new version not to work with GraphicsMagick since GraphicsMagick is using this argument to keep track of its own context data. I don't have time this morning to study the issue in any depth to evaluate the full impact. Bob -- Bob Friesenhahn bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer,http://www.GraphicsMagick.org/ -- Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk ___ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user
Re: [Lcms-user] Release candidate of lcms2-2.6 now available
On 13 February 2014 15:18, marti.ma...@littlecms.com wrote: A genuine bug, thank you. On 2.6 erasing tags by using NULL *is* supported and documented (though you discovered to be buggy) Confirmed fixed in git, thanks. Richard -- Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk ___ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user
Re: [Lcms-user] Release candidate of lcms2-2.6 now available
Quoting Bob Friesenhahn bfrie...@simple.dallas.tx.us: I strongly recommend against releasing this new version of the library until it is proven that existing software can be successfully adapted to it. Bob, this is exactly the point of release candidates. If we found it to break applications, then this should be fixed somehow before releasing the code. Still, the issue continues to be in how to differentiate cmsContext from user data. If we could fix that, then compatibility would be kept. Regards Marti -- Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk ___ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user
Re: [Lcms-user] Release candidate of lcms2-2.6 now available
On Thu, 13 Feb 2014, marti.ma...@littlecms.com wrote: Quoting Bob Friesenhahn bfrie...@simple.dallas.tx.us: I strongly recommend against releasing this new version of the library until it is proven that existing software can be successfully adapted to it. Bob, this is exactly the point of release candidates. If we found it to break applications, then this should be fixed somehow before releasing the code. Yes. It seems that more than two weeks will be necessary in order to certify this release candidate and additional release candidates will be required. Usually release candidates are assumed to be a drop-in for previous releases and the release candidate is just a formality. Bob -- Bob Friesenhahn bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer,http://www.GraphicsMagick.org/ -- Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk ___ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user
Re: [Lcms-user] Release candidate of lcms2-2.6 now available
Am 13.02.2014 17:51, schrieb marti.ma...@littlecms.com: Still, the issue continues to be in how to differentiate cmsContext from user data. If we could fix that, then compatibility would be kept. Just an idea: typedef struct { const char type_[8]; // more members here void * user_data; } cmsContext; cmsContext c = {lcms2.6, NULL}; cmsContext * cmsTakeContext( cmsStruct ptr ) { cmsContext * c = ptr-context; if(sizeof(*c) 8 memcmp(c-type_, lcms2.6, 8) == 0) return c-user_data; else return c; } The above example comes with some computational cost. But you can skip this check with lcms-3.0 in the future. Alternatively a enum might be fine too. Obviously there remains a risk that a four byte type identifier might fit by accident to the four bytes enum, and thus above function returns a wrong pointer. kind regards Kai-Uwe -- Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk ___ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user
Re: [Lcms-user] Release candidate of lcms2-2.6 now available
Quoting Kai-Uwe Behrmann k...@gmx.de: Am 13.02.2014 17:51, schrieb marti.ma...@littlecms.com: Still, the issue continues to be in how to differentiate cmsContext from user data. If we could fix that, then compatibility would be kept. Just an idea: Yep, that is how actually works, and this is the source of all pain. What I really need is a sort function that given a pointer, would guess if this points to a cmsContext internal structure or to used supplied data. My first idea was to use a bit in the very upper part of the pointer, but this is not portable and would need an integral type wider than a pointer. if (ptr 0x1) { Context = ptr !0x1; // this is a context usr = NULL; } else { Context = NULL; usr = ptr; // A user pointer. } I'm right now open to other ideas. Regards Marti -- Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk ___ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user
Re: [Lcms-user] Release candidate of lcms2-2.6 now available
Quoting Bob Friesenhahn bfrie...@simple.dallas.tx.us: These descriptions of static vs shared libraries don't make any sense to me. On the planet I live on, programs using a shared library always get private data and there is no sharing of data between programs due to using a shared library. There are platforms (e.g. Microsoft Windows) which support DLLs which are really multi-threaded servers (shared memory space) under the guise of a library but these are not normal DLLs and need to be registered with the OS as a sort of server. Obviously you are right and my description of the issue was wrong, actually the reports I got was about an application using both lcms2 and another library which was using lcms2 as well. The app did set its own memory management via a plug-in, but after calling the second library (which also set its own memory management) the callbacks pointed to the second library mem manager and segfaulted badly because all libs were deployed as .so and the callbacks were pointing to hyperspace. Sorry about the confusion. Regards Marti -- Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk ___ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user
Re: [Lcms-user] Release candidate of lcms2-2.6 now available
On Thu, 13 Feb 2014, marti.ma...@littlecms.com wrote: Obviously you are right and my description of the issue was wrong, actually the reports I got was about an application using both lcms2 and another library which was using lcms2 as well. The app did set its own memory management via a plug-in, but after calling the second library (which also set its own memory management) the callbacks pointed to the second library mem manager and segfaulted badly because all libs were deployed as .so and the callbacks were pointing to hyperspace. The IJG JPEG (starting with release 8 I think) and TIFF libraries added link-time symbol versioning to help avoid such problems. With symbol versioning, each dependent app/library gets the function/variable version compatible with the version it was linked with, even if there are several versions of the library loaded into the application. This feature works under Linux, FreeBSD, and perhaps some other OSs. Perhaps lcms should consider doing this as well, especially if it changes the major number of the library. Bob -- Bob Friesenhahn bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer,http://www.GraphicsMagick.org/ -- Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk ___ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user
Re: [Lcms-user] Release candidate of lcms2-2.6 now available
On 13 February 2014 18:30, marti.ma...@littlecms.com wrote: if (ptr 0x1) { I'm right now open to other ideas. Why not do the opposite? i.e. use the *first* bit rather than the last -- malloc seems to always align the returned addresses to 32 bits on my 64 bit platform. If the ctx 0x01 0 then it's a cmsContext, otherwise it's a constant or struct address. Richard -- Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk ___ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user
[Lcms-user] Release candidate of lcms2-2.6 now available
Hello everybody, Those of you that are following the GIT page for lcms surely have noticed a huge merge done today just few hours ago. I've upgraded the repository to the latest development sources, which includes a big amount of changes. Those comes from a great contribution made by Artifex Software (the creators of Ghost-script) and basically it adds many improvements on multithreading. I plan to release all this very soon as lcms2-2.6, so this mail is to announce the availability of first release candidate: http://www.littlecms.com/lcms2-2.6rc0.tar.gz Only as tarball this time. If anybody can't cope with tarballs and desperately needs a zip, please let me know. You can also just wait for about two weeks, which is the intended period of scrutiny. Any feedback before the release will be greatly appreciated. Feedback after the release will be also appreciated, but changes will not made its way until 6 months. At that point I wish to thank Artifex very much for the sponsoring- without their aid, we would never have reached the functionality this release has. What is new: lcms has no longer global variables anymore. By using cmsContext, several apps can share lcms2 as a shared object and use different plug-ins, loggers and settings. Each instance has its private context, and contexts are not shared across apps. Backwards compatibility is mostly maintained but in some minor details. A compilation toggle is provided for cases where absolute backwards compatibility is required. Aside that, a new locking plug-in type allows to share profiles between threads reducing the contention problems that would otherwise arise by using mutex when creating transforms. Overall, a big step towards better paralellization and a big advance from the little cms project. Ant that's all for now. If no stopper is found, the release of lcms2-2.6 would happen in two weeks. Please feel free to download and check the CMM in your application, if something does not work, let us know. If it works fine, let us know as well. Weird platforms have an extra bonus. Thank you again for your great support! Best regards Marti Maria The Little CMS project http://www.littlecms.com -- Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151iu=/4140/ostg.clktrk ___ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user