Skip to main content
Topic: r2934 crash when zooming (Read 4717 times) previous topic - next topic

r2934 crash when zooming

I'm using the latest version on the trunk r2934 with the nightly version of pak128: 779. Compiled with gcc-4.3.4 on gentoo linux.

The problem happened when accidentaly my finger p****ed over the right side of the touchpad which zooms. The game crashed and this is the messages since the beginning:

Code: [Select]
/sim_2934                                                            
Reading low level config data ...                                                                     
p****_simuconf() at config/simuconf.tab: Reading simuconf.tab successful!                             
Preparing display ...                                                                                 
Screen Flags: requested=10, actual=10                                                                 
Loading font 'font/prop.fnt'                                                                          
font/prop.fnt sucessfully loaded as old format prop font!                                             
Init done.                                                                                            
p****_simuconf() at pak128-779/config/simuconf.tab: Reading simuconf.tab successful!                  
Reading compatibility sound data ...                                                                  
Loaded /home/tomasfg/simutrans/pak128-779/sound/engine-start-diesel-1.wav to sample 0.                
Loaded /home/tomasfg/simutrans/pak128-779/sound/engine-start-diesel_d.wav to sample 1.                
Loaded /home/tomasfg/simutrans/pak128-779/sound/train-horn-diesel-0.wav to sample 2.                  
Loaded /home/tomasfg/simutrans/pak128-779/sound/train-horn-steam-0.wav to sample 3.                   
Loaded /home/tomasfg/simutrans/pak128-779/sound/click.wav to sample 4.                                
Loaded /home/tomasfg/simutrans/pak128-779/sound/boing.wav to sample 5.                                
Loaded /home/tomasfg/simutrans/pak128-779/sound/jackhammer.wav to sample 6.                           
Loaded /home/tomasfg/simutrans/pak128-779/sound/gavel.wav to sample 7.                                
Loaded /home/tomasfg/simutrans/pak128-779/sound/dock.wav to sample 8.                                 
Loaded /home/tomasfg/simutrans/pak128-779/sound/explosion.wav to sample 9.                            
Loaded /home/tomasfg/simutrans/pak128-779/sound/cash.wav to sample 10.                                
could not load wav (Couldn't open /home/tomasfg/simutrans/pak128-779/sound/beaches.wav)               
could not load wav (Couldn't open /home/tomasfg/simutrans/pak128-779/sound/forest.wav)                
could not load wav (Couldn't open /home/tomasfg/simutrans/pak128-779/sound/Water.wav)                 
could not load wav (Couldn't open /home/tomasfg/simutrans/pak128-779/sound/desert.wav)                
could not load wav (Couldn't open /home/tomasfg/simutrans/pak128-779/sound/tropic.wav)                
could not load wav (Couldn't open /home/tomasfg/simutrans/pak128-779/sound/mediterran.wav)            
could not load wav (Couldn't open /home/tomasfg/simutrans/pak128-779/sound/temperate.wav)             
could not load wav (Couldn't open /home/tomasfg/simutrans/pak128-779/sound/tundra.wav)                
could not load wav (Couldn't open /home/tomasfg/simutrans/pak128-779/sound/rocky.wav)                 
could not load wav (Couldn't open /home/tomasfg/simutrans/pak128-779/sound/arctic.wav)                
Loading BDF font 'font/Prop-Latin1.bdf'                                                               
Unexpected character (255) for 255 character font!                                                    
Loading BDF font font/Prop-Latin1.bdf with 255 characters                                             
Reading city configuration ...                                                                        
Reading speedbonus configuration ...                                                                  
Reading forest configuration ...                                                                      
Reading menu configuration ...                                                                        
Reading object data from pak128-779/...                                                               
Loaded /home/tomasfg/simutrans/pak128-779/sound/engine-start-diesel-0.wav to sample 11.               
Loaded /home/tomasfg/simutrans/pak128-779/sound/ship-horn_a.wav to sample 12.                         
Loaded /home/tomasfg/simutrans/pak128-779/sound/engine-start-petrol-2.wav to sample 13.               
could not load wav (MPEG Layer 3 data not supported)                                                  
Loaded /home/tomasfg/simutrans/pak128-779/sound/engine-start-petrol-0.wav to sample 14.               
Loaded /home/tomasfg/simutrans/pak128-779/sound/ship-horn_b.wav to sample 15.                         
Loaded /home/tomasfg/simutrans/pak128-779/sound/train-horn-steam-1.wav to sample 16.                  
Loaded /home/tomasfg/simutrans/pak128-779/sound/engine-start-petrol-1.wav to sample 17.               
could not load wav (MPEG Layer 3 data not supported)                                                  
could not load wav (MPEG Layer 3 data not supported)                                                  
could not load wav (MPEG Layer 3 data not supported)                                                  
could not load wav (MPEG Layer 3 data not supported)                                                  
could not load wav (MPEG Layer 3 data not supported)                                                  
could not load wav (MPEG Layer 3 data not supported)                                                  
could not load wav (MPEG Layer 3 data not supported)                                                  
could not load wav (MPEG Layer 3 data not supported)                                                  
tunnel_reader_t::register_obj(): Tunnel RailTunnel geladen                                            
tunnel_reader_t::register_obj(): Tunnel RoadTunnel geladen                                            
could not load wav (MPEG Layer 3 data not supported)                                                  
could not load wav (MPEG Layer 3 data not supported)                                                  
could not load wav (Couldn't open /home/tomasfg/simutrans/pak128-779/sound/truck.wav)                 
could not load wav (MPEG Layer 3 data not supported)                                                  
could not load wav (MPEG Layer 3 data not supported)                                                  
Reading menu configuration ...                                                                        
Midi disabled ...                                                                                     
Calculating textures ...done                                                                          
Creating cities ...                                                                                   
simcity::  placed city 0 its= 0                                                                       
simcity::  number of iterations 0                                                                     
Distributing 1 tourist attractions ...                                                                
Preparing startup ...                                                                                 
Loading BDF font 'font/Prop-Latin1.bdf'                                                               
Unexpected character (255) for 255 character font!                                                    
Loading BDF font font/Prop-Latin1.bdf with 255 characters                                             
ALSA lib pcm.c:7234:(snd_pcm_recover) underrun occured                                                
World destroyed.                                                                                      
Calculating textures ...done                                                                          
expose: x=1280, y=727                                                                                 
textur_resize()::screen=0x9d511c8                                                                     
Warning: gui_textinput_t::infowin_event() called but text is NULL                                     
Warning: gui_textinput_t::infowin_event() called but text is NULL                                     
Warning: gui_textinput_t::infowin_event() called but text is NULL
Warning: gui_textinput_t::infowin_event() called but text is NULL
Warning: gui_textinput_t::infowin_event() called but text is NULL
Warning: gui_textinput_t::infowin_event() called but text is NULL
Warning: gui_textinput_t::infowin_event() called but text is NULL
Warning: gui_textinput_t::infowin_event() called but text is NULL
Warning: gui_textinput_t::infowin_event() called but text is NULL
Warning: gui_textinput_t::infowin_event() called but text is NULL
Warning: gui_textinput_t::infowin_event() called but text is NULL
Warning: gui_textinput_t::infowin_event() called but text is NULL
Warning: gui_textinput_t::infowin_event() called but text is NULL
Warning: gui_textinput_t::infowin_event() called but text is NULL
Warning: gui_textinput_t::infowin_event() called but text is NULL
Warning: gui_textinput_t::infowin_event() called but text is NULL
ALSA lib pcm.c:7234:(snd_pcm_recover) underrun occured
ALSA lib pcm.c:7234:(snd_pcm_recover) underrun occured
ALSA lib pcm.c:7234:(snd_pcm_recover) underrun occured
set_zoom_factor() : set 2 (4/3)
Violación de segmento

The last means Segment violation for those who doesn't speak Spanish... This happened also yesterday night but I didn't know way thus way I executed it today on the terminal to see if it could help understand what happened... And as I see it it remember that it happened when I used the wheel of the mouse... I'll recompile it now with DEBUG = 3 and try to reproduce it... But it's hard to do it... So long I haven't been able to do it... Anyway it's related to the depot, since I'm renewing the tram lines in my cities and both times it was selected... If you need it I can upload the savegame...

Re: r2934 crash when zooming

Reply #1
I am getting the same error with pak64 on r2934 compiled on debian/squeeze with gcc 4.3.4. As T0m4s reported, the console output immediately preceding the segfault is
Code: [Select]
set_zoom_factor() : set 2 (4/3)

Re: r2934 crash when zooming

Reply #2
could you provide a backtrace with gdb?
Parsley, sage, rosemary, and maggikraut.

Re: r2934 crash when zooming

Reply #3
Unfortunately the behaviour that is consistent outside gdb (zoom in then segfault) does not occur when running simutrans inside gdb.  I have however gleaned a small bit more of info. If I zoom out before ever zooming in, then the segfault does not occur. It is only if my first zoom action is an inwards zoom that the problem occurs.

Re: r2934 crash when zooming

Reply #4
Actually the bug is quite difficult to reproduce... But after several tries I've managed to do it under gdb. Here's the info with the backtrace: (I've reproduced it with the new version on the trunk r2935)

Code: [Select]
gdb sim_2935      
GNU gdb 6.8                                       
Copyright (C) 2008 Free Software Foundation, Inc. 
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.          
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"  
and "show warranty" for details.                                            
This GDB was configured as "i686-pc-linux-gnu"...                           
(gdb) run                                                                   
Starting program: /home/tomasfg/simutrans/sim_2935                          
[Thread debugging using libthread_db enabled]                               
Reading low level config data ...                                           
p****_simuconf() at config/simuconf.tab: Reading simuconf.tab successful!   
[New Thread 0xb741e6d0 (LWP 7164)]                                          
Preparing display ...                                                       
Screen Flags: requested=10, actual=10                                       
Loading font 'font/prop.fnt'                                                
font/prop.fnt sucessfully loaded as old format prop font!                   
Init done.                                                                  
p****_simuconf() at pak128-779/config/simuconf.tab: Reading simuconf.tab successful!
[New Thread 0xb6d19b90 (LWP 7170)]                                                 
Reading compatibility sound data ...                                               
Loaded /home/tomasfg/simutrans/pak128-779/sound/engine-start-diesel-1.wav to sample 0.
Loaded /home/tomasfg/simutrans/pak128-779/sound/engine-start-diesel_d.wav to sample 1.
Loaded /home/tomasfg/simutrans/pak128-779/sound/train-horn-diesel-0.wav to sample 2. 
Loaded /home/tomasfg/simutrans/pak128-779/sound/train-horn-steam-0.wav to sample 3.  
Loaded /home/tomasfg/simutrans/pak128-779/sound/click.wav to sample 4.               
Loaded /home/tomasfg/simutrans/pak128-779/sound/boing.wav to sample 5.               
Loaded /home/tomasfg/simutrans/pak128-779/sound/jackhammer.wav to sample 6.          
Loaded /home/tomasfg/simutrans/pak128-779/sound/gavel.wav to sample 7.               
Loaded /home/tomasfg/simutrans/pak128-779/sound/dock.wav to sample 8.                
Loaded /home/tomasfg/simutrans/pak128-779/sound/explosion.wav to sample 9.           
Loaded /home/tomasfg/simutrans/pak128-779/sound/cash.wav to sample 10.               
could not load wav (Couldn't open /home/tomasfg/simutrans/pak128-779/sound/beaches.wav)
could not load wav (Couldn't open /home/tomasfg/simutrans/pak128-779/sound/forest.wav)
could not load wav (Couldn't open /home/tomasfg/simutrans/pak128-779/sound/Water.wav) 
could not load wav (Couldn't open /home/tomasfg/simutrans/pak128-779/sound/desert.wav)
could not load wav (Couldn't open /home/tomasfg/simutrans/pak128-779/sound/tropic.wav)
could not load wav (Couldn't open /home/tomasfg/simutrans/pak128-779/sound/mediterran.wav)
could not load wav (Couldn't open /home/tomasfg/simutrans/pak128-779/sound/temperate.wav)
could not load wav (Couldn't open /home/tomasfg/simutrans/pak128-779/sound/tundra.wav)   
could not load wav (Couldn't open /home/tomasfg/simutrans/pak128-779/sound/rocky.wav)    
could not load wav (Couldn't open /home/tomasfg/simutrans/pak128-779/sound/arctic.wav)   
Loading BDF font 'font/Prop-Latin1.bdf'                                                  
Unexpected character (255) for 255 character font!                                       
Loading BDF font font/Prop-Latin1.bdf with 255 characters                                
Reading city configuration ...                                                           
Reading speedbonus configuration ...                                                     
Reading forest configuration ...                                                         
Reading menu configuration ...                                                           
Reading object data from pak128-779/...                                                  
Loaded /home/tomasfg/simutrans/pak128-779/sound/engine-start-diesel-0.wav to sample 11.  
Loaded /home/tomasfg/simutrans/pak128-779/sound/ship-horn_a.wav to sample 12.            
Loaded /home/tomasfg/simutrans/pak128-779/sound/engine-start-petrol-2.wav to sample 13.  
could not load wav (MPEG Layer 3 data not supported)                                     
Loaded /home/tomasfg/simutrans/pak128-779/sound/engine-start-petrol-0.wav to sample 14.  
Loaded /home/tomasfg/simutrans/pak128-779/sound/ship-horn_b.wav to sample 15.            
Loaded /home/tomasfg/simutrans/pak128-779/sound/train-horn-steam-1.wav to sample 16.     
Loaded /home/tomasfg/simutrans/pak128-779/sound/engine-start-petrol-1.wav to sample 17.  
could not load wav (MPEG Layer 3 data not supported)                                     
could not load wav (MPEG Layer 3 data not supported)                                     
could not load wav (MPEG Layer 3 data not supported)                                     
could not load wav (MPEG Layer 3 data not supported)                                     
could not load wav (MPEG Layer 3 data not supported)                                     
could not load wav (MPEG Layer 3 data not supported)                                     
could not load wav (MPEG Layer 3 data not supported)                                     
could not load wav (MPEG Layer 3 data not supported)                                     
tunnel_reader_t::register_obj(): Tunnel RailTunnel geladen                               
tunnel_reader_t::register_obj(): Tunnel RoadTunnel geladen                               
could not load wav (MPEG Layer 3 data not supported)                                     
could not load wav (MPEG Layer 3 data not supported)                                     
could not load wav (Couldn't open /home/tomasfg/simutrans/pak128-779/sound/truck.wav)    
could not load wav (MPEG Layer 3 data not supported)                                     
could not load wav (MPEG Layer 3 data not supported)                                     
Reading menu configuration ...                                                           
Midi disabled ...                                                                        
Calculating textures ...done                                                             
Creating cities ...                                                                      
simcity::  placed city 0 its= 0                                                          
simcity::  number of iterations 0                                                        
Distributing 1 tourist attractions ...                                                   
Preparing startup ...                                                                    
Loading BDF font 'font/Prop-Latin1.bdf'                                                  
Unexpected character (255) for 255 character font!                                       
Loading BDF font font/Prop-Latin1.bdf with 255 characters                                
World destroyed.                                                                         
Calculating textures ...done                                                             
set_zoom_factor() : set 2 (4/3)                                                          

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb741e6d0 (LWP 7164)]
0x0824d9aa in recode_img_src_target (h=1, src=0xe81c558, target=0xe822318) at simgraph16.cc:720
720                                             *target++ = rgbmap_day_night[*src++];
(gdb) backtrace
#0  0x0824d9aa in recode_img_src_target (h=1, src=0xe81c558, target=0xe822318) at simgraph16.cc:720
#1  0x0824feac in recode_normal_img (n=12828) at simgraph16.cc:741
#2  0x0825acbb in display_img_aux (n=12828, xp=0, yp=326, dirty=0, use_player=false)
    at simgraph16.cc:1965
#3  0x0808934e in grund_t::display_boden (this=0xd812730, xpos=0, ypos=326) at boden/grund.cc:846
#4  0x081eee3c in planquadrat_t::display_boden (this=0xb4f7afd8, xpos=0, ypos=326) at simplan.cc:362
#5  0x081f2f1b in karte_ansicht_t::display (this=0xcbe0d30, force_dirty=true) at simview.cc:127
#6  0x081db355 in intr_refresh_display (dirty=false) at simintr.cc:75
#7  0x08218a14 in karte_t::sync_step (this=0x9dbe7a8, delta_t=68, sync=true, display=true)
    at simworld.cc:2562
#8  0x081db301 in interrupt_check (caller_info=0x828063d "karte_t::interactive()") at simintr.cc:101
#9  0x08226b48 in karte_t::interactive (this=0x9dbe7a8, quit_month=2147483647) at simworld.cc:5302
#10 0x081e393f in simu_main (argc=1, argv=0xbfa78114) at simmain.cc:1010
#11 0x0825b664 in main (argc=1, argv=0xbfa78114) at simsys_s.cc:721

If you need more info just ask for it...

Re: r2934 crash when zooming

Reply #5
One question. Are you using bigger size addon ?
If you are using 192 or 255 size addon and which is on screen, it will crash.
This is a known problem.

Re: r2934 crash when zooming

Reply #6
I'm using no addons. Just the nightly version of pak128.

Re: r2934 crash when zooming

Reply #7
Pak128 airplanes are 176*176... no addons needed.

(btw, this crash does not happen on windows... but that's not important)

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

Re: r2934 crash when zooming

Reply #8
I didn't know... Anyway in this map i still have no planes... Are there other things in the pak that can cause this in addition to planes? Anyway sanna had the same problem with pak64, but maybe there's something on pak64 bigger also...



I've just discover another thing... If you load any savegame and the first you do it's zoom in, it crashes. If you zoom out, then you can zoom in without problems. Anyway this happens just with the gcc4 version. I've downloaded the gcc3 and gcc4 r2935 nightly version and it happens only with the gcc4 version. And with the old version RC102.2.1 r2896 gcc4 this doesn't happen. :S

[red]{ When you have the last post in a thread, and it's been less than 24 hours, please use the Modify button to edit your post, instead of posting again - that's called "double posting" when you do. Thanks! -Isaac.Eiland-Hall }[/red]

Re: r2934 crash when zooming

Reply #9
@Tom4S and z9999: would you please provide a savegame, which crashes reproducably after zooming in?
Parsley, sage, rosemary, and maggikraut.

 

Re: r2934 crash when zooming

Reply #11
@Tom4s: could you please retest with revision 2942?
Parsley, sage, rosemary, and maggikraut.

Re: r2934 crash when zooming

Reply #12
r2942 doesn't launch for me.
I could build but ****embler complained.

Quote
C:/DOCUME~1/xxx/LOCALS~1/Temp/ccoFaaaa.s: ****embler messages:
C:/DOCUME~1/xxx/LOCALS~1/Temp/ccoFaaaa.s:10482: Warning: using `%eax' instead of `%ax' due to `l' suffix
C:/DOCUME~1/xxx/LOCALS~1/Temp/ccoFaaaa.s:10486: Warning: using `%eax' instead of `%ax' due to `l' suffix
C:/DOCUME~1/xxx/LOCALS~1/Temp/ccoFaaaa.s:10487: Warning: using `%eax' instead of `%ax' due to `l' suffix

Re: r2934 crash when zooming

Reply #13
Does this patch fixes this?

I had to change line 1791 in simgraph16.cc to
Code: [Select]
"jmp *(%2)\n\t"
to get the code with asm compiled. However, simutrans crashes with the asm code for revision 2930 and 2942.
Parsley, sage, rosemary, and maggikraut.

Re: r2934 crash when zooming

Reply #14
Yes, launched.

BTW, recent code in simgraph16.cc and simworld.cc have many signed and unsigned warnigs.

Re: r2934 crash when zooming

Reply #15
I tested it on r2942 with the pathc (without patch it crashed) and apparently it works.

Thanks :)

Re: r2934 crash when zooming

Reply #16
Seems you all beat me to it... but for the sake of completeness *smile*, here is what happened when I tried to run r2942:

Built r2942 on debian/squeeze, gcc 4.3.4, game compiles fine, but upon launch this happens:
Code: [Select]
$ ./simutrans --debug 3 --log 3
Reading low level config data ...
p****_simuconf() at config/simuconf.tab: Reading simuconf.tab successful!
Preparing display ...
Screen Flags: requested=10, actual=10
Loading font 'font/prop.fnt'
font/prop.fnt sucessfully loaded as old format prop font!
Init done.
Segmenteringsfel
Segmenteringsfel == segmentation fault

running in gdb gives
Code: [Select]
Program received signal SIGSEGV, Segmentation fault.
0x0000b92c in ?? ()
(gdb) bt
#0  0x0000b92c in ?? ()
#1  0x08225c25 in display_img_aux (n=0, xp=173, yp=216, dirty=0, use_player=false) at simgraph16.cc:2021
#2  0x08225d6c in display_color_img (n=0, xp=173, yp=216, player_nr=0 '\000', daynight=0, dirty=0) at simgraph16.cc:2107
#3  0x0810f42b in gui_frame_t::zeichnen (this=0x83602b0, pos=..., gr=...) at gui/gui_frame.cc:148
#4  0x0813b873 in pakselector_t::zeichnen (this=0x83602b0, p=..., gr=...) at gui/pakselector.cc:64
#5  0x081b9886 in ask_objfilename () at simmain.cc:247
#6  0x081badb4 in simu_main (argc=3, argv=0xbffff464) at simmain.cc:593
#7  0x082262fa in main (argc=3, argv=0xbffff464) at simsys_s.cc:721

Dwachs patch above prevents the crash at launch of 2942, and the zoom crash also seems to have been fixed, but there is as z9999+ observed quite a few warnings about comparisons between signed and unsigned integers:
Code: [Select]
simgraph16.cc: In function ‘void rezoom_img(unsigned int)’:
simgraph16.cc:944: warning: comparison between signed and unsigned integer expressions
simgraph16.cc:946: warning: comparison between signed and unsigned integer expressions
simgraph16.cc:947: warning: comparison between signed and unsigned integer expressions
simgraph16.cc:966: warning: comparison between signed and unsigned integer expressions
simgraph16.cc:981: warning: comparison between signed and unsigned integer expressions
simgraph16.cc:984: warning: comparison between signed and unsigned integer expressions
simgraph16.cc:1006: warning: comparison between signed and unsigned integer expressions
simgraph16.cc:1010: warning: comparison between signed and unsigned integer expressions
simgraph16.cc:1038: warning: comparison between signed and unsigned integer expressions
simgraph16.cc:1043: warning: comparison between signed and unsigned integer expressions
simgraph16.cc:1079: warning: comparison between signed and unsigned integer expressions
simgraph16.cc:1088: warning: comparison between signed and unsigned integer expressions

Re: r2934 crash when zooming

Reply #17
The inline ****embler requires uint32 for runlen, which was changed to PIXVAL instead its needed siye. Should work again in r2943.