[Mesa-dev] [PATCH shader-db] run: don't use alloca to avoid random crashes in the GLSL compiler

Eero Tamminen eero.t.tamminen at intel.com
Mon Dec 12 15:30:07 UTC 2016


Hi,

On 07.12.2016 20:03, Ian Romanick wrote:
> On 12/07/2016 09:44 AM, Marek Olšák wrote:
>> On Wed, Dec 7, 2016 at 6:42 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
>>> What's wrong with feeding it stack memory?
>>
>> I don't really have an answer to that.
 >
> Does valgrind provide any clues?

Valgrind isn't so good at debugging stack smashing.  At least I've found 
stack protection facilities by the compilers to be more useful for that.


 > The usual problems are running out of stack (is that still a thing?) 
or buffer overrun.

Unbounded alloca()s in threaded programs are a bad idea.

While the main thread stack grows on-demand, other threads have fixed 
sized stack.  By default it's nowadays 8MB on Linux:
$ ulimit -s
8192

For testing purposes, one could try setting thread stack size larger or 
smaller from command line and see whether it affects things:
$ ulimit -s 4096
$ <testcase>


	- Eero



More information about the mesa-dev mailing list