-
Notifications
You must be signed in to change notification settings - Fork 114
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
Chapter 13 segfaults in Mono under Ubuntu, but runs OK (but slowly) in debug mode. #1
Comments
Thanks for the bug report. What GPU do you have? I believe, by default, Ubuntu uses an open source driver on NVidia GPUs (and possibly others), and provides an option to install the official NVidia one. Does your GPU have this situation? If so, have you tried both drivers? |
This is on a GeForce GTX 660 running the 310.14 drivers (OS standard.) I don't use the open source drivers since they are no good for 3D. I also tried with newer drivers and had the same result. I nuked my copy and cloned fresh from the repo so I could try again. Crashes seem to happen anywhere from immediately to several minutes in. Sometimes the window will appear for a moment and immediately crash, and other times it will run for a few minutes. Running it several times in a row and just leaving it alone completely yields a different result each time. Sometimes the console will show it downloading two terrain files from NASA and then crashing; other times it will download six or ten; at the moment it's downloaded hundreds. I don't know of any obvious thing that would change from one session to the next except that it takes varying amounts of time to connect and download the terrain data. Off the top of my head, I guess it's possible that it could be trying to render based on data that isn't there yet? Framerate also doesn't seem too good even in Release mode. It's fine in other OpenGL apps. |
Did a little more testing. I let it run untouched until it had downloaded everything it wanted to for the default view. It doesn't seem to crash if the camera is not moved, even for long periods. Switched to flycam and started zooming around the planet at 20KM/sec. It was fine for about 30 seconds, but then it crashed. (It will also crash in look-at.) |
I just tried it out on my Ubuntu 11.04 system with an NVidia GTS 250 and NVidia driver version 280.13. No issues that I could see. Performance could be better (and it is in Windows) but it's not terrible. I'll upgrade to 12.04 (Update Manager isn't giving me the option to go to 12.10?) and try again. If you have any other ideas for things I might try, let me know. By the way, if you're looking for a solid example of a terrain engine, I recommend you take a look at Cesium (http://cesium.agi.com/). It's much more polished and performant engine than the one in OpenGlobe, and I say that as the author of both. Cesium is JavaScript and WebGL if that sways you either way. |
You might have to upgrade stepwise. 12.04 is the long term support release. I installed 12.10 because a lot of the libs and apps are newer / get updated more often, and I figured it was the frontrunner Linux distro that most gamers would be likely to use. (Valve Software has the same idea.) We were hoping to use something C# / regular OpenGL based, and we have copies of the 3D Globes book, so we figured we'd start from here. It might just be down to the newer version of Mono being touchy about something. Can you tell me the Mono version you have, and the output of ldd /path/to/mono? Maybe that will help narrow it down. Also, are you using 32- or 64-bit? That seems to make a difference. Here's the shared libs on 64-bit 12.10:
We also compiled Chapter 13 using Xamarin or whatever it's called (monodevelop derivative) on Windows, and it didn't crash, although it would have been running on .Net rather than Mono. (So much for "write once, run everywhere.") I will have our client dev guy look at Cesium. Is there anything off the top of your head that would make it render so much faster? It runs great on Chromium! |
It was the 64-bit version, and I believe Mono 2.10.5. The upgrade to 12.04 totally busted me though - my keyboard and mouse don't work anymore. I'll do a clean install of 12.10 and try that, but give me a few days. I guess there are a number of reasons Cesium might be faster. It's a different terrain LOD algorithm, for one thing. Cesium closely follows Chapter 14 in our book (Chunked LOD). Cesium is also much more mature and optimized, even though there is plenty more to be done. The JavaScript engine in Chromium is also perhaps generating more optimal code than Mono's .NET runtime. |
I did a clean install of 64-bit 12.10. It took me a few to figure out how to install the proprietary NVidia driver (it didn't pop right up with it as it had in previous versions of Ubuntu), but once I did, the clipmap example worked well in both the debug and release configurations. I'm using driver version 304.51 according to
I tried installing the experimental NVidia driver first, and after I rebooted and logged in, I got a blank screen with just the mouse cursor and the desktop background instead of the normal Unity environment. I was able to fix it by issuing these commands, following instructions I found somewhere:
I mention this in the unlikely event that installing the linux source or headers somehow made a difference for OpenGlobe. Have you been able to duplicate the problems you see on another machine? |
I tried reinstalling mono and libmono:
It seemed to be more willing to run, but eventually it would crash again... Managed to get another trace out of it:
I might just have to try reinstalling. It's a different problem every run. |
I can get every chapter to run, except for the last. It starts downloading terrain from NASA. The window will show up. But then, almost immediately, it crashes. I noticed some SIGPWR and SIGXCPU signals being raised right before it crashes. SIGPWR I have no idea about. SIGXCPU means it exceeded the allowed CPU time, but the CPU usage limit is infinite. (I read somewhere that Mono uses SIGXCPU internally, so it doesn't actually mean that.)
For some odd reason, it doesn't crash if I run it in debug mode. (It just runs really, REALLY slow.) Since it won't crash that way, I can't step through the code and find out where the issue is myself. The code was compiled with MonoDevelop 3.0.3.2, which is the standard version you get with Ubuntu. Mono is also the standard version.
I also tried running mono with --trace turned on, but it never produced an actual window or crashed after half an hour, so I gave up.
Here's some info I collected. Let me know if anything else is needed.
strace output, near the end:
futex(0x8f0cc0, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted)
--- SIGPWR (Power failure) @ 0 (0) ---
futex(0x926fc0, FUTEX_WAKE_PRIVATE, 1) = 1
rt_sigsuspend(~[INT QUIT ABRT TERM XCPU RTMIN RT_1]) = ? ERESTARTNOHAND (To be restarted)
--- SIGXCPU (CPU time limit exceeded) @ 0 (0) ---
rt_sigreturn(0x7f8a9fda5740) = -1 EINTR (Interrupted system call)
futex(0x926fc0, FUTEX_WAKE_PRIVATE, 1) = 1
rt_sigreturn(0x926fc0) = 202
futex(0x8f0cc0, FUTEX_WAIT_PRIVATE, 2, NULL) = 0
futex(0x8f0cc0, FUTEX_WAKE_PRIVATE, 1) = 0
getpid() = 7710
getpid() = 7710
getpid() = 7710
(getpid repeated about 100 more times...)
Stacktrace:
Native stacktrace:
getpid() = 7710
getpid() = 7710
getpid() = 7710
getpid() = 7710
getpid() = 7710
getpid() = 7710
getpid() = 7710
getpid() = 7710
+++ killed by SIGSEGV (core dumped) +++
Segmentation fault (core dumped)
The text was updated successfully, but these errors were encountered: