Re: [Mesa-dev] [PATCH 6/7] egl: drop unneeded sentinel from level_strings[]

2017-05-04 Thread Bartosz Tomczyk
It should be: i < ARRAY_SIZE(level_strings) On 04.05.2017 20:47, Emil Velikov wrote: From: Emil Velikov The array is local so we already know its size. Signed-off-by: Emil Velikov --- src/egl/main/egllog.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/egl/m

[Mesa-dev] [PATCH v2] mesa: return early with error when shader source count is 0

2017-05-04 Thread Bartosz Tomczyk
malloc can return valid pointer for zero size allocation, which causes OOB access later on v2: Return error if count is 0, clear previous shader source --- src/mesa/main/shaderapi.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main

Re: [Mesa-dev] [PATCH] mesa: return early with no error when shader source count is 0

2017-05-04 Thread Bartosz Tomczyk
You are right, it doesn't free old shader source. Should we also clear old source if new source is NULL? Then I could unify both conditions. On 04.05.2017 19:03, Eric Anholt wrote: Bartosz Tomczyk writes: malloc can return valid pointer for zero size allocation, which causes OOB a

[Mesa-dev] [PATCH] mesa: stop glthread on exit

2017-05-04 Thread Bartosz Tomczyk
It fixes occasional crashes when app exits and glthread is still processing commands. --- src/mesa/main/context.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 3570f94f5a..c3c4095329 100644 --- a/src/mesa/main/context.c +++ b/src/mes

[Mesa-dev] [PATCH] mesa: return early with no error when shader source count is 0

2017-05-04 Thread Bartosz Tomczyk
malloc can return valid pointer for zero size allocation, which causes OOB access later on --- src/mesa/main/shaderapi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index c41f006eb7..36cff0ca6e 100644 --- a/src/mesa/main/shaderapi.c

Re: [Mesa-dev] [PATCH v2] mesa/vbo: reduce prim array size

2017-05-03 Thread Bartosz Tomczyk
Yes, please push it for me. On 03.05.2017 17:41, Nicolai Hähnle wrote: Reviewed-by: Nicolai Hähnle Do you need somebody to push this? On 02.05.2017 13:19, Bartosz Tomczyk wrote: We always use only single element. v2: Change signle element arrays to variables --- src/mesa/vbo

[Mesa-dev] [PATCH v2] mesa/vbo: reduce prim array size

2017-05-02 Thread Bartosz Tomczyk
We always use only single element. v2: Change signle element arrays to variables --- src/mesa/vbo/vbo_exec_array.c | 74 +-- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index

Re: [Mesa-dev] [PATCH] mesa/vbo: reduce prim array size

2017-05-02 Thread Bartosz Tomczyk
Sure, I will send updated patch soon. On 02.05.2017 13:03, Nicolai Hähnle wrote: On 02.05.2017 12:37, Bartosz Tomczyk wrote: We always use only single element. Can you just change prim to not be an array at all in that case? Thanks, Nicolai --- src/mesa/vbo/vbo_exec_array.c | 4 ++-- 1

[Mesa-dev] [PATCH] mesa/vbo: reduce prim array size

2017-05-02 Thread Bartosz Tomczyk
We always use only single element. --- src/mesa/vbo/vbo_exec_array.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index 15382eaaae..cbef610d96 100644 --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_

[Mesa-dev] [PATCH v2] mesa: Avoid leaking surface in st_renderbuffer_delete

2017-04-29 Thread Bartosz Tomczyk
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100741 Fixes: a5e733c6b52 mesa: drop current draw/read buffer when ctx is released CC: Rob Clark v2: add comment in code --- src/mesa/main/context.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mesa/main/

[Mesa-dev] [PATCH] mesa: Avoid leaking surface in st_renderbuffer_delete

2017-04-27 Thread Bartosz Tomczyk
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100741 Fixes: a5e733c6b52 mesa: drop current draw/read buffer when ctx is released CC: Rob Clark --- src/mesa/main/context.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mesa/main/context.c b/src/mesa/main/con

[Mesa-dev] [PATCH v2] mesa/glthread: add async support to ARB_viewport_array functions

2017-04-13 Thread Bartosz Tomczyk
v2: fix attribute name, it is count_scale not scale_count --- src/mapi/glapi/gen/ARB_viewport_array.xml | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mapi/glapi/gen/ARB_viewport_array.xml b/src/mapi/glapi/gen/ARB_viewport_array.xml index ebd5b99c83..be67912884

[Mesa-dev] [PATCH] mesa/glthread: add async support to ARB_viewport_array functions

2017-04-13 Thread Bartosz Tomczyk
--- src/mapi/glapi/gen/ARB_viewport_array.xml | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mapi/glapi/gen/ARB_viewport_array.xml b/src/mapi/glapi/gen/ARB_viewport_array.xml index ebd5b99c83..dbda1d8ad0 100644 --- a/src/mapi/glapi/gen/ARB_viewport_array.xml ++

Re: [Mesa-dev] [PATCH] mesa: fix memory leak in arb_fragment_program

2017-04-11 Thread Bartosz Tomczyk
Could you push it for me? On Mon, Apr 10, 2017 at 4:06 AM, Timothy Arceri wrote: > Thanks. > > Reviewed-by: Timothy Arceri > > > On 10/04/17 02:37, Bartosz Tomczyk wrote: > >> --- >> src/mesa/program/arbprogparse.c | 1 + >> 1 file changed, 1 insertion

Re: [Mesa-dev] [PATCH] mesa: use single memcpy when strides match

2017-04-11 Thread Bartosz Tomczyk
Thank you very much, Brian. On Mon, Apr 10, 2017 at 10:43 PM, Brian Paul wrote: > Pushed, with slightly more descriptive commit msg. > > -Brian > > > On 04/10/2017 12:31 PM, Bartosz Tomczyk wrote: > >> v2: fix indentation >> --- >> src/mesa/main/readpi

Re: [Mesa-dev] [PATCH 0/5] use atomics for reference counting

2017-04-11 Thread Bartosz Tomczyk
king (e.g. arrayobj, pipelineobj) can be > dropped if we drop support for the GLX_MESA_multithread_makecurrent > extension (which I believe we are planning to drop). > > Tim > > > On 11/04/17 06:08, Bartosz Tomczyk wrote: > >> Bartosz Tomczyk (5): >> mesa/arra

[Mesa-dev] [PATCH 1/5] mesa/arrayobj: use atomics for reference counting

2017-04-10 Thread Bartosz Tomczyk
--- src/mesa/main/arrayobj.c | 16 src/mesa/main/mtypes.h | 2 -- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c index ab1b834b6d..39bdb2e715 100644 --- a/src/mesa/main/arrayobj.c +++ b/src/mesa/main/arrayobj.

[Mesa-dev] [PATCH 3/5] mesa/renderbuffer: use atomics for reference counting

2017-04-10 Thread Bartosz Tomczyk
--- src/mesa/main/fbobject.c | 1 - src/mesa/main/mtypes.h | 1 - src/mesa/main/renderbuffer.c | 15 +++ 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index d486d01195..f85f26674d 100644 --- a/src/mesa/ma

[Mesa-dev] [PATCH 4/5] mesa/samplerobj: use atomics for reference counting

2017-04-10 Thread Bartosz Tomczyk
--- src/mesa/main/mtypes.h | 1 - src/mesa/main/samplerobj.c | 16 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index d37a60d61c..5a1be17a92 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@

[Mesa-dev] [PATCH 5/5] mesa/texobj: use atomics for reference counting

2017-04-10 Thread Bartosz Tomczyk
--- src/mesa/main/mtypes.h | 1 - src/mesa/main/texobj.c | 19 --- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 5a1be17a92..a1eabc8bf1 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -995,

[Mesa-dev] [PATCH 2/5] mesa/pipelineobj: use atomics for reference counting

2017-04-10 Thread Bartosz Tomczyk
--- src/mesa/main/mtypes.h | 2 -- src/mesa/main/pipelineobj.c | 16 src/mesa/main/shaderapi.c | 2 -- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 5de464cc1b..8b1577dd3f 100644 --- a/src/mesa/main/m

[Mesa-dev] [PATCH 0/5] use atomics for reference counting

2017-04-10 Thread Bartosz Tomczyk
Bartosz Tomczyk (5): mesa/arrayobj: use atomics for reference counting mesa/pipelineobj: use atomics for reference counting mesa/renderbuffer: use atomics for reference counting mesa/samplerobj: use atomics for reference counting mesa/texobj: use atomics for reference counting src/mesa

Re: [Mesa-dev] [PATCH] mesa: use single memcpy when strides matches

2017-04-10 Thread Bartosz Tomczyk
Please do, I don't have commits rights. On 10.04.2017 20:44, Brian Paul wrote: On 04/10/2017 12:35 PM, Bartosz Tomczyk wrote: Yes, I tested with Piglit, there is no regression. Do you need me to push this for you? -Brian On 10.04.2017 19:16, Brian Paul wrote: On 04/09/2017 07:

Re: [Mesa-dev] [PATCH] mesa: use single memcpy when strides matches

2017-04-10 Thread Bartosz Tomczyk
Yes, I tested with Piglit, there is no regression. On 10.04.2017 19:16, Brian Paul wrote: On 04/09/2017 07:58 AM, Bartosz Tomczyk wrote: --- src/mesa/main/readpix.c | 15 ++- src/mesa/main/texstore.c | 15 +++ 2 files changed, 21 insertions(+), 9 deletions

[Mesa-dev] [PATCH] mesa: use single memcpy when strides match

2017-04-10 Thread Bartosz Tomczyk
v2: fix indentation --- src/mesa/main/readpix.c | 15 ++- src/mesa/main/texstore.c | 15 +++ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c index 25823230d6..606d1e58e5 100644 --- a/src/mesa/main/readpix.c

[Mesa-dev] [PATCH] mesa: fix memory leak in arb_fragment_program

2017-04-09 Thread Bartosz Tomczyk
--- src/mesa/program/arbprogparse.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/program/arbprogparse.c b/src/mesa/program/arbprogparse.c index 07bdf1603e..83a501eea6 100644 --- a/src/mesa/program/arbprogparse.c +++ b/src/mesa/program/arbprogparse.c @@ -78,6 +78,7 @@ _mesa_parse_ar

[Mesa-dev] [PATCH] mesa: use single memcpy when strides matches

2017-04-09 Thread Bartosz Tomczyk
--- src/mesa/main/readpix.c | 15 ++- src/mesa/main/texstore.c | 15 +++ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c index 25823230d6..14568de497 100644 --- a/src/mesa/main/readpix.c +++ b/src/mesa/main/

Re: [Mesa-dev] [PATCH] mesa: fix renderbuffer leak

2017-04-08 Thread Bartosz Tomczyk
I confirm that the series fix all memory leaks I was observing. Tested-by: Bartosz Tomczyk On 08.04.2017 05:23, Timothy Arceri wrote: On 08/04/17 12:25, Timothy Arceri wrote: Actually please ignore that series for now. There are some issue with it I need to fix up. Sorry for the noise

Re: [Mesa-dev] [PATCH] mesa: fix renderbuffer leak

2017-04-07 Thread Bartosz Tomczyk
Patch didn't fix all leaks. There's one more still reported by ASAN: Direct leak of 2112 byte(s) in 12 object(s) allocated from: #0 0x7fe18d168800 in calloc (/usr/lib/clang/3.9.1/lib/linux/ libclang_rt.asan-x86_64.so+0xf6800) #1 0x7fe181c141f6 in st_new_renderbuffer_fb /home/bartek/Devel/m

Re: [Mesa-dev] [PATCH] configure.ac: add --enable-sanitize option

2017-04-07 Thread Bartosz Tomczyk
Reviewed-by: Bartosz Tomczyk I was using similar patch locally for a long time. On Fri, Apr 7, 2017 at 12:00 PM, Nicolai Hähnle wrote: > From: Nicolai Hähnle > > Enable code sanitizers by adding -fsanitize=$foo flags for the compiler > and linker. > > In addition, this also

Re: [Mesa-dev] [PATCH] mesa: tidy up renderbuffer RefCount initialisation

2017-04-06 Thread Bartosz Tomczyk
Timothy, I observe huge memory leak after this commit: Direct leak of 648208 byte(s) in 3683 object(s) allocated from: #0 0x7f3d72729800 in calloc (/usr/lib/clang/3.9.1/lib/linux/ libclang_rt.asan-x86_64.so+0xf6800) #1 0x7f3d64a4d114 in st_new_renderbuffer /home/bartek/Devel/mesa/src/mesa

Re: [Mesa-dev] [PATCH] mesa/glthread: Avoid unnecessary batch reallocation

2017-04-03 Thread Bartosz Tomczyk
Thank you Timothy. Sorry about that, I'm still quite to new git/Mesa workflow. I will do better in future. On Apr 4, 2017 01:54, "Timothy Arceri" wrote: I've pushed this. Thanks! In future please add the version to the subject when sending new revisions. You can do this with the -v option whe

[Mesa-dev] [PATCH] mesa/glthread: Avoid unnecessary batch reallocation

2017-04-03 Thread Bartosz Tomczyk
--- src/mesa/main/glthread.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/mesa/main/glthread.c b/src/mesa/main/glthread.c index 3f07c420d4..c4d3f4a434 100644 --- a/src/mesa/main/glthread.c +++ b/src/mesa/main/glthread.c @@ -53,7 +53,8 @@ glthread_allocate

[Mesa-dev] [PATCH] [RFC] mesa/glthread: misaligned address access

2017-04-03 Thread Bartosz Tomczyk
Address sanitizer reports lot of misaligned access: SUMMARY: AddressSanitizer: undefined-behavior main/marshal.c:276:31 in main/marshal.c:276:31: runtime error: load of misaligned address 0x631000104866 for type 'const GLuint' (aka 'const unsigned int'), which requires 4 byte alignment 0x631000104

Re: [Mesa-dev] [PATCH] mesa/glthread: Avoid unnecessary batch reallocation

2017-04-03 Thread Bartosz Tomczyk
nle wrote: > On 03.04.2017 20:38, Bartosz Tomczyk wrote: > >> --- >> src/mesa/main/glthread.c | 15 +-- >> 1 file changed, 9 insertions(+), 6 deletions(-) >> >> diff --git a/src/mesa/main/glthread.c b/src/mesa/main/glthread.c >> index 3f07c42

[Mesa-dev] [PATCH] mesa/glthread: Avoid unnecessary batch reallocation

2017-04-03 Thread Bartosz Tomczyk
--- src/mesa/main/glthread.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/mesa/main/glthread.c b/src/mesa/main/glthread.c index 3f07c420d4..aa14292e59 100644 --- a/src/mesa/main/glthread.c +++ b/src/mesa/main/glthread.c @@ -53,7 +53,8 @@ glthread_allocate

[Mesa-dev] [PATCH] glsl: Fix blob memory leak

2017-04-03 Thread Bartosz Tomczyk
--- src/compiler/glsl/blob.h | 11 +++ src/compiler/glsl/shader_cache.cpp | 2 +- src/compiler/glsl/tests/blob_test.c | 8 src/mesa/state_tracker/st_shader_cache.c | 2 +- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/compiler/gl

[Mesa-dev] [PATCH 2/2] st/shader_cache: Fix memory leak

2017-04-02 Thread Bartosz Tomczyk
--- src/mesa/state_tracker/st_shader_cache.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mesa/state_tracker/st_shader_cache.c b/src/mesa/state_tracker/st_shader_cache.c index e8c7289ec6..5dbcb74f73 100644 --- a/src/mesa/state_tracker/st_shader_cache.c +++ b/src/mesa/state_tracker/st

[Mesa-dev] [PATCH 1/2] glsl/shader_cache: Fix memory leak

2017-04-02 Thread Bartosz Tomczyk
--- src/compiler/glsl/shader_cache.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compiler/glsl/shader_cache.cpp b/src/compiler/glsl/shader_cache.cpp index ea1bc01f02..8c42a95664 100644 --- a/src/compiler/glsl/shader_cache.cpp +++ b/src/compiler/glsl/shader_cache.cpp @@ -1273,6 +12

[Mesa-dev] [PATCH] mesa/glthread: Call unmarshal_batch directly in glthread_finish

2017-03-30 Thread Bartosz Tomczyk
Call it directly when batch queue is empty. This avoids costly thread synchronisation. This commit improves performance of games that have previously regressed with mesa_glthread=true. --- src/mesa/main/glthread.c | 47 ++- 1 file changed, 34 insertions(

Re: [Mesa-dev] [PATCH] [RFC v3] mesa/glthread: Call unmarshal_batch directly in glthread_finish

2017-03-30 Thread Bartosz Tomczyk
Thanks Nicolai, Adding Timothy who seems most active on glthread topic. Guys, do you think we can land this, with above comments addressed? On Thu, Mar 30, 2017 at 1:40 PM, Nicolai Hähnle wrote: > On 30.03.2017 10:30, Bartosz Tomczyk wrote: > >> Thank you guys for testing. >&g

Re: [Mesa-dev] [PATCH] [RFC v3] mesa/glthread: Call unmarshal_batch directly in glthread_finish

2017-03-30 Thread Bartosz Tomczyk
t; On 30/03/17 02:31 AM, Bartosz Tomczyk wrote: > > Call it directly when batch queue is empty. This avoids costly thread > > synchronisation. With this fix games that previously regressed > > with mesa_glthread=true like xonotic or grid autosport. > > The s

Re: [Mesa-dev] [PATCH] [RFC v3] mesa/glthread: Call unmarshal_batch directly in glthread_finish

2017-03-29 Thread Bartosz Tomczyk
I would be very grateful if someone could help with testing performance impact of this change. On Wed, Mar 29, 2017 at 7:31 PM, Bartosz Tomczyk < bartosz.tomczy...@gmail.com> wrote: > Call it directly when batch queue is empty. This avoids costly thread > synchronisation. With th

[Mesa-dev] [PATCH] [RFC v3] mesa/glthread: Call unmarshal_batch directly in glthread_finish

2017-03-29 Thread Bartosz Tomczyk
Call it directly when batch queue is empty. This avoids costly thread synchronisation. With this fix games that previously regressed with mesa_glthread=true like xonotic or grid autosport. --- src/mesa/main/glthread.c | 47 ++- 1 file changed, 34 inserti

[Mesa-dev] [PATCH] [RFC v2] mesa/glthread: Call unmarshal_batch directly in glthread_finish when batch queue is empty.

2017-03-29 Thread Bartosz Tomczyk
This avoids costly thread synchronisation. With this fix games that previously regressed with mesa_glthread=true like xonotic or grid autosport. Could someone test if games that benefit from glthread didn't regress? --- src/mesa/main/glthread.c | 49 +--

Re: [Mesa-dev] [PATCH] [RFC] mesa/glthread: Call unmarshal_batch directly in glthread_finish when batch queue is empty.

2017-03-29 Thread Bartosz Tomczyk
Please ignore above patch. On Wed, Mar 29, 2017 at 5:48 PM, Bartosz Tomczyk < bartosz.tomczy...@gmail.com> wrote: > This avoids costly thread synchronisation. With this fix games that > previously regressed with mesa_glthread=true like xonotic or grid autosport. > Could someon

[Mesa-dev] [PATCH] [RFC] mesa/glthread: Call unmarshal_batch directly in glthread_finish when batch queue is empty.

2017-03-29 Thread Bartosz Tomczyk
This avoids costly thread synchronisation. With this fix games that previously regressed with mesa_glthread=true like xonotic or grid autosport. Could someone test if games that benefit from glthread didn't regress? --- src/mesa/main/glthread.c | 17 + 1 file changed, 13 insertion

Re: [Mesa-dev] [PATCH 1/5] gallium/u_inlines: fix member access within null pointer

2017-02-08 Thread Bartosz Tomczyk
onable solution to me (as long as > > it still compiles everywhere, of course). > > (But as said, since this is iffy, I'd be ok with changing the code too, > > iff you can prove that compilers optimize this away.) > > > > Roland > > > > Am 08.02.2017 um 16

Re: [Mesa-dev] [PATCH] r600g/sb: Fix memory leak by reworking uses list

2017-02-08 Thread Bartosz Tomczyk
Patch is: Tested-by: Bartosz Tomczyk https://lists.freedesktop.org/mailman/listinfo/mesa-dev>> On Tue, Feb 7, 2017 at 10:30 PM, Heiko Przybyl wrote: > When fixing the stalls on evergreen I introduced leaking of the useinfo > structure(s). Sorry. Instead of allocating a new obje

[Mesa-dev] [PATCH] r600g: Fix out of bounds access

2017-02-08 Thread Bartosz Tomczyk
fc_sp variable should indicate number of elements in fc_stack array, but fc_sp was increased at beginning of fc_pushlevel function. It leads to situation where idx=0 was never used, and last 32 element was stored outside fs_stack array. --- src/gallium/drivers/r600/r600_asm.h| 3 ++- src/gall

Re: [Mesa-dev] [PATCH 1/5] gallium/u_inlines: fix member access within null pointer

2017-02-08 Thread Bartosz Tomczyk
gt; Nicolai > > > >> -Brian > >> > >> > >> On 02/07/2017 02:45 PM, Roland Scheidegger wrote: > >>> I'm not quite sure there's really a bug here? > >>> As far as I can tell, these functio

[Mesa-dev] [PATCH 3/5] st/mesa: fix member access within null pointer

2017-02-07 Thread Bartosz Tomczyk
--- src/mesa/state_tracker/st_manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c index c3d8286b5a..ad69ca6eb5 100644 --- a/src/mesa/state_tracker/st_manager.c +++ b/src/mesa/state_tracker/st_manag

[Mesa-dev] [PATCH 2/5] util/list: fix member access within null pointer

2017-02-07 Thread Bartosz Tomczyk
--- configure.ac| 3 +++ src/util/list.h | 9 + 2 files changed, 12 insertions(+) diff --git a/configure.ac b/configure.ac index a6ceee95a3..87f635c1a3 100644 --- a/configure.ac +++ b/configure.ac @@ -415,6 +415,9 @@ AC_C_BIGENDIAN( little_endian=no ) +dnl Chek for typeof suppo

[Mesa-dev] [PATCH 1/5] gallium/u_inlines: fix member access within null pointer

2017-02-07 Thread Bartosz Tomczyk
--- src/gallium/auxiliary/util/u_inlines.h | 65 -- 1 file changed, 39 insertions(+), 26 deletions(-) diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h index b7b8313583..3bb3bcd6e0 100644 --- a/src/gallium/auxiliary/util/

[Mesa-dev] [PATCH 5/5] gallium/radeon: fix member access within null pointer

2017-02-07 Thread Bartosz Tomczyk
--- src/gallium/drivers/radeon/r600_pipe_common.c | 13 +++-- src/gallium/drivers/radeon/r600_pipe_common.h | 3 ++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c index 95a6a486

[Mesa-dev] [PATCH 0/5] Fix member access within null pointer reported by UBSAN

2017-02-07 Thread Bartosz Tomczyk
Series fix various null pointer derefeneces repored by UBSAN. Found by running piglit tests. Bartosz Tomczyk (5): gallium/u_inlines: fix member access within null pointer util/list: fix member access within null pointer st/mesa: fix member access within null pointer gallium/auxiliary: fix

[Mesa-dev] [PATCH 4/5] gallium/auxiliary: fix member access within null pointer

2017-02-07 Thread Bartosz Tomczyk
--- src/gallium/auxiliary/pipebuffer/pb_buffer.h | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer.h b/src/gallium/auxiliary/pipebuffer/pb_buffer.h index 33c23068c2..12c9ca779a 100644 --- a/src/gallium/auxiliary/pipebuffer/pb

Re: [Mesa-dev] [PATCH v2] glsl: fix heap-use-after-free in ast_declarator_list::hir()

2017-02-07 Thread Bartosz Tomczyk
Patch is: Tested-by: Bartosz Tomczyk I can confirm it fix use-after-free issue. On Tue, Feb 7, 2017 at 1:47 PM, Samuel Iglesias Gonsálvez < sigles...@igalia.com> wrote: > The get_variable_being_redeclared() function can free 'var' because > a re-declaration of an unsi

Re: [Mesa-dev] [PATCH] r600/sb: Fix memory leak

2017-02-07 Thread Bartosz Tomczyk
Hi Nicolai, Will you push it, if I change it as described in last mail ? On Mon, Jan 30, 2017 at 3:31 PM, Bartosz Tomczyk < bartosz.tomczy...@gmail.com> wrote: > It did not change anything, as we are not dereferencing iterator after > delete. > > I think changing: > delete

Re: [Mesa-dev] [PATCH] glsl: fix heap-use-after-free in ast_declarator_list::hir()

2017-02-07 Thread Bartosz Tomczyk
< sigles...@igalia.com> wrote: > On Tue, 2017-02-07 at 12:01 +0100, Bartosz Tomczyk wrote: > > Hi Samuel, > > > > Var pointer is passed by value to get_variable_being_redeclared, so > > it will not fix the issue. I thinks it should be changed

Re: [Mesa-dev] [PATCH] glsl: fix heap-use-after-free in ast_declarator_list::hir()

2017-02-07 Thread Bartosz Tomczyk
Hi Samuel, Var pointer is passed by value to get_variable_being_redeclared, so it will not fix the issue. I thinks it should be changed to pointer to pointer. On Tue, Feb 7, 2017 at 11:45 AM, Samuel Iglesias Gonsálvez < sigles...@igalia.com> wrote: > The get_variable_being_redeclared() function

[Mesa-dev] [PATCH v2] glsl: fix heap-buffer-overflow

2017-01-31 Thread Bartosz Tomczyk
The `end+1` skips the ']', whereas the `strlen+1` includes the final '\0' in the move to terminate the string. --- src/compiler/glsl/link_uniforms.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/glsl/link_uniforms.cpp b/src/compiler/glsl/link_uniforms.cpp inde

[Mesa-dev] [PATCH] glsl: fix heap-buffer-overflow

2017-01-30 Thread Bartosz Tomczyk
Found by ASAN. There is no need to add +1 to strlen, we have already add +1 to str_end. --- src/compiler/glsl/link_uniforms.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/glsl/link_uniforms.cpp b/src/compiler/glsl/link_uniforms.cpp index a450aa03a8..5a03257b9

Re: [Mesa-dev] [PATCH] r600/sb: Fix memory leak

2017-01-30 Thread Bartosz Tomczyk
colai Hähnle wrote: > Nice find! > > On 29.01.2017 19:10, Bartosz Tomczyk wrote: > >> --- >> src/gallium/drivers/r600/sb/sb_valtable.cpp | 8 +++- >> 1 file changed, 7 insertions(+), 1 deletion(-) >> >> diff --git a/src/gallium/drivers/r600/sb/s

[Mesa-dev] [PATCH] r600: Fix stack overflow

2017-01-30 Thread Bartosz Tomczyk
Commit 7b5878ee0491e7a93914389a8369cd6752b9757d increased number of outputs to 64, but left output array intact. This caused stack overflow when number of outputs is bigger then 32. Found by ASAN. --- src/gallium/drivers/r600/r600_shader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) dif

[Mesa-dev] [PATCH] r600/sb: Fix memory leak

2017-01-29 Thread Bartosz Tomczyk
--- src/gallium/drivers/r600/sb/sb_valtable.cpp | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/r600/sb/sb_valtable.cpp b/src/gallium/drivers/r600/sb/sb_valtable.cpp index a8b7b49cd4..d31a1b76d5 100644 --- a/src/gallium/drivers/r600/sb/sb_valtable.cp