Giter Site home page Giter Site logo

Crash on OSX on start about craft HOT 3 CLOSED

fogleman avatar fogleman commented on April 30, 2024
Crash on OSX on start

from craft.

Comments (3)

dymk avatar dymk commented on April 30, 2024

Program works as expected when the craft executable is run with the CWD as the root of the project:

./build/craft

A fix would probably be to check if the files that it's trying to access exist before continuing.

from craft.

daniel-j-h avatar daniel-j-h commented on April 30, 2024

To provide more information, it's the load_png_texture function that uses and frees the image even if it could not be loaded.

Backtrace:

#0  0x00007ffff62fe119 in raise () from /lib64/libc.so.6
#1  0x00007ffff62ff478 in abort () from /lib64/libc.so.6
#2  0x00007ffff633aaf7 in __libc_message () from /lib64/libc.so.6
#3  0x00007ffff634048e in malloc_printerr () from /lib64/libc.so.6
#4  0x000000000041b1a6 in load_png_texture (file_name=file_name@entry=0x4ccb2a "texture.png") at ../util.c:582
#5  0x0000000000411d61 in main (argc=1, argv=0x7fffffffddf8) at ../main.c:858

See: https://github.com/fogleman/Craft/blob/7e2497d87440ffd3a914076b842f972a2117771b/util.c#L580-582

And after this, the load_shader function has the same problems. Backtrace:

#0  0x00007ffff6338f6c in fseek () from /lib64/libc.so.6
#1  0x0000000000418f10 in load_file (path=<optimized out>) at ../util.c:33
#2  0x00000000004191fc in load_shader (path=<optimized out>, type=35633) at ../util.c:69
#3  load_program (path1=path1@entry=0x4ccb52 "shaders/block_vertex.glsl", path2=path2@entry=0x4ccb36 "shaders/block_fragment.glsl") at ../util.c:98
#4  0x0000000000411d70 in main (argc=1, argv=0x7fffffffddf8) at ../main.c:860

See:

Craft/util.c

Line 68 in 7e2497d

GLuint load_shader(GLenum type, const char *path) {

(Maybe there are more issues, but I have not checked it further)

from craft.

daniloegea avatar daniloegea commented on April 30, 2024

The problem is that the program search the files in the local dir. My patch fix this problem and enable you to install "craft" where you want.

#25

from craft.

Related Issues (20)

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.