Bug 30022 - Crash while launching supertuxkart (svn), "Too many temporaries"
Summary: Crash while launching supertuxkart (svn), "Too many temporaries"
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/r300 (show other bugs)
Version: git
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-04 18:55 UTC by gsr.bugs
Modified: 2010-09-04 20:29 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description gsr.bugs 2010-09-04 18:55:05 UTC
Launching supertuxkart (svn 5892) generates the following when run with RADEON_DEBUG=vp.

---8<---
r300: Initial vertex program
VERT
DCL IN[0]
DCL IN[1]
DCL OUT[0], POSITION
DCL OUT[1], COLOR
  0: MOV OUT[0], IN[0]
  1: MOV OUT[1], IN[1]
  2: END
Vertex Program: before compilation
# Radeon Compiler Program
  0: MOV temp[0], input[0];
  1: MOV output[1], input[1];
  2: MOV output[0], temp[0];
  3: MOV output[2], temp[0];
Vertex Program: after 'transform loops'
# Radeon Compiler Program
  0: MOV temp[0], input[0];
  1: MOV output[1], input[1];
  2: MOV output[0], temp[0];
  3: MOV output[2], temp[0];
Vertex Program: after 'emulate branches'
# Radeon Compiler Program
  0: MOV temp[0], input[0];
  1: MOV output[1], input[1];
  2: MOV output[0], temp[0];
  3: MOV output[2], temp[0];
Vertex Program: after 'emulate negative addressing'
# Radeon Compiler Program
  0: MOV temp[0], input[0];
  1: MOV output[1], input[1];
  2: MOV output[0], temp[0];
  3: MOV output[2], temp[0];
Vertex Program: after 'native rewrite'
# Radeon Compiler Program
  0: MOV temp[0], input[0];
  1: MOV output[1], input[1];
  2: MOV output[0], temp[0];
  3: MOV output[2], temp[0];
Vertex Program: after 'emulate modifiers'
# Radeon Compiler Program
  0: MOV temp[0], input[0];
  1: MOV output[1], input[1];
  2: MOV output[0], temp[0];
  3: MOV output[2], temp[0];
Vertex Program: after 'deadcode'
# Radeon Compiler Program
  0: MOV temp[0], input[0];
  1: MOV output[1], input[1];
  2: MOV output[0], temp[0];
  3: MOV output[2], temp[0];
Vertex Program: after 'dataflow optimize'
# Radeon Compiler Program
  0: MOV output[1], input[1];
  1: MOV output[0], input[0];
  2: MOV output[2], input[0];
Vertex Program: after 'source conflict resolve'
# Radeon Compiler Program
  0: MOV output[1], input[1];
  1: MOV output[0], input[0];
  2: MOV output[2], input[0];
Vertex Program: after 'dataflow swizzles'
# Radeon Compiler Program
  0: MOV output[1], input[1];
  1: MOV output[0], input[0];
  2: MOV output[2], input[0];
Vertex Program: after 'register allocation'
# Radeon Compiler Program
  0: MOV output[1], input[1];
  1: MOV output[0], input[0];
  2: MOV output[2], input[0];
Vertex Program: after 'dead constants'
# Radeon Compiler Program
  0: MOV output[1], input[1];
  1: MOV output[0], input[0];
  2: MOV output[2], input[0];
num=140903841 max=32
r300compiler error: Too many temporaries.
r300 VP: Compiler error:
Too many temporaries.
Using a dummy shader instead.
r300: Initial vertex program
VERT
DCL OUT[0], POSITION
IMM FLT32 {    0.0000,     1.0000,     0.0000,     0.0000}
  0: MOV OUT[0], IMM[0].xxxy
  1: END
Vertex Program: before compilation
# Radeon Compiler Program
  0: MOV temp[1], temp[0].0001;
  1: MOV output[0], temp[1];
  2: MOV output[1], temp[1];
Vertex Program: after 'transform loops'
# Radeon Compiler Program
  0: MOV temp[1], temp[0].0001;
  1: MOV output[0], temp[1];
  2: MOV output[1], temp[1];
Vertex Program: after 'emulate branches'
# Radeon Compiler Program
  0: MOV temp[1], temp[0].0001;
  1: MOV output[0], temp[1];
  2: MOV output[1], temp[1];
Vertex Program: after 'emulate negative addressing'
# Radeon Compiler Program
  0: MOV temp[1], temp[0].0001;
  1: MOV output[0], temp[1];
  2: MOV output[1], temp[1];
Vertex Program: after 'native rewrite'
# Radeon Compiler Program
  0: MOV temp[1], temp[0].0001;
  1: MOV output[0], temp[1];
  2: MOV output[1], temp[1];
Vertex Program: after 'emulate modifiers'
# Radeon Compiler Program
  0: MOV temp[1], temp[0].0001;
  1: MOV output[0], temp[1];
  2: MOV output[1], temp[1];
Vertex Program: after 'deadcode'
# Radeon Compiler Program
  0: MOV temp[1], temp[0].0001;
  1: MOV output[0], temp[1];
  2: MOV output[1], temp[1];
Vertex Program: after 'dataflow optimize'
# Radeon Compiler Program
  0: MOV output[0], temp[0].0001;
  1: MOV output[1], temp[0].0001;
Vertex Program: after 'source conflict resolve'
# Radeon Compiler Program
  0: MOV output[0], temp[0].0001;
  1: MOV output[1], temp[0].0001;
Vertex Program: after 'dataflow swizzles'
# Radeon Compiler Program
  0: MOV output[0], temp[0].0001;
  1: MOV output[1], temp[0].0001;
Vertex Program: after 'register allocation'
# Radeon Compiler Program
  0: MOV output[0], temp[0].0001;
  1: MOV output[1], temp[0].0001;
Vertex Program: after 'dead constants'
# Radeon Compiler Program
  0: MOV output[0], temp[0].0001;
  1: MOV output[1], temp[0].0001;
num=140903841 max=32
r300compiler error: Too many temporaries.
r300 VP: Compiler error:
Too many temporaries.
Using a dummy shader instead.
r300 VP: Cannot compile the dummy shader! Giving up...

Program received signal SIGABRT, Aborted.
0xb7fe2424 in __kernel_vsyscall ()
(gdb) bt full
#0  0xb7fe2424 in __kernel_vsyscall ()
No symbol table info available.
#1  0xb7cbc751 in *__GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
        resultvar = <value optimized out>
        pid = -1210236940
        selftid = 24065
#2  0xb7cbfb82 in *__GI_abort () at abort.c:92
        act = {__sigaction_handler = {sa_handler = 0xb71047a6, sa_sigaction = 0xb71047a6}, sa_mask = {__val = {1, 1, 3068832739, 3221218148, 3071297470, 1, 1, 3068900000, 
              0, 3071297488, 1, 1, 3068848457, 0, 3071297508, 1, 1, 3068904887, 140920680, 3071297523, 0, 1, 3221218136, 55, 3071293612, 3084185523, 3084730356, 3083833012, 
              2, 3071293612, 55, 3084731744}}, sa_flags = -1, sa_restorer = 0xffffffff}
        sigs = {__val = {32, 0 <repeats 31 times>}}
#3  0xb6ea7a01 in r300_translate_vertex_shader () from /tmp/gallium/lib/gallium//r300_dri.so
No symbol table info available.
#4  0xb6ea77d8 in r300_dummy_vertex_shader () from /tmp/gallium/lib/gallium//r300_dri.so
No symbol table info available.
#5  0xb6ea7a21 in r300_translate_vertex_shader () from /tmp/gallium/lib/gallium//r300_dri.so
No symbol table info available.
#6  0xb6ea47e1 in r300_create_vs_state () from /tmp/gallium/lib/gallium//r300_dri.so
No symbol table info available.
#7  0xb70b54a3 in ureg_create_shader () from /tmp/gallium/lib/gallium//r300_dri.so
No symbol table info available.
#8  0xb70e4420 in ureg_create_shader_and_destroy () from /tmp/gallium/lib/gallium//r300_dri.so
No symbol table info available.
#9  0xb70e496e in util_make_vertex_passthrough_shader () from /tmp/gallium/lib/gallium//r300_dri.so
No symbol table info available.
#10 0xb70b8e32 in util_blitter_create () from /tmp/gallium/lib/gallium//r300_dri.so
No symbol table info available.
#11 0xb6e95015 in r300_create_context () from /tmp/gallium/lib/gallium//r300_dri.so
No symbol table info available.
#12 0xb6f9210f in create_context () from /tmp/gallium/lib/gallium//r300_dri.so
No symbol table info available.
#13 0xb6f92209 in st_api_create_context () from /tmp/gallium/lib/gallium//r300_dri.so
No symbol table info available.
#14 0xb6e7bc66 in dri_create_context () from /tmp/gallium/lib/gallium//r300_dri.so
No symbol table info available.
#15 0xb6e7ba50 in dri2_create_context () from /tmp/gallium/lib/gallium//r300_dri.so
No symbol table info available.
#16 0xb6e775d1 in dri2CreateNewContextForAPI () from /tmp/gallium/lib/gallium//r300_dri.so
No symbol table info available.
#17 0xb6e77620 in dri2CreateNewContext () from /tmp/gallium/lib/gallium//r300_dri.so
No symbol table info available.
#18 0xb7fa42cd in ?? () from /usr/lib/libGL.so.1
No symbol table info available.
#19 0xb7f7ce3b in ?? () from /usr/lib/libGL.so.1
No symbol table info available.
#20 0xb7f7d2de in glXCreateContext () from /usr/lib/libGL.so.1
No symbol table info available.
#21 0x081c01d8 in irr::CIrrDeviceLinux::createWindow() ()
No symbol table info available.
#22 0x081c615c in irr::CIrrDeviceLinux::CIrrDeviceLinux(irr::SIrrlichtCreationParameters const&) ()
No symbol table info available.
#23 0x081be07a in createDeviceEx ()
No symbol table info available.
#24 0x081be180 in createDevice ()
No symbol table info available.
#25 0x080854b7 in IrrDriver::initDevice (this=0x861af00) at graphics/irr_driver.cpp:164
        bits = 32
        type = irr::video::EDT_OPENGL
        driver_type = 0
        firstTime = false
        numDrivers = 5
        material2D = <value optimized out>
#26 0x0808688a in IrrDriver (this=0x861af00) at graphics/irr_driver.cpp:57
No locals.
#27 0x08050be4 in initRest () at main.cpp:527
No locals.
#28 0x08051f63 in main (argc=1, argv=0xbffff234) at main.cpp:611
        materials_file = {static npos = 4294967295, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, 
            _M_p = 0xbffff148 "X\361\377\277\244\332\004\b\260\020\377\267\230\245]\b\210\361\377\277\t\255S\b\004Cݷ\364?ݷ\220\361\377\277\364?ݷ"}}
        device = <value optimized out>
        driver = 0x85de520
--->8---

git bisect suggests:

---8<---
d2f4ceaa47695f9dc203c28b39d332eea8a115b2 is the first bad commit
commit d2f4ceaa47695f9dc203c28b39d332eea8a115b2
Author: Marek Olšák <maraeo@gmail.com>
Date:   Wed Sep 1 08:10:32 2010 +0200

    r300/compiler: compute the final number of temporaries during translation
    
    And not during the register allocation, which may be skipped for debugging
    purposes. Also the predicate register is now added to the number of temps.

:040000 040000 4c1e1bbcb6034c5f25621048602e3b11a918ee88 e89a3bc7b5ab99cc566e78e692a166e887212e57 M	src
--->8---
Comment 1 Marek Olšák 2010-09-04 19:29:23 UTC
There are numbers like "num=140903841 max=32", have you added this message there?

Anyway, I can't reproduce this bug.

Please try: git clean -fdx
and build the driver again.
Comment 2 gsr.bugs 2010-09-04 19:43:38 UTC
Those were a printf suggested by someone trying to figure what was going on, with this http://www.pasteall.org/15454 . The result is the same without that, as shown at http://www.pasteall.org/15453 .
Comment 3 Marek Olšák 2010-09-04 19:57:19 UTC
num_temporaries is certainly not computed correctly. There must be an initialized variable somewhere.

There are 3 variables which might cause this:
vpi->DstReg.Index
vpi->SrcReg[i].Index
compiler->PredicateIndex

Can you print these so that we know where the large value comes from?
Comment 4 Marek Olšák 2010-09-04 19:58:30 UTC
(In reply to comment #3)
> initialized variable somewhere.

Sorry, typo. It should have been "uninitialized".
Comment 5 gsr.bugs 2010-09-04 20:09:54 UTC
Same file than the other printf? But where/when to print? Patch or "insert this at end of the if block that starts at line xxx" best. :)
Comment 6 Marek Olšák 2010-09-04 20:11:31 UTC
I've committed a fix to mesa git which might fix this issue. Can you try it?
Comment 7 gsr.bugs 2010-09-04 20:29:17 UTC
The memsets seem to fix the crash.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.