Bug 20850

Summary: vbo_exec_vtx_flush causes Floating point exception when gets 0 vertsize.
Product: Mesa Reporter: Krzysztof A. Sobiecki <sobkas>
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED DUPLICATE QA Contact:
Severity: minor    
Priority: low CC: frank
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: I have made small patch that hacks around this problem. It's only a hack.
Vertex that causes Floating point exception.

Description Krzysztof A. Sobiecki 2009-03-24 18:54:42 UTC
Created attachment 24218 [details] [review]
I have made small patch that hacks around this problem. It's only a hack.

Function vbo_exec_vtx_flush insrc/mesa/vbo/vbo_exec_draw.c gets Floating point exception when it gets vertex that looks like this:
http://pastebin.com/m1e77aeb7

It have 0 size and by looking in code:

exec->vtx.max_vert = ((VBO_VERT_BUFFER_SIZE - exec->vtx.buffer_used) /.
                            (exec->vtx.vertex_size * sizeof(GLfloat)));

exec->vtx.vertex_size ends as 0. Id divides by 0.

With my hack I was able to run this vertex without problems.

Tested on master and radeon-rewrite
System:
Radeon X1650pro
Comment 1 Michel Dänzer 2009-03-25 01:15:58 UTC
> Function vbo_exec_vtx_flush insrc/mesa/vbo/vbo_exec_draw.c gets Floating point
> exception when it gets vertex that looks like this:
> http://pastebin.com/m1e77aeb7

Please attach that information here directly rather than linking to an external site.
Comment 2 Krzysztof A. Sobiecki 2009-03-25 05:05:56 UTC
Created attachment 24234 [details]
Vertex that causes Floating point exception.
Comment 3 Brian Paul 2009-03-25 08:06:01 UTC
Your attachment is not a vertex shader.  Is a vertex shader really involved?

Do you have a small (glut) test program to reproduce the problem?  Or can you describe what sequence of GL calls is causing this?

Comment 4 Krzysztof A. Sobiecki 2009-03-25 11:08:11 UTC
>Your attachment is not a vertex shader.  Is a vertex shader really involved?
No. I don't think so. I don't remember how "shader" thing ended here.
It might be plain VBO.
>Or can you describe what sequence of GL calls is causing this?
This might take some time
Comment 5 Frank Earl 2009-03-30 19:39:23 UTC
Hi, I'm the person doing the coding work on Linux for the application he's reporting the issue with.

The application that is producing the issue is a 32-bit game title in beta testing right at the moment.  To the best of my knowledge, the binary he's got is a testing build that's using pretty much only immediate mode rendering calls.  

The developer's website is: http://www.elecorn.com/caster3d/index.html. 

If you're wanting a binary before it goes gold, contact me and I'll arrange access for you.
Comment 6 Adam Jackson 2009-08-24 12:32:00 UTC
Mass version move, cvs -> git
Comment 7 Tormod Volden 2009-08-25 00:47:57 UTC
Fixed with commit b9b04872d526ed7955f647542399e110ace0325c.

*** This bug has been marked as a duplicate of bug 23489 ***

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.