Forum > OpenGL

[SOLVED] TOpenGLControl Bug?

(1/1)

Handoko:
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  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.OpenGLControl1Paint(Sender: TObject);begin  //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?
--- End quote ---

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?

Lulu:
Hello Handoko, I try on Win10 - Lazarus 2.0.4 and the SIGSEV error don't appear.

Handoko:
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:

--- Quote from: Handoko on September 16, 2019, 06:13:56 pm ---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?

--- End quote ---

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:
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.

Navigation

[0] Message Index

Go to full version