[Mesa-dev] Mesa-9.0: generate_builtins.py hangs and uses 100% CPU when generating from *.glsl files

Kenneth Graunke kenneth at whitecape.org
Fri Nov 2 11:59:40 PDT 2012


On 10/21/2012 07:50 PM, Stephan Raue wrote:
> Hi,
>
> i try to (cross)compile Mesa-9.0. builtin_compiler is compiled for host
> with a second hostbuild before i build Mesa for target.
>
> if i build Mesa for target the buildprocess hangs at:
> python2  ./builtins/tools/generate_builtins.py
> /home/stephan/projects/openelec-master/build.OpenELEC-Intel.x86_64-devel/toolchain/bin/builtin_compiler
>  > builtin_function.cpp || rm -f builtin_function.cpp
> with no output and uses 100% CPU.
>
> i get the same issue running manually this command manually. With
> Mesa-8.0.4
>   this was working and the problem was introduced by this commit:
>
> http://cgit.freedesktop.org/mesa/mesa/commit/src/glsl/builtins/tools/generate_builtins.py?h=9.0&id=7de1331662816d31fb9bed423b1e5372284a260e
>
>
> if i comment out the line:
>
> read_glsl_files(fs)
>
> the above command works. so something with the read_glsl_files(fs)
> function seems wrong here.
>
> if i run the above command with python -vvv it hangs after:
>
> ...
> # trying
> /home/stephan/projects/openelec-master/sources/Mesa/Mesa-9.0/src/glsl/builtins/tools/StringIOmodule.so
>
> # trying
> /home/stephan/projects/openelec-master/sources/Mesa/Mesa-9.0/src/glsl/builtins/tools/StringIO.py
>
> # trying
> /home/stephan/projects/openelec-master/sources/Mesa/Mesa-9.0/src/glsl/builtins/tools/StringIO.pyo
>
> # trying /usr/lib64/python2.7/StringIO.so
> # trying /usr/lib64/python2.7/StringIOmodule.so
> # trying /usr/lib64/python2.7/StringIO.py
> # /usr/lib64/python2.7/StringIO.pyo matches
> /usr/lib64/python2.7/StringIO.py
> import StringIO # precompiled from /usr/lib64/python2.7/StringIO.pyo
>
> until i break with ctrl+c:
>
> ^CTraceback (most recent call last):
>    File "./builtins/tools/generate_builtins.py", line 220, in <module>
>      write_function_definitions()
>    File "./builtins/tools/generate_builtins.py", line 68, in
> write_function_definitions
>      fs = get_builtin_definitions()
>    File "./builtins/tools/generate_builtins.py", line 48, in
> get_builtin_definitions
>      read_glsl_files(fs)
>    File "./builtins/tools/generate_builtins.py", line 35, in
> read_glsl_files
>      (output, returncode) = run_compiler([filename])
>    File "./builtins/tools/generate_builtins.py", line 76, in run_compiler
>      output = p.communicate()[0]
>    File "/usr/lib64/python2.7/subprocess.py", line 746, in communicate
>      stdout = _eintr_retry_call(self.stdout.read)
>    File "/usr/lib64/python2.7/subprocess.py", line 478, in
> _eintr_retry_call
>      return func(*args)
> KeyboardInterrupt
> # clear __builtin__._
> # clear sys.path
> ...
>
> what you need for infos to track down the problem?
>
> thanks for your help
>
> Stephan

Hi Stephan,

I think this should be fixed on Mesa master.  builtin_compiler needs to 
be built for the host system, not the target system, and our build 
system didn't handle that correctly until now.

--Ken


More information about the mesa-dev mailing list