GithubHelp home page GithubHelp logo

Segfault on Ubuntu about sdl-ball HOT 3 CLOSED

danielesegato avatar danielesegato commented on August 16, 2024
Segfault on Ubuntu

from sdl-ball.

Comments (3)

danielesegato avatar danielesegato commented on August 16, 2024

I've compiled the current master version (6fedb29).

It crashes the same for me on Ubuntu 21.04.

I've compiled with debugging symbols and this is the backtrace:

#0  0x00007f8574b76885 in compile_vertex_list (ctx=ctx@entry=0x55cb88b7a940) at ../src/mesa/vbo/vbo_save_api.c:746
#1  0x00007f8574b76e2b in wrap_buffers (ctx=0x55cb88b7a940) at ../src/mesa/vbo/vbo_save_api.c:868
#2  0x00007f8574b7742c in upgrade_vertex (ctx=ctx@entry=0x55cb88b7a940, attr=attr@entry=7, newsz=newsz@entry=2) at ../src/mesa/vbo/vbo_save_api.c:975
#3  0x00007f8574b776b9 in fixup_vertex (newType=5126, sz=2, attr=7, ctx=0x55cb88b7a940) at ../src/mesa/vbo/vbo_save_api.c:1079
#4  _save_TexCoord2f (x=0, y=0) at ../src/mesa/vbo/vbo_attrib_tmp.h:268
#5  0x000055cb87963f7e in mkDLscene(unsigned int*, textureClass) (dl=0x7ffe5f66ff90, tex=...) at main.cpp:2934
#6  0x000055cb8796c959 in main(int, char**) (argc=1, argv=0x7ffe5f6a7828) at main.cpp:4056

the main.c portion is this one

void mkDLscene(GLuint *dl,textureClass tex)
{
  //Scenen
  *dl = glGenLists(1);
  glNewList(*dl,GL_COMPILE);
    glLoadIdentity();
    glTranslatef( 0.0f, 0.0f, -3.0 );
    glColor4f(1.0, 1.0, 1.0, 1.0);
    glEnable(GL_TEXTURE_2D);
    glBindTexture(GL_TEXTURE_2D, tex.prop.texture);
    glBegin( GL_POINTS );
      glVertex3f( -1.60, 1.25, 0.0 );
    glEnd( );
    glBegin( GL_QUADS );
      //venstre kant
      glTexCoord2f(0.0f,0.0f);glVertex3f( -1.66, 1.25, 0.0 ); // <------ HERE specifically
      glTexCoord2f(1.0f,0.0f);glVertex3f( -1.60, 1.25, 0.0 );
      glTexCoord2f(1.0f,-1.0f);glVertex3f( -1.60,-1.25, 0.0 );
      glTexCoord2f(0.0f,-1.0f);glVertex3f( -1.66,-1.25, 0.0 );
      //højre kant
      glTexCoord2f(0.0f,0.0f);glVertex3f( 1.66, 1.25, 0.0 );
      glTexCoord2f(1.0f,0.0f);glVertex3f( 1.60, 1.25, 0.0 );
      glTexCoord2f(1.0f,-1.0f);glVertex3f( 1.60,-1.25, 0.0 );
      glTexCoord2f(0.0f,-1.0f);glVertex3f( 1.66,-1.25, 0.0 );
    glEnd( );
  glEndList();
}

Ubuntu version for libgl1-mesa-dri is 21.0.3-0ubuntu0.3 amd64

which means the code of the crashing file happens here https://github.com/grate-driver/mesa/blob/21.0.3/src/mesa/vbo/vbo_save_api.c#L746

I really don't get the No such file or directory in the backtrace.

I don't see anything wrong with the code and my experience with C++ and Open-GL is too limited to know what's causing this.

from sdl-ball.

danielesegato avatar danielesegato commented on August 16, 2024

If I comment out all this part:

    glBegin( GL_QUADS );
      //venstre kant
      glTexCoord2f(0.0f,0.0f);glVertex3f( -1.66, 1.25, 0.0 ); // <------ HERE specifically
      glTexCoord2f(1.0f,0.0f);glVertex3f( -1.60, 1.25, 0.0 );
      glTexCoord2f(1.0f,-1.0f);glVertex3f( -1.60,-1.25, 0.0 );
      glTexCoord2f(0.0f,-1.0f);glVertex3f( -1.66,-1.25, 0.0 );
      //højre kant
      glTexCoord2f(0.0f,0.0f);glVertex3f( 1.66, 1.25, 0.0 );
      glTexCoord2f(1.0f,0.0f);glVertex3f( 1.60, 1.25, 0.0 );
      glTexCoord2f(1.0f,-1.0f);glVertex3f( 1.60,-1.25, 0.0 );
      glTexCoord2f(0.0f,-1.0f);glVertex3f( 1.66,-1.25, 0.0 );
    glEnd( );

the game works, and I've seen no issue with it (maybe it does not draw some border?

from sdl-ball.

DusteDdk avatar DusteDdk commented on August 16, 2024

Wow, I wonder what I did that was so horrible that it made mesa crash xD well, to be honest, sdl-ball was my second-ever opengl program, I had no idea what I was doing xD I vaguely recall just sitting and adjusting floats until stuff "looked right" on the screen :D

from sdl-ball.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.