Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Linux] Potential demo crash on startup #1

Open
alansley opened this issue Jan 22, 2016 · 9 comments
Open

[Linux] Potential demo crash on startup #1

alansley opened this issue Jan 22, 2016 · 9 comments
Assignees

Comments

@alansley
Copy link
Collaborator

On 64-bit Arch Linux (Kernel 4.3.3-3) using Nvidia 358.16-1 and jdk8-openjdk 8.u72-1, libGL.so may cause the demo application to crash on startup. This issue does not appear to be specific to Caliko - even a simple LWJGL3 program that initialises and then immediately terminates causes the same crash behaviour.

A workaround for this issue is to run the demo application from source code in an IDE such as Eclipse and choose to run it via "Debug As..." rather than "Launch As..." - quite why this works while a standard launch does not is currently unknown.

The Windows platform does not exhibit this issue.

Error log:
hs_err_pid9892.log.txt

Forum discussion with LWJGL3 developer regarding the issue:
http://forum.lwjgl.org/index.php?topic=6048.0

@alansley alansley self-assigned this Jan 22, 2016
@alansley
Copy link
Collaborator Author

alansley commented Feb 4, 2016

This issue is fixed in Nvidia drivers 361.18-3. Closing issue.

@alansley alansley closed this as completed Feb 4, 2016
@alansley alansley reopened this Jun 2, 2016
@alansley
Copy link
Collaborator Author

alansley commented Jun 2, 2016

Aaaaaand the issue is back with the latest NVidia 364.19-3 drivers (again under Linux only - on Windows creating the actual OpenGL window doesn't cause the segfault).

@alansley
Copy link
Collaborator Author

alansley commented Jun 15, 2016

Fixed again in NVidia 367.27-1 drivers on Linux... let's hope it stays fixed this time. Leaving this open for a while in case it breaks again.

@alansley
Copy link
Collaborator Author

Doesn't seem to be a problem anymore. Closing.

@jillemash
Copy link

Hi, I've tried to execute the demo on 3 machines (2 MacBook Pro and a Windows 10 PC) and I always had a crash, similar to the one you reported.
(I also add other errors, but I don't remember exactly the message, something about OpenGL not being installed...)
I've managed to finally launch the demo but I had to:

  • add -XstartOnFirstThread VM arg ( saw here https://stackoverflow.com/a/56539190 and elsewhere)
  • Uncomment Fwd compat hint line (OpenGLWindow:93)
  • Comment ShaderProgram:392 to not throw RuntimeException "Could not validate shader program"...

My intention was not to debug/go deep in the OpenGL code, but just to launch the demo to get a better understanding of the FABRIK implementation, so clearly the last one is a hackish workaround, the second, well you must have commented it for a reason, but I need to uncomment it.
But the first one seems like something worth mentioning in the README.md or the User Guide as I saw this advice more than once (at least in a troubleshooting section for those who cannot make it work out of the box).

Worked on MacBook Pro 15" mid 2012, MacOS Catalina 10.15.3.
I haven't tried these hacks on the other 2 machines.

Thanks.

@alansley
Copy link
Collaborator Author

Thanks for your feedback.

Unfortunately I don't own any Mac hardware to test things on, but if I uncommented the forward compatability hint and just made the shader validation report an error without actually throwing a RuntimeException then (asides from lines, see below) things should all work the same, and all that would be needed is for the README & documentation to make clear that the -XstartOnFirstThread argument is required on Macs.

If I recall, I commented the forward compatibility hint because forward-compatible OpenGL doesn't provide variable line widths (i.e. if you wanted a thick line you might ask it to be drawn 3 pixels wide). No doubt there's a way to display lines of variable thickness in forward-compat mode, but I might have to modify the fragment shaders.

I'm surprised about the Windows 10 error as OpenGL libraries should be installed as part of your graphics drivers.

You say that you saw the -XstartOnFirstThread argument in a troubleshooting section - do you mean for Caliko or just for general OpenGL-using apps? If the former would you mind providing a link as I haven't seen anyone doing much Caliko troubleshooting!

Again, thanks for your feedback & I'll aim to get things documented / cleaned up in short order.

Cheers.

@alansley alansley reopened this Mar 19, 2020
@jillemash
Copy link

Hi,

thanks for your quick reply :).
Yes I managed to make it work with the steps I described, uncommenting the compatibility, and the exception throw along with the VM option (on Mac).

As for the OpenGL error, I don't remember exactly in which scenario it occurs, I've tried several things pretty randomly, like changing the version, commenting, uncommenting hints...) so I don't want to be misleading with this. I'm not sure to have the time to investigate on how to reproduce it on Windows, but if I do, I'll make a better report. I've no experience with LWJGL, I just wanted to make the demo work to study the algorithm ;).

Sorry I was unclear in the way I formulated my sentence about the troubleshooting section:
I didn't find any troubleshooting of Caliko about this options, I just meant to say that maybe it should be in a troubleshooting section in the Caliko documentation (or in the README.md or in the user guide).

Thanks again, this project is great and neatly documented: really appreciated :).

JM

@salamanders
Copy link

For anyone stuck with a crashing demo, I put together the following very ugly hack in kotlin, and then I refresh a browser open to the svg file to see if the solution looks sane.

fun FabrikStructure2D.chains(): List<FabrikChain2D> = (0 until numChains).map { getChain(it) }
fun FabrikChain2D.bones() : List<FabrikBone2D> = (0 until numBones).map { getBone((it)) }

fun FabrikStructure2D.debug(
    target:Vec2f? = null
) {
    chains().forEachIndexed { ci, chain ->
        println()
        chain.bones().forEachIndexed { bi, bone ->
            println("Chain $ci Bone $bi")
            println("  dir: ${bone.directionUV}")
            if(bi==0) {
                println("  Angle from LEFT:${bone.directionUV.getSignedAngleDegsTo(LEFT)}")
            } else {
                println("  Angle from previous: ${chain.getBone(bi-1).directionUV.getSignedAngleDegsTo(bone.directionUV)}")
            }
            println("  Loc:  -> ${bone.endLocation}")
        }
    }

    File("debug.svg").printWriter().use {pw->
        pw.println("""<svg viewBox="-100 -100 200 200" xmlns="http://www.w3.org/2000/svg">""")
        chains().forEach { chain->
            val chainStart = chain.bones().first().startLocation!!
            pw.println(""" <circle cx="${chainStart.x}" cy="${chainStart.y * -1}" r="3" fill="green" fill-opacity="0.5"/>""")
            val chainEnd = chain.bones().last().endLocation!!
            pw.println(""" <circle cx="${chainEnd.x}" cy="${chainEnd.y * -1}" r="3" fill="red" fill-opacity="0.5"/>""")

            chain.bones().forEach { bone->
                pw.println(""" <line x1="${bone.startLocation.x}" y1="${bone.startLocation.y * -1}" x2="${bone.endLocation.x}" y2="${bone.endLocation.y  * -1}" stroke="black" />""")
            }
        }
        target?.let {
            pw.println(""" <circle cx="${it.x}" cy="${it.y * -1}" r="3" fill="blue" fill-opacity="0.5"/>""")
        }
        pw.println("</svg>")
    }
}

@alansley
Copy link
Collaborator Author

alansley commented Aug 8, 2020

While it's super-cool that you did that, you really shouldn't have had to - the demo should just work (if you're on a mac you'll need to make adjustments as per this comment and rebuild the library.

Also, it's more fun to play with when updating live =D

What's the exact error you're getting?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants