| Summary: | NWN crashes after loading or starting game | ||
|---|---|---|---|
| Product: | Mesa | Reporter: | Krzysztof A. Sobiecki <sobkas> |
| Component: | Drivers/DRI/r300 | Assignee: | Default DRI bug account <dri-devel> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | critical | ||
| Priority: | medium | ||
| Version: | git | ||
| Hardware: | x86-64 (AMD64) | ||
| OS: | Linux (All) | ||
| Whiteboard: | |||
| i915 platform: | i915 features: | ||
| Attachments: |
Full backtrace of crashing NWN
Backtrace from mesa:800f48258623f8caf25d013f44784edb7caa3f93 Potential patch? Output of RADEON_DEBUG=all for unpatched Mesa Vertex log for compiler.Base.Debug=1; Output of RADEON_DEBUG=all last 3000 lines Full output for RADEON_DEBUG=all |
||
Created attachment 29325 [details]
Backtrace from mesa:800f48258623f8caf25d013f44784edb7caa3f93
Thank you for the report. Could you try running with the environment variable RADEON_DEBUG=vert set? Warning, this will produce a huge amount of output. Only the last lines before the crash are interesting (they will contain a dump of the vertex program which we attempted to compile). I don't have NWN here, and it would make it easier to understand what's going wrong. Created attachment 29354 [details] [review] Potential patch? Okay, after actually looking at what the line of code actually does, here's a potential (untested) patch that could fix it. Might be just an extremely silly bug after all. Created attachment 29357 [details]
Output of RADEON_DEBUG=all for unpatched Mesa
I might say that patch fixes crash, but unfortunately it also prevent rendering of some parts of bodies or clothing.
On unpatched Mesa starting NWN with RADEON_DEBUG=vert produces empty log. I'm attaching what I have produced using RADEON_DEBUG=all. I will also, in next attachment, post RADEON_DEBUG=vert for patched Mesa.
My speculation:
I think that bugs lay deeper in code path, as seen in backtrace. Something along produces broken object that is passed to rc_mesa_to_rc_program, with trips over it. I don't know enough about Mesa code to trace it.
That log must be incomplete. The only way to enter rc_mesa_to_program is through code paths which first print out the Mesa program if debugging is enabled. You could try forcing compiler.Base.Debug to 1 by changing the appropriate line of code in build_program. The other thing is: If that patch fixes the crash, but then rendering becomes incorrect, it might be that there is simply another, different bug somewhere else. Has NWN rendered correctly for you before the offending commit 800f48258623f8caf25d013f44784edb7caa3f93? It's unfortunately possible that a large commit like that introduces multiple unrelated bugs. NWN rendered correctly before 800f48258623f8caf25d013f44784edb7caa3f93(I have tested several versions while bisecting) it also renders correctly on 7.5.1.
Setting compiler.Base.Debug to 1 didn't helped at all. I added also several fprintf, printf, radeon_print without any success.
Apparently it's a shader problem(shader in function names should be a clue).
When I have prepared small library containing:
void glLoadProgramNV(int a, int b, int c, char *sp){}.
Preloading, it had the similar effect as applaying your patch.
Also I have found on NWN forum that this problem is somewhat known.
Disabling GL_NV_vertex_program[1] in Mesa stops crashes. It only hides problem, so I don't think it's solution.
1. http://nwn.bioware.com/forums/viewtopic.html?topic=659667&forum=72
2. http://nwn.bioware.com/forums/viewtopic.html?topic=655705&forum=72
3. http://nwn.bioware.com/forums/viewtopic.html?topic=688979&forum=72
(In reply to comment #5) > That log must be incomplete. IIRC, you can't get a log like that from nwn, since it redirects all stderr output. Created attachment 29383 [details] Vertex log for compiler.Base.Debug=1; >IIRC, you can't get a log like that from nwn, since it redirects all stderr output. I completely forgotten about that. I didn't saw stderr.txt so I assumed that everything works fine(It was printing some data after all). But now I'm attaching log for compiler.Base.Debug set to one. After Mesa recompile I will submit full output for RADEON_DEBUG=vert. Created attachment 29384 [details]
Output of RADEON_DEBUG=all last 3000 lines
RADEON_DEBUG=vert still doesn't work as expected. Either I must set compiler.Base.Debug by hand or use RADEON_DEBUG=all.
Created attachment 29385 [details] Full output for RADEON_DEBUG=all Mirror: http://rapidshare.com/files/278146525/nwn_alll.log.lzma Wow, I totally forgot about NV_vertex_program, and I had no test cases for that. The fact that those programs use the ENV register file is very probably related, maybe even the main cause of this bug. I'll look into it. I am somewhat surprised that you say NWN renders correctly before the offending commit 800f48258623f8caf25d013f44784edb7caa3f93 I have added a number of basic tests for NV_vertex_program to piglit, and those tests fail long before the commit in question. In any case, the moral seems to be: Support for NV_vertex_program is pretty badly broken, and needs to be fixed. Okay, I've fixed the obvious problems in our NV_vertex_program support in mesa_7_6_branch and in master. Could you please re-test? I have tested 92f7a599c7e94b0687d02efef1890e1a8ed2f9f3 again, I was sure that damn thing rendered well everything. I was wrong. I'm sorry. But I'm sure that there was no crash. Now I have tested 7ce0421fb712fd4e595f6c2ecede91c16fb3e133 and there is no crash or errors in rendering(now for sure, maybe). I will test it more and when I will be sure, that bug is fixed, I will close this bug. Ok? I will reopen it when I find any problems. I'm closing it for now. Thank you for the retesting. Note that if problems do appear, I would recommend to open a new bug (unless a crash with a very similar backtrace should mysteriously reappear). Be sure to mention that NWN uses NV_vertex_program in future bug reports that may be related. |
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.
Created attachment 29324 [details] Full backtrace of crashing NWN After starting or loading game NWN crashes printing only: " Aborted " I have bisected mesa and found that commit: 800f48258623f8caf25d013f44784edb7caa3f93 is responsible for crashes. mesa used:79f48c9f9e739a1f6b0810072e41bc826f2b789d Backtrace: #0 0xf55aed26 in rc_mesa_to_rc_program (c=0xffffc03c, program=0x135cff40) at radeon_program.c:153 #1 0xf5595930 in build_program (ctx=0xe5667c8) at r300_vertprog.c:235 #2 r300SelectAndTranslateVertexShader (ctx=0xe5667c8) at r300_vertprog.c:281 #3 0xf5592237 in r300UpdateShaders (rmesa=0xe51fc88) at r300_state.c:1982 #4 0xf55841d1 in r300TryDrawPrims (ctx=0xe5667c8, arrays=0xe5a49b8, prim=0xffffc2d0, nr_prims=1, ib=0xffffc2c0, index_bounds_valid=0 '\0', min_index=0, max_index=311) at r300_draw.c:633 #5 r300DrawPrims (ctx=0xe5667c8, arrays=0xe5a49b8, prim=0xffffc2d0, nr_prims=1, ib=0xffffc2c0, index_bounds_valid=0 '\0', min_index=0, max_index=311) at r300_draw.c:706 #6 0xf5642df0 in vbo_validated_drawrangeelements (ctx=0xe5667c8, mode=4, index_bounds_valid=<value optimized out>, start=4294967295, end=4294967295, count=1128, type=5123, indices=0x13174800) at vbo/vbo_exec_array.c:661 #7 0xf5642eae in vbo_exec_DrawElements (mode=4, count=1128, type=5123, indices=0x13174800) at vbo/vbo_exec_array.c:721 #8 0xf563a4ed in neutral_DrawElements (mode=4, count=1128, type=5123, indices=0x13174800) at main/vtxfmt_tmp.h:335 Full backtrace in attachment snippet from glxinfo: OpenGL vendor string: DRI R300 Project OpenGL renderer string: Mesa DRI R300 (RV530 71C1) 20090101 x86/MMX+/3DNow!+/SSE2 TCL OpenGL version string: 1.5 Mesa 7.6-devel