Direct leak of 540276 byte(s) in 1 object(s) allocated from:
0 0x4cf190 in calloc (/home/lebedevri/src/_GIMP/babl/tests/.libs/nop+0x4cf190)
1 0x7f9cdd208cbb (<unknown module>)
2 0x7f9cdd207cca (<unknown module>)
3 0x7f9ce06820d8 in babl_extension_load /home/lebedevri/src/_GIMP/babl/babl/babl-extension.c:221:7
4 0x7f9ce06819d6 in babl_extension_load_dir /home/lebedevri/src/_GIMP/babl/babl/babl-extension.c:263:19
5 0x7f9ce06813fa in babl_extension_load_dir_list /home/lebedevri/src/_GIMP/babl/babl/babl-extension.c:333:17
6 0x7f9ce0678c84 in babl_init /home/lebedevri/src/_GIMP/babl/babl/babl.c:151:7
7 0x50504a in main /home/lebedevri/src/_GIMP/babl/tests/nop.c:26:3
8 0x7f9cdf64e72f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2072f)
Direct leak of 540276 byte(s) in 1 object(s) allocated from:
0 0x4cf190 in calloc (/home/lebedevri/src/_GIMP/babl/tests/.libs/nop+0x4cf190)
1 0x7f9cdd208cbb (<unknown module>)
2 0x7f9cdd207cf6 (<unknown module>)
3 0x7f9ce06820d8 in babl_extension_load /home/lebedevri/src/_GIMP/babl/babl/babl-extension.c:221:7
4 0x7f9ce06819d6 in babl_extension_load_dir /home/lebedevri/src/_GIMP/babl/babl/babl-extension.c:263:19
5 0x7f9ce06813fa in babl_extension_load_dir_list /home/lebedevri/src/_GIMP/babl/babl/babl-extension.c:333:17
6 0x7f9ce0678c84 in babl_init /home/lebedevri/src/_GIMP/babl/babl/babl.c:151:7
#7 0x50504a in main /home/lebedevri/src/_GIMP/babl/tests/nop.c:26:3
8 0x7f9cdf64e72f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2072f)
SUMMARY: AddressSanitizer: 1080552 byte(s) leaked in 2 allocation(s).
Gcc-4.9 warns:
babl-gen-test-pixels.c: In function ‘main’:
babl-gen-test-pixels.c:170:1: error: control reaches end of non-void function [-Werror=return-type]
Roman Lebedev [Fri, 19 Aug 2016 17:04:59 +0000 (20:04 +0300)]
extensions: fast-float: babl_lookup(): use 1UL, not just 1
Fixes:
fast-float.c:81:35: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
and
fast-float.c:91:34: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
Using __thread keyword.
Although, it is probably not universally avaliable, so this
is just conditional fastpath, if it is detected as unsupported
at compile time, the dumb implementation using malloc() is used.
Roman Lebedev [Thu, 18 Aug 2016 11:01:51 +0000 (14:01 +0300)]
Add .kateconfig with modelines for Kate
Directly follows GIMP HACKING Hackordnung:
- 2 characters indentation level
- no tabs. TAB should not put TAB characters in the file.
- tab stops at 8 column intervals.
Øyvind Kolås [Fri, 12 Feb 2016 11:05:33 +0000 (12:05 +0100)]
extensions: re-add table based conversions inherited from gggl
This code was replaces with the exact code paths in gggl and gggl-lies,
adding these new extensions re-enables the ability to use these
slightly less exact conversions - that possibly also could be fixed
to be exact.
Debarshi Ray [Sat, 9 Jan 2016 18:41:29 +0000 (19:41 +0100)]
CIE: Add conversion from "RGB float" to "CIE Lab float" and vice versa
Conversions from "RGB float" to "CIE Lab float" are 10 times slower
without this. One use case is passing a "RGB float" buffer to a
saturation operation that works in the "CIE Lab" colour space.
Michael Henning [Sun, 3 Jan 2016 22:02:38 +0000 (17:02 -0500)]
configure.ac: Fix the test for compiling half-floating point code.
_mm_cvtph_ps is implicitly defined if the compiler does not support
it. So, we need to store its return value in a variable so that
the test fails to type check when the function is implicitly defined
to return an int.
Roman Lebedev [Sat, 13 Jun 2015 13:59:35 +0000 (16:59 +0300)]
babl_format_new(): fix global-buffer-overflow
If we pass a string into this function, and this string is shorter than
sizeof(Babl), macro BABL_IS_BABL() will read past string bounds,
and bad things may happen.
NOTE: if a string will be passed into this function, that is not
handled by those if (!strcmp (arg, "<...>")), global-buffer-overflow
will still happen. i am not sure if/what can be done about it :(
Fixes following error:
=================================================================
==1657==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7fd3026d6c20 at pc 0x7fd3026b6e4a bp 0x7fffaac308a0 sp 0x7fffaac30898
READ of size 4 at 0x7fd3026d6c20 thread T0
0 0x7fd3026b6e49 in babl_format_new /home/lebedevri/src/_GIMP/babl/babl/babl-format.c:317
1 0x7fd3026bf44f in construct_double_format /home/lebedevri/src/_GIMP/babl/babl/babl-model.c:259
2 0x7fd3026bfd12 in babl_model_new /home/lebedevri/src/_GIMP/babl/babl/babl-model.c:204
3 0x7fd3026acce5 in babl_core_init /home/lebedevri/src/_GIMP/babl/babl/babl-core.c:128
4 0x7fd3026a9379 in babl_init /home/lebedevri/src/_GIMP/babl/babl/babl.c:145
5 0x7fd306e5a3d1 in gegl_post_parse_hook (/usr/local/lib/libgegl-0.3.so.0+0x523d1)
6 0x7fd301f5d238 in g_option_context_parse (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x55238)
7 0x7fd301f5e193 in g_option_context_parse_strv (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x56193)
8 0x48b8cf in main (/usr/local/bin/gimp-2.9+0x48b8cf)
9 0x7fd300f71b44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b44)
10 0x486b68 (/usr/local/bin/gimp-2.9+0x486b68)
0x7fd3026d6c23 is located 0 bytes to the right of global variable '*.LC8' from 'babl-model.c' (0x7fd3026d6c20) of size 3
'*.LC8' is ascii string 'id'
SUMMARY: AddressSanitizer: global-buffer-overflow /home/lebedevri/src/_GIMP/babl/babl/babl-format.c:317 babl_format_new
Shadow bytes around the buggy address:
0x0ffae04d2d70: f9 f9 f9 f9 00 00 04 f9 f9 f9 f9 f9 00 00 02 f9
=>0x0ffae04d2d80: f9 f9 f9 f9[03]f9 f9 f9 f9 f9 f9 f9 00 02 f9 f9
0x0ffae04d2d90: f9 f9 f9 f9 05 f9 f9 f9 f9 f9 f9 f9 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Contiguous container OOB:fc
ASan internal: fe
==1657==ABORTING
Roman Lebedev [Sat, 13 Jun 2015 13:57:20 +0000 (16:57 +0300)]
babl_model_new(): fix global-buffer-overflow
If we pass a string into this function, and this string is shorter than
sizeof(Babl), macro BABL_IS_BABL() will read past string bounds,
and bad things may happen.
NOTE: if a string will be passed into this function, that is not
handled by those if (!strcmp (arg, "<...>")), global-buffer-overflow
will still happen. i am not sure if/what can be done about it :(
Fixes following error:
=================================================================
==31464==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7f1c25907940 at pc 0x7f1c258f7636 bp 0x7ffdc4838670 sp 0x7ffdc4838668
READ of size 4 at 0x7f1c25907940 thread T0
0 0x7f1c258f7635 in babl_model_new /home/lebedevri/src/_GIMP/babl/babl/babl-model.c:114
1 0x7f1c258e4ce5 in babl_core_init /home/lebedevri/src/_GIMP/babl/babl/babl-core.c:128
2 0x7f1c258e1379 in babl_init /home/lebedevri/src/_GIMP/babl/babl/babl.c:145
3 0x7f1c2a0923d1 in gegl_post_parse_hook (/usr/local/lib/libgegl-0.3.so.0+0x523d1)
4 0x7f1c25195238 in g_option_context_parse (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x55238)
5 0x7f1c25196193 in g_option_context_parse_strv (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x56193)
6 0x48b8cf in main (/usr/local/bin/gimp-2.9+0x48b8cf)
7 0x7f1c241a9b44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b44)
8 0x486b68 (/usr/local/bin/gimp-2.9+0x486b68)
0x7f1c25907943 is located 0 bytes to the right of global variable '*.LC1' from 'babl-core.c' (0x7f1c25907940) of size 3
'*.LC1' is ascii string 'id'
SUMMARY: AddressSanitizer: global-buffer-overflow /home/lebedevri/src/_GIMP/babl/babl/babl-model.c:114 babl_model_new
Shadow bytes around the buggy address:
0x0fe404b18f10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0fe404b18f20: 05 f9 f9 f9 f9 f9 f9 f9[03]f9 f9 f9 f9 f9 f9 f9
0x0fe404b18f30: 07 f9 f9 f9 f9 f9 f9 f9 07 f9 f9 f9 f9 f9 f9 f9
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Contiguous container OOB:fc
ASan internal: fe
==31464==ABORTING
Roman Lebedev [Sat, 13 Jun 2015 13:54:21 +0000 (16:54 +0300)]
babl_component_new(): fix global-buffer-overflow
If we pass a string into this function, and this string is shorter than
sizeof(Babl), macro BABL_IS_BABL() will read past string bounds,
and bad things may happen.
NOTE: if a string will be passed into this function, that is not
handled by those if (!strcmp (arg, "<...>")), global-buffer-overflow
will still happen. i am not sure if/what can be done about it :(
Fixes following error:
=================================================================
==28935==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7f6e2393f940 at pc 0x7f6e23919b5f bp 0x7ffc7b9ca770 sp 0x7ffc7b9ca768
READ of size 4 at 0x7f6e2393f940 thread T0
0 0x7f6e23919b5e in babl_component_new /home/lebedevri/src/_GIMP/babl/babl/babl-component.c:82
1 0x7f6e2391cbda in babl_core_init /home/lebedevri/src/_GIMP/babl/babl/babl-core.c:96
2 0x7f6e23919379 in babl_init /home/lebedevri/src/_GIMP/babl/babl/babl.c:145
3 0x7f6e280ca3d1 in gegl_post_parse_hook (/usr/local/lib/libgegl-0.3.so.0+0x523d1)
4 0x7f6e231cd238 in g_option_context_parse (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x55238)
5 0x7f6e231ce193 in g_option_context_parse_strv (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x56193)
6 0x48b8cf in main (/usr/local/bin/gimp-2.9+0x48b8cf)
7 0x7f6e221e1b44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b44)
8 0x486b68 (/usr/local/bin/gimp-2.9+0x486b68)
0x7f6e2393f943 is located 0 bytes to the right of global variable '*.LC1' from 'babl-core.c' (0x7f6e2393f940) of size 3
'*.LC1' is ascii string 'id'
SUMMARY: AddressSanitizer: global-buffer-overflow /home/lebedevri/src/_GIMP/babl/babl/babl-component.c:82 babl_component_new
Shadow bytes around the buggy address:
0x0fee4471ff10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0fee4471ff20: 05 f9 f9 f9 f9 f9 f9 f9[03]f9 f9 f9 f9 f9 f9 f9
0x0fee4471ff30: 07 f9 f9 f9 f9 f9 f9 f9 07 f9 f9 f9 f9 f9 f9 f9
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Contiguous container OOB:fc
ASan internal: fe
==28935==ABORTING
Roman Lebedev [Sat, 13 Jun 2015 13:50:55 +0000 (16:50 +0300)]
babl_type_new(): fix global-buffer-overflow
If we pass a string into this function, and this string is shorter than
sizeof(Babl), macro BABL_IS_BABL() will read past string bounds,
and bad things may happen.
NOTE: if a string will be passed into this function, that is not
handled by those if (!strcmp (arg, "<...>")), global-buffer-overflow
will still happen. i am not sure if/what can be done about it :(
Fixes following error:
=================================================================
==25849==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7f7faec97940 at pc 0x7f7faec8b9bc bp 0x7ffd22ab9210 sp 0x7ffd22ab9208
READ of size 4 at 0x7f7faec97940 thread T0
0 0x7f7faec8b9bb in babl_type_new /home/lebedevri/src/_GIMP/babl/babl/babl-type.c:88
1 0x7f7faec74ba9 in babl_core_init /home/lebedevri/src/_GIMP/babl/babl/babl-core.c:90
2 0x7f7faec71379 in babl_init /home/lebedevri/src/_GIMP/babl/babl/babl.c:145
3 0x7f7fb342a3d1 in gegl_post_parse_hook (/usr/local/lib/libgegl-0.3.so.0+0x523d1)
4 0x7f7fae525238 in g_option_context_parse (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x55238)
5 0x7f7fae526193 in g_option_context_parse_strv (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x56193)
6 0x48b8cf in main (/usr/local/bin/gimp-2.9+0x48b8cf)
7 0x7f7fad539b44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b44)
8 0x486b68 (/usr/local/bin/gimp-2.9+0x486b68)
0x7f7faec97943 is located 0 bytes to the right of global variable '*.LC1' from 'babl-core.c' (0x7f7faec97940) of size 3
'*.LC1' is ascii string 'id'
SUMMARY: AddressSanitizer: global-buffer-overflow /home/lebedevri/src/_GIMP/babl/babl/babl-type.c:88 babl_type_new
Shadow bytes around the buggy address:
0x0ff075d8af10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0ff075d8af20: 05 f9 f9 f9 f9 f9 f9 f9[03]f9 f9 f9 f9 f9 f9 f9
0x0ff075d8af30: 07 f9 f9 f9 f9 f9 f9 f9 07 f9 f9 f9 f9 f9 f9 f9
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Contiguous container OOB:fc
ASan internal: fe
==25849==ABORTING
Jon Nordby [Wed, 18 Mar 2015 11:07:01 +0000 (12:07 +0100)]
babl-mutex: Define _GNU_SOURCE instead of __USE_GNU
__USE_GNU should only be set internally by the libc feature detect macros.
On older Debian-based systems, as used by Heroku cedar-10 stack, this failed
to provide the definition of PTHREAD_MUTEX_RECURSIVE
Nils Philippsen [Fri, 13 Feb 2015 12:29:13 +0000 (13:29 +0100)]
Remove workaround for non-recursive mutexes.
This workaround caused concurrency-stress-test to fail occasionally.
Meanwhile BablMutex wraps pthread mutexes in a way that they are
initialized as recursive.
Sven Claussner [Sun, 3 Aug 2014 05:38:39 +0000 (07:38 +0200)]
Update babl.doap and AUTHORS
Make babl.doap compliant to the new DOAP file style (GUADEC 2014):
* Add new mandatory fields 'description' and 'programming-language'.
* Add field 'category'
Add bug tracker URL.
Update mailing list adress.
Remove trailing white spaces.
Add me to AUTHORS.
Paul Fredrickson [Tue, 18 Mar 2014 03:17:43 +0000 (20:17 -0700)]
resolve ambiguous calling of real_babl_log with va_args
In babl-internal.h there are two different ways of calling real_babl_log.
One matches the macro definitions of babl_log which expects an arbitrary
number of parameters, and the other is to pass a va_list used to access
those parameters. The latter case can be found in the function definition
of babl_log when an appropriate macro definition is not selected.
It may be that some platforms implement varargs in such a way that
passing a va_list pointing to the params of another call stack is the
same as passing those parameters directly, but that definitely isn't
the case on mac OS X, where this results in corrupted strings when
calling babl_log or babl_fatal.
The solution here is to create a varargs-enabled version of real_babl_log
that accepts a va_list, and have all calls eventually call into that.
(This may not be seen under normal configurations. This was discovered
while trying to build with a hand-crafted config.h in Xcode.)
Daniel Sabo [Fri, 28 Feb 2014 00:25:45 +0000 (16:25 -0800)]
Revert "Use absolute error instead of average error for path check"
I would still like to use absolute error in the future because it
would remove the relationship between the number of zeros in the
test pixels and the total error score, but we do not seem to be at
a stage where that is practical yet (bug 725339).