Recent

Author Topic: [SOLVED] TOpenGLControl Bug?  (Read 5721 times)

Handoko

  • Hero Member
  • *****
  • Posts: 5131
  • My goal: build my own game engine using Lazarus
[SOLVED] TOpenGLControl Bug?
« on: September 16, 2019, 06:13:56 pm »
I remember the problem started to happen when I used Lazarus 2.0.2. But because I can simply ignore it and everything seemed to run fine so I didn't try to solve it. Today I updated to Lazarus 2.0.4, the problem still exists.

1. Start a new application project
2. Put a
TOpenGLControl on the form
3. Compile and run, then exit the program
4. So far, so good
5. Put some code in the TOpenGLControl.
Paint event (even an empty comment)

Code: Pascal  [Select][+][-]
  1. procedure TForm1.OpenGLControl1Paint(Sender: TObject);
  2. begin
  3.   //
  4. end;

5. Compile and run, then exit the program
6. A SIGSEGV error shows up (see screenshot below)
7. And then it will ask you to locate lockf.c

Quote
The file "/build/glibc-KRRWSm/glibc-2.29/io/lockf.c" was not found.
Do you want to locate it yourself?

The error only shows up when run it from the Lazarus IDE, not the binary directly.
Tested on Lazarus 2.0.2 and Lazarus 2.0.4 GTK2 Ubuntu 64-bit.

I found a post, which has similar error message:
https://forum.lazarus.freepascal.org/index.php/topic,45274.msg319962.html
They said it is GDB issue.

So my question are:
Why it only happens on Lazarus 2.0.2 and 2.0.4?
Is it only me or do you also have same issue?
How to fix it?
« Last Edit: September 06, 2020, 08:19:34 am by Handoko »

Lulu

  • Full Member
  • ***
  • Posts: 226
Re: TOpenGLControl Bug?
« Reply #1 on: October 12, 2019, 10:04:09 pm »
Hello Handoko, I try on Win10 - Lazarus 2.0.4 and the SIGSEV error don't appear.
wishing you a nice life

Handoko

  • Hero Member
  • *****
  • Posts: 5131
  • My goal: build my own game engine using Lazarus
Re: TOpenGLControl Bug?
« Reply #2 on: October 14, 2019, 06:29:56 pm »
Thanks Lulu for the info.

I was thinking it is an OS related issue, now I'm even more sure about it. I remember the problem happened after I upgraded my Ubuntu. I heard Ubuntu 19.10 will be released soon, I will test it and report back the result.

FangQ

  • Full Member
  • ***
  • Posts: 134
Re: TOpenGLControl Bug?
« Reply #3 on: September 06, 2020, 06:12:38 am »
So my question are:
Why it only happens on Lazarus 2.0.2 and 2.0.4?
Is it only me or do you also have same issue?
How to fix it?

I am seeing exactly the same error on Ubuntu 18.04 with Lazarus 2.0.8 and GLScene (installed from online package manager). nvidia 2060 GPU with 450.66 driver (GL_VERSION:4.6.0)

The error can be reproduced by running the GLScene builtin example Texture3D (/home/username/.lazarus/onlinepackagemanager/packages/GLSceneLCL/Examples/Textures/Texture3D/). The error window pops up then closing the window. I have a program that was derived from Texture3D, also has the same error.

It did not happen on older Ubuntu running mesa OpenGL.

any workaround?

Handoko

  • Hero Member
  • *****
  • Posts: 5131
  • My goal: build my own game engine using Lazarus
Re: TOpenGLControl Bug?
« Reply #4 on: September 06, 2020, 08:19:14 am »
Hello, I'm back to report what I found. I think I already solved the problem. Sorry for the late reply.

The backstory (I think maybe important)

My computer has been using Ubuntu since many years ago. And it usually has an NVidia VGA added. When OS updates and upgrades were available I did it. So the settings on my computer were kept and carried to every next updates and upgrades. TOpenGLControl was working without problem but not until a year ago.

Strange thing happened on my Lazarus. I got SIGSEGV error if I re-compile and run my projects that have TOpenGLControl. But if I run the binaries that had been created previously, they worked perfectly. That made me think recent version of TOpenGLControl was containing bug.

No, I was wrong. After many clean installations, experiments and deep thinking. I finally know what really happened.

Thing I did that trigger the problem

A year ago I performed an upgrade but I removed the VGA right before upgrading the OS.

After that upgrade my computer still seemed to work correctly, I still could play some simple OpenGL games (without NVidia card) using only the onboard VGA. But I started to have the TOpenGLControl issue.

What really happened?

When Ubuntu installs a NVidia driver, Ubuntu will also install OpenGL related libraries to the system. If the card is missing, Ubuntu will switch the driver to its default VGA driver. But it does not properly set the OpenGL driver, even we manually uninstall the NVidia driver.

Fixing the problem

I found no solution from the Internet. But after gathering several information I finally can fix it. On my system I only need to run this on my terminal:

sudo ln -s /usr/lib/x86_64-linux-gnu/libGL.so.1 /usr/lib/libGL.so

I hope it can also be useful to others.
« Last Edit: September 06, 2020, 08:26:54 am by Handoko »

 

TinyPortal © 2005-2018