πŸ€‘ Indie game storeπŸ™Œ Free gamesπŸ˜‚ Fun games😨 Horror games
πŸ‘· Game development🎨 AssetsπŸ“š Comics
πŸŽ‰ Sales🎁 Bundles

[v2] Trouble Building...

A topic by casm created 79 days ago Views: 237 Replies: 24
Viewing posts 1 to 20
(Edited 3 times)

Assertion failed: fbconfig != 0 (./gpulib.h: GpuSysX11Window: 547)
I've searched around and rebuilt with stdlib_assert(glxQueryExtension(<args omitted>) != 0) in gpulib.h and it passed. So I'm not sure what's going on.

I have an NVIDIA gpu.

Developer (Edited 1 time)

Thank you for reporting this! Very interesting. It basically means this block of code (from line 510 to 547) iterated over all available framebuffers and couldn't choose any of them.

Did it worked by replacing that assert line with `stdlib_assert(glxQueryExtension(<args omitted>) != 0)`?

Which GPU model do you have?

just in case you didn't get notified with my other post. not sure how this board works.

stdlib_assert(glxQueryExtension(<args omitted>) != 0) just confirmed that GL is available for me, it didn't fix anything.

 lspci | grep VGA
01:00.0 VGA compatible controller: NVIDIA Corporation GM206 [GeForce GTX 960] (rev a1)

I think I'm gonna remove my GPU and see what happens when I use the integrated gpu on my cpu
Developer

OK, I think this is my mistake! I uploaded new GpuLib commit.

Apparently fbconfig 0 is a valid id, I think Mesa guys did this for people who don't care to iterate over all available ones. I used to check against 0 in assert, now I check against -1. This should fix the problem!

I will upload lib0 engine v2.1 binaries right now...

Awesome! Can't wait to try it out.

Developer (Edited 1 time)

Actually no, the logic was correct the first time, GLXFBConfig is a pointer typedef, it's 0 only when fbconfig is not choosed indeed...

But! You can download v2.1 and change line 535 of gpulib.h from:

#if 0

to:

#if 1

It will print all the available framebuffer configs to the console, copy it and paste here for me to see where a problem might be!

Also, could you run `glxinfo` command in a terminal and paste all the info it'll print here?

Thanks!

$ ./main # after 1ing the static if
Assertion failed: fbconfig != NULL (./gpulib.h: GpuSysX11Window: 582)
Aborted (core dumped)

glxinfol....

https://pastebin.com/qUsgGb0f

Developer
$ ./main # after 1ing the static if
Assertion failed: fbconfig != NULL (./gpulib.h: GpuSysX11Window: 582)
Aborted (core dumped)

Oh, I forgot to mention you have to run `/tmp/lib0_engine/build_main.sh -O0 -g` to recompile and print it!

glxinfol....
https://pastebin.com/qUsgGb0f

Thank you very much! Looking at it right now...

(Edited 1 time)

$ ./build_main.sh -O0 -g

$ ./main
Assertion failed: fbconfig != NULL (./gpulib.h: GpuSysX11Window: 582)
Aborted (core dumped)


i'm going to bed now. i appreciate all the work you're putting into helping me. hopefully we can get it building soon. i'll check back tomorrow during lunch.

Developer

Just uploaded v2.2, try it!

Same result, unfortunately...

$ ./main
Assertion failed: fbconfig != NULL (./gpulib.h: GpuSysX11Window: 583)
Aborted (core dumped)

$ ./build.sh
TextEditor.cpp:209:32: error: use of undeclared identifier 'floor'
        int lineNo = std::max(0, (int)floor(local.y / mCharAdvance.y));
                                      ^
TextEditor.cpp:210:37: error: use of undeclared identifier 'round'
        int columnCoord = std::max(0, (int)round(local.x / mCharAdvance.x - cTe...
                                           ^
TextEditor.cpp:503:21: error: use of undeclared identifier 'floor'
        auto lineNo = (int)floor(scrollY / mCharAdvance.y);
                           ^
TextEditor.cpp:504:76: error: use of undeclared identifier 'floor'
  ...lineMax = std::max(0, std::min((int)mLines.size() - 1, lineNo + (int)floor((scr...
                                                                          ^
TextEditor.cpp:1524:22: error: use of undeclared identifier 'ceil'
        auto top = 1 + (int)ceil(scrollY / mCharAdvance.y);
                            ^
TextEditor.cpp:1525:21: error: use of undeclared identifier 'ceil'
        auto bottom = (int)ceil((scrollY + height) / mCharAdvance.y);
                           ^
TextEditor.cpp:1527:19: error: use of undeclared identifier 'ceil'
        auto left = (int)ceil(scrollX / mCharAdvance.x);
                         ^
TextEditor.cpp:1528:20: error: use of undeclared identifier 'ceil'
        auto right = (int)ceil((scrollX + width) / mCharAdvance.x);
                          ^
TextEditor.cpp:1546:14: error: use of undeclared identifier 'floor'
        return (int)floor(height / mCharAdvance.y);
                    ^

I've been getting the errors from `build.sh` since the beginning, just deciding to include them now before bed.


Thanks again. Talk to you tomorrow.

Developer

If recompiling didn't made it print anything, it can mean only one thing: fbconfigs_count is equal to 0 and for loop is never executed.

Hopefully v2.2 will fix this, if not we may have to do some GDB debugging magic :)

Developer (Edited 7 times)

Added <cmath> header to TextEditor.cpp in v2.3 release to eliminate compile time errors you get, try it! Weird that Clang 3.8 and 3.9 don't have this issue, apparently some standard header files include math for some compilers (versions?), but not for others.

For assert issue, I'm now checking `fbconfigs_count` and `fbconfigs` pointer on 0 and NULL values to make sure it's `glXChooseFBConfig` who is failing here.

P. S. If everything compiles correctly now, you can try to remove all asserts on reported lines to see what may happen. Probably nothing good, but you can try!

P. P. S. Also you can try to remove lines 524 and 525 from gpulib.h, maybe there are no framebuffers which support MSAA antialiasing. Unlikely, but worth trying. Generally, you can try to remove these lines one by one from `int glx_attribs[]` struct to see if any of this will make the difference.

$ ./main
Assertion failed: fbconfigs_count != 0 (./gpulib.h: GpuSysX11Window: 532)
Aborted (core dumped)

Looks like you're correct -- fbconfigs_count is 0 for some reason.

$ ./main
fbconfigs[0]: 0000000001c393f0, GLX_RED_SIZE: 8, GLX_GREEN_SIZE: 8, GLX_BLUE_SIZE: 8, GLX_ALPHA_SIZE: 8, GLX_DEPTH_SIZE: 24, GLX_STENCIL_SIZE: 8, GLX_DOUBLEBUFFER: 1, GLX_SAMPLE_BUFFERS: 0, GLX_SAMPLES: 0
fbconfigs[1]: 0000000001c395d0, GLX_RED_SIZE: 8, GLX_GREEN_SIZE: 8, GLX_BLUE_SIZE: 8, GLX_ALPHA_SIZE: 8, GLX_DEPTH_SIZE: 24, GLX_STENCIL_SIZE: 8, GLX_DOUBLEBUFFER: 1, GLX_SAMPLE_BUFFERS: 0, GLX_SAMPLES: 0
Segmentation fault (core dumped)

This is after removing 524 and 525.

Thread 1 "main" received signal SIGSEGV, Segmentation fault.
0x00007fffec3f605e in GpuSysGetOpenGLProcedureAddresses () from /tmp/lib0_engine/lib0.so

after running through gdb
Developer (Edited 1 time)

Cool! Yeah, you have to remove MSAA lines for now given GLX_SAMPLE_BUFFERS: 0, GLX_SAMPLES: 0 framebuffers.

As for:

Thread 1 "main" received signal SIGSEGV, Segmentation fault. 0x00007fffec3f605e in GpuSysGetOpenGLProcedureAddresses () from /tmp/lib0_engine/lib0.so
after running through gdb

This is another bug I currently investigate and will fix today. I will also write a big post about it because it involves broken compilers and lying debuggers.

Developer (Edited 4 times)

Actually, for:

Thread 1 "main" received signal SIGSEGV, Segmentation fault. 0x00007fffec3f605e in GpuSysGetOpenGLProcedureAddresses () from /tmp/lib0_engine/lib0.so

You can help me by ascii recording gdb tui (with register and assembly layouts enabled) instruction stepping (si) after main.c:31 line, because I can't reproduce this issue on two different computers with the same Ubuntu 16.04.

Developer (Edited 1 time)

Pushed v2.4 to solve fbconfigs_count is 0 error. As for SIGSEGV bug, I logged it in  [v2] Known issues topic, will see what I can do here without being able to reproduce it. Maybe I'll install an Arch Linux and try it there, dunno.

Developer (Edited 1 time)

Can confirm: crashes on Arch Linux (Manjaro MATE in my case), but not on Ubuntu 16.04. Linux user space people are all fired.

Investigating...

Developer (Edited 14 times)

It's a Mesa bug.

Here's a screenshot of lib0 engine running with a custom Mesa build (and now Arch Linux's stock Mesa 17.2.6) on Manjaro MATE 17.0.4:

It looks normal, but it's actually broken because when I try to switch focus from a terminal to lib0 engine window the whole desktop screen turns black.

This forces me to ban any other distro that can't execute code that works just fine on Ubuntu 16.04 and Mesa 17.0.7 until a person who understands the inner workings of graphics drivers will explain this random behavior. At no point I, as a software developer, should care about any of this given the same binary runs perfectly fine under another environment.

lib0 engine requirements are updated.
Developer (Edited 5 times)

Version 3 is here!

Build process and the crash on Arch Linux are fixed thanks to MārtiΕ†Ε‘ MoΕΎeiko, but the black screen bug I mentioned in the previous post is still present, so don't wait any support for Arch Linux or any other distro from me for now. But you always can try it yourself and see if it works, of course.

Developer

Version 6 is here!

The black screen issue I had on one machine with Manjaro MATE disto and another machine with Ubuntu 18.04 and LXDE, but not on a machine with Ubuntu 18.04 and GNOME desktop environment, is fixed. It looks like some DEs reserve the last fbconfig for themselves.

I removed the strict distro requirement, but using distros other than Ubuntu is still discouraged since I currently see a possible Mesa regression bug when it doesn't generate mipmaps for cubemap images (Ubuntu 18.04's Mesa 17.2.4 works fine, Manjaro's Mesa 17.2.6 and higher have this bug).

Developer (Edited 1 time)
If you are making use of the Mesa 17.3 releases, have you found them to be buggier than normal for this open-source 3D graphics driver stack? There remains a higher than average amount of bugs still outstanding that have plagued Mesa 17.3, even with being up to 17.3.5. 
https://www.phoronix.com/scan.php?page=news_item&px=Mesa-17.3-Remains-Buggy