zzattack / ccmaps-net

Maps renderer for several Command & Conquer games
GNU General Public License v3.0
58 stars 22 forks source link

Crash with libOSMesa.so.8 on Linux #4

Closed Mailaender closed 10 years ago

Mailaender commented 11 years ago

I had to adjust OpenTK.config and change the line to libOSMesa.so.8 to avoid .dll not found errors, but it will crash hard anyway:

mono --debug CNCMaps.exe --mixdir=/home/matthias/.wine/drive_c/Westwood/SUN/ --infile=/home/matthias/.wine/drive_c/Westwood/SUN/fsgdi01.map --force-fs --force-ts --outdir=./ --outfile=test.png -p       
0.0043 [Info] Initializing virtual filesystem
0.0069 [Info] Initializing filesystem on /home/matthias/.wine/drive_c/Westwood/SUN/, without Yuri's Revenge support
0.0099 [Info] Parsing fsgdi01.map
0.0122 [Info] Reading tiles
0.0138 [Info] Reading map overlay
0.0140 [Info] Reading map overlay objects
0.0141 [Info] Reading map terrain object
0.0141 [Info] Reading infantry on map
0.0143 [Info] Reading vehicles on map
0.0143 [Info] Reading aircraft on map
0.0144 [Warn] Aircraft section unavailable in fsgdi01.map
0.0144 [Info] Reading map structures
0.0146 [Info] Parsing rules.ini
0.0189 [Info] Parsing art.ini
0.0215 [Debug] Initializing DrawingSurface with dimensions (200,200), pixel format Format32bppArgb
Stacktrace:                                                                                                                   

  at (wrapper managed-to-native) OpenTK.Platform.Mesa.MesaContext.OSMesaMakeCurrent (OpenTK.ContextHandle,intptr,OpenTK.Graphics.OpenGL.PixelType,int,int) <IL 0x0002a, 0xffffffff>                                                                         
  at OpenTK.Platform.Mesa.MesaContext.MakeCurrent (OpenTK.Platform.IWindowInfo) <IL 0x0003c, 0x0009b>                         
  at OpenTK.Graphics.GraphicsContext.MakeCurrent (OpenTK.Platform.IWindowInfo) <IL 0x00007, 0x0001c>                          
  at CNCMaps.MapLogic.VoxelRenderer..ctor () [0x000a5] in /home/matthias/Projekte/ccmaps-net/CNCMaps/MapLogic/VoxelRenderer.cs:26                                                                                                                           
  at CNCMaps.MapLogic.Drawable..cctor () <IL 0x0000a, 0x00033>                                                                
  at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) <IL 0x0004c, 0xffffffff>               
  at CNCMaps.MapLogic.MapFile.LoadMap (CNCMaps.EngineType) [0x001d7] in /home/matthias/Projekte/ccmaps-net/CNCMaps/MapLogic/MapFile.cs:237                                                                                                                  
  at (wrapper remoting-invoke-with-check) CNCMaps.MapLogic.MapFile.LoadMap (CNCMaps.EngineType) <IL 0x00039, 0xffffffff>      
  at CNCMaps.Program.Main (string[]) [0x0064d] in /home/matthias/Projekte/ccmaps-net/CNCMaps/Program.cs:107                   
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00050, 0xffffffff>      

Native stacktrace:                                                                                                            

Debug info from gdb:                                                                                                          

warning: File "/usr/bin/mono-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load:%{_root_bindir}/mono-gdb.py".                                                                                        
[Thread debugging using libthread_db enabled]                                                                                 
Using host libthread_db library "/lib/libthread_db.so.1".                                                                     
[New Thread 0xb5783b40 (LWP 5242)]                                                                                            
[New Thread 0xb63d2b40 (LWP 5241)]                                                                                            
[New Thread 0xb6bd3b40 (LWP 5240)]                                                                                            
[New Thread 0xb73d4b40 (LWP 5239)]                                                                                            
0xb7779424 in __kernel_vsyscall ()                                                                                            
  Id   Target Id         Frame                                                                                                
  5    Thread 0xb73d4b40 (LWP 5239) "mono" 0xb7779424 in __kernel_vsyscall ()                                                 
  4    Thread 0xb6bd3b40 (LWP 5240) "mono" 0xb7779424 in __kernel_vsyscall ()                                                 
  3    Thread 0xb63d2b40 (LWP 5241) "mono" 0xb7779424 in __kernel_vsyscall ()                                                 
  2    Thread 0xb5783b40 (LWP 5242) "mono" 0xb7779424 in __kernel_vsyscall ()                                                 
* 1    Thread 0xb7555700 (LWP 5238) "mono" 0xb7779424 in __kernel_vsyscall ()                                                 

Thread 5 (Thread 0xb73d4b40 (LWP 5239)):                                                                                      
#0  0xb7779424 in __kernel_vsyscall ()                                                                                        
#1  0xb7707a4c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0                                                 
#2  0x0822bac7 in ?? ()                                                                                                       
#3  0x0822d4c9 in ?? ()                                                                                                       
#4  0x0822a223 in ?? ()                                                                                                       
#5  0xb7703e32 in start_thread () from /lib/libpthread.so.0                                                                   
#6  0xb76407ee in clone () from /lib/libc.so.6                                                                                

Thread 4 (Thread 0xb6bd3b40 (LWP 5240)):                                                                                      
#0  0xb7779424 in __kernel_vsyscall ()                                                                                        
#1  0xb7707a4c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0                                                 
#2  0x0822bac7 in ?? ()                                                                                                       
#3  0x0822d4c9 in ?? ()                                                                                                       
#4  0x0822a223 in ?? ()                                                                                                       
#5  0xb7703e32 in start_thread () from /lib/libpthread.so.0                                                                   
#6  0xb76407ee in clone () from /lib/libc.so.6                                                                                

Thread 3 (Thread 0xb63d2b40 (LWP 5241)):                                                                                      
#0  0xb7779424 in __kernel_vsyscall ()                                                                                        
#1  0xb7707a4c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0                                                 
#2  0x0822bac7 in ?? ()                                                                                                       
#3  0x0822d4c9 in ?? ()                                                                                                       
#4  0x0822a223 in ?? ()                                                                                                       
#5  0xb7703e32 in start_thread () from /lib/libpthread.so.0                                                                   
#6  0xb76407ee in clone () from /lib/libc.so.6                                                                                

Thread 2 (Thread 0xb5783b40 (LWP 5242)):                                                                                      
#0  0xb7779424 in __kernel_vsyscall ()                                                                                        
#1  0xb7709da5 in sem_wait@@GLIBC_2.1 () from /lib/libpthread.so.0                                                            
#2  0x0821e0b8 in mono_sem_wait ()                                                                                            
#3  0x081c12bc in ?? ()                                                                                                       
#4  0x081a212d in ?? ()                                                                                                       
#5  0x081fc993 in ?? ()                                                                                                       
#6  0x0822b8b8 in ?? ()                                                                                                       
#7  0xb7703e32 in start_thread () from /lib/libpthread.so.0                                                                   
#8  0xb76407ee in clone () from /lib/libc.so.6                                                                                

Thread 1 (Thread 0xb7555700 (LWP 5238)):                                                                                      
#0  0xb7779424 in __kernel_vsyscall ()                                                                                        
#1  0xb770aadb in read () from /lib/libpthread.so.0                                                                           
#2  0x080e8ea4 in ?? ()                                                                                                       
#3  0x0812999c in ?? ()                                                                                                       
#4  0x0806441f in ?? ()                                                                                                       
#5  <signal handler called>                                                                                                   
#6  0xb3e36118 in OSMesaMakeCurrent () from /usr/lib/libOSMesa.so.8                                                           
#7  0xb41a00e4 in ?? ()                                                                                                       
#8  0xb41a005c in ?? ()                                                                                                       
#9  0xb419ffb5 in ?? ()                                                                                                       
#10 0xb4c499f8 in ?? ()                                                                                                       
#11 0xb4c497b4 in ?? ()                                                                                                       
#12 0xb57e9ead in ?? ()                                                                                                       
#13 0x0806912c in ?? ()                                                                                                       
#14 0x081dd62f in mono_runtime_invoke ()                                                                                      
#15 0x081e2edb in ?? ()                                                                                                       
#16 0x0809ce53 in ?? ()                                                                                                       
#17 0x0806645d in ?? ()                                                                                                       
#18 0x080688e4 in ?? ()                                                                                                       
#19 0x0806901e in ?? ()                                                                                                       
#20 0x080ead25 in ?? ()                                                                                                       
#21 0xb73d5066 in ?? ()                                                                                                       
#22 0xb4c433bc in ?? ()                                                                                                       
#23 0xb57eb9c0 in ?? ()                                                                                                       
#24 0xb57ec75f in ?? ()                                                                                                       
#25 0x0806912c in ?? ()                                                                                                       
#26 0x081dd62f in mono_runtime_invoke ()                                                                                      
#27 0x081e04c5 in mono_runtime_exec_main ()                                                                                   
#28 0x080c2f26 in mono_main ()                                                                                                
#29 0x0805de28 in ?? ()                                                                                                       
#30 0xb756f3d5 in __libc_start_main () from /lib/libc.so.6                                                                    
#31 0x0805df25 in ?? ()                                                                                                       

=================================================================                                                             
Got a SIGSEGV while executing native code. This usually indicates                                                             
a fatal error in the mono runtime or one of the native libraries                                                              
used by your application.                                                                                                     
=================================================================

using

Mono JIT compiler version 2.10.6 (tarball Wed Aug 15 11:51:07 UTC 2012)

and Mesa 9.0.1 on openSUSE 12.2 with Linux Kernel 3.7.2

Mailaender commented 11 years ago

Works with Wine although the SHP rendering is slightly broken then.

zzattack commented 10 years ago

I had some problems with libosmesa 9 when compiled with clang but after recompiling using gcc voxels rendered just fine. SHP rendering should be unrelated, also on Wine. Could you provide debug output when ran as MONO_LOG_LEVEL=debug mono CNCMaps.exe -i ... so we get some more debug on why mono fails to load the required libs?

Mailaender commented 10 years ago

http://paste.opensuse.org/80940944

Mailaender commented 10 years ago

Fallback seems to work:

0.0048 [Info] Initializing virtual filesystem
0.0062 [Info] Initializing filesystem on /home/matthias/.openra/Content/ts for the TiberianSun engine
0.0090 [Info] Parsing nod7a.map
0.0125 [Info] Reading tiles
0.0151 [Info] Reading map overlay
0.0155 [Info] Reading map overlay objects
0.0156 [Info] Reading map terrain object
0.0156 [Info] Reading infantry on map
0.0158 [Info] Reading vehicles on map
0.0158 [Info] Reading aircraft on map
0.0159 [Info] Reading map structures
0.0161 [Info] Parsing rules.ini
0.0198 [Info] Parsing art.ini
0.0221 [Info] Initializing theater
0.0238 [Info] Parsing temperat.ini
0.0315 [Info] Overriding rules.ini with map INI entries
0.0323 [Info] Loading houses
0.0323 [Info] Loading lighting
0.0327 [Info] Creating per-height palettes
0.0329 [Info] Loading light sources
0.0383 [Info] Calculating palette-values for all objects
0.0453 [Info] Drawing map
1.0207 [Info] Initializing voxel renderer
1.0211 [Warn] Mesa context could not be created
2.0638 [Info] Parsing mission.ini
2.0643 [Info] Mapname found: NOD 07 - Destroy GDI Research Facility
2.0761 [Info] Saving JPEG to /home/matthias/Downloads/NOD 07 - Destroy GDI Research Facility.jpg, quality level 95, clip @(24,12);3312x3024)

and http://www.mesa3d.org/osmesa.html is not really a healthy sub-project anyway.