Bug 13497

Summary: Ri-li crashing with a Segmentation Fault error
Product: Mageia Reporter: benoît tuduri <benoit.tuduri>
Component: RPM PackagesAssignee: José Jorge <lists.jjorge>
Status: RESOLVED WONTFIX QA Contact:
Severity: minor    
Priority: Normal CC: mageia
Version: CauldronKeywords: Triaged, UPSTREAM
Target Milestone: ---   
Hardware: i586   
OS: Linux   
Whiteboard: MGA4TOO MGA5TOO
Source RPM: ri-li-2.0.1-9.mga4.src.rpm CVE:
Status comment:

Description benoît tuduri 2014-06-08 15:12:37 CEST
Description of problem:
When you exiting the software, it crash with a segmentation fault.


How reproducible:
It's reproductible all the time.

Steps to Reproduce:

1. Backup safetly your ".ri-li.pref" located in your $HOME dir, and remove it:
   $ rm .ri-li.pref

2. Run the game :
   $ Ri_li

3. When you see the page which ask for the language, press ESC to exit the game.
At this moment, you will see the segmentation fault in your terminal.
   $ Ri_li 
Erreur de segmentation #Ok here, it was french translation of segfault. :)

I tried to launch the sofware with gdb and debugging symbol :
   $ gdb /usr/games/Ri_li
I repeat the previous third point (launch the game and exit with ESC key). The returns are :

(gdb) r
Starting program: /usr/games/Ri_li 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i686/libthread_db.so.1".
[New Thread 0xb753eb40 (LWP 29251)]
[New Thread 0xb26e2b40 (LWP 29253)]
[Thread 0xb26e2b40 (LWP 29253) exited]
[New Thread 0xb26e2b40 (LWP 29254)]

Program received signal SIGSEGV, Segmentation fault.
0x08052d7e in Sprite::Affiche (this=0x8150364, X=X@entry=400, Y=Y@entry=229, 
    NumSpr=NumSpr@entry=0, Fond=Fond@entry=0x974dbc8) at sprite.cc:394
394       Position.x=X-Dim[NumSpr].cx;


======================

(gdb) bt
#0  0x08052d7e in Sprite::Affiche (this=0x8150364, X=X@entry=400, 
    Y=Y@entry=229, NumSpr=NumSpr@entry=0, Fond=Fond@entry=0x974dbc8)
    at sprite.cc:394
#1  0x08052fba in AfficheText (x=x@entry=400, y=y@entry=229, 
    Text=Text@entry=T_play, Fond=0x974dbc8) at sprite.cc:300
#2  0x080500bb in Menu::SDLMain (this=this@entry=0x8082364 <MenuPrincipale>)
    at menu.cc:140
#3  0x08049b2c in main (narg=1, argv=0xbfffed64) at main.cc:179


=======================

(gdb) list
389     void Sprite::Affiche(int X,int Y,int NumSpr,SDL_Surface *Fond)
390     {
391       SDL_Rect Position;
392       SDL_Rect Di;
393
394       Position.x=X-Dim[NumSpr].cx;
395       Position.y=Y-Dim[NumSpr].cy;
396       
397       Position.w=Position.h=Di.x=Di.y=0;
398       Di.w=Dim[NumSpr].L;


============================

(gdb) p Position
$1 = {x = 0, y = 0, w = 0, h = 0}
(gdb) p X
$2 = 400
(gdb) p Y
$3 = 229
(gdb) p Di
$4 = {x = -13111, y = -18451, w = 508, h = 2069}
(gdb) p Dim
$5 = (s_Dim *) 0x0


I guess here, Dim is destroyed or unallocated while used by the method Sprite::Affiche.


Sincerly,






Reproducible: 

Steps to Reproduce:
Comment 1 benoît tuduri 2014-06-08 17:08:02 CEST
This is a conception bug.

The first run, the .ri-li.pref is not created so, the program asking you to choose a language.
When I hit ESC at this moment, the program try to load the main menu with the language where the language selection was positionned but the sprite language or not loaded.

Your need to have a boolean to check if the language page was invocked for a first run or not. If the first run and the user was hit ESC then the program is stopped.
Comment 2 Manuel Hiebel 2014-06-12 00:58:12 CEST
Maybe you can report bug to upstream ? http://ri-li.sourceforge.net/devel.html

Keywords: (none) => Triaged
Assignee: bugsquad => lists.jjorge

Samuel Verschelde 2015-05-19 19:09:47 CEST

Keywords: (none) => UPSTREAM

Comment 3 Samuel Verschelde 2015-05-19 19:11:01 CEST
Has the bug been reported upstream? Has it been fixed? Is the fix included in Mageia 5?

Keywords: (none) => NEEDINFO

Comment 4 Rémi Verschelde 2015-05-19 21:01:03 CEST
The bug is still valid in Mageia 5, and I guess it is also in Mageia 4. There is no bug report upstream, but upstream has no given sign of life since 2007. I don't find a patch at Debian or Fedora either, so I guess if we want this fixed, we need to provide the patch ourselves.

Benoît, as you've done the debugging already, maybe you could provide a patch?

Keywords: NEEDINFO => (none)
Whiteboard: (none) => MGA4TOO MGA5TOO

Comment 5 Nicolas Lécureuil 2015-05-20 15:12:59 CEST
i just tested on my cauldron and i can't reproduce

CC: (none) => mageia

Comment 6 Rémi Verschelde 2015-05-20 15:14:54 CEST
Note that the bug is only reproduced in the first screen where you can choose between different languages. So to reproduce it you need to remove ~/.ri-li.pref and press ESC after having starting Ri-li.
Comment 7 Nicolas Lécureuil 2015-05-20 15:17:30 CEST
oh yes didn't had it the first time but now i see it
Comment 8 José Jorge 2015-09-28 22:22:08 CEST
This bug is not annoying, and we have no upstream support. As Benoit did not volunteer to fix it, closing as Won't Fix.

Status: NEW => RESOLVED
Resolution: (none) => WONTFIX