Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 270899 - games-arcade/cdogs-sdl-0.4 crash on amd64
Summary: games-arcade/cdogs-sdl-0.4 crash on amd64
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Games (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-23 05:25 UTC by Azamat H. Hackimov
Modified: 2009-07-15 13:10 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
cdogs-sdl-0.4-64bit.patch (cdogs-sdl-0.4-64bit.patch,392 bytes, text/plain)
2009-05-23 05:26 UTC, Azamat H. Hackimov
Details
cdogs-sdl-0.4-64bit.patch (cdogs-sdl-0.4-64bit.patch,1.02 KB, patch)
2009-07-07 09:40 UTC, Tristan Heaven (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Azamat H. Hackimov 2009-05-23 05:25:33 UTC
I'm trying launch cdogs-sdl-0.4, but gets memory corruption:

*** glibc detected *** cdogs: malloc(): memory corruption: 0x00000000006a2630 ***
======= Backtrace: =========                                                     
/lib/libc.so.6[0x7fbd8a043b88]                                                   
/lib/libc.so.6[0x7fbd8a04651c]                                                   
/lib/libc.so.6(__libc_calloc+0x14f)[0x7fbd8a047dff]                              
cdogs[0x41c8dc]                                                                  
cdogs[0x41b678]                                                                  
cdogs[0x404be7]                                                                  
/lib/libc.so.6(__libc_start_main+0xe6)[0x7fbd89fed486]                           
cdogs[0x4027c9]                                                                  
======= Memory map: ========                                                     
00400000-00427000 r-xp 00000000 08:13 2679810                            /usr/games/bin/cdogs
00626000-00627000 r--p 00026000 08:13 2679810                            /usr/games/bin/cdogs
00627000-00634000 rw-p 00027000 08:13 2679810                            /usr/games/bin/cdogs
00634000-006e9000 rw-p 00634000 00:00 0                                  [heap]              
409ec000-409ed000 ---p 409ec000 00:00 0                                                      
409ed000-411ed000 rw-p 409ed000 00:00 0                                                      
7fbd83de9000-7fbd83dff000 r-xp 00000000 08:13 82924                      /lib64/libgcc_s.so.1
7fbd83dff000-7fbd83ffe000 ---p 00016000 08:13 82924                      /lib64/libgcc_s.so.1
7fbd83ffe000-7fbd83fff000 r--p 00015000 08:13 82924                      /lib64/libgcc_s.so.1
7fbd83fff000-7fbd84000000 rw-p 00016000 08:13 82924                      /lib64/libgcc_s.so.1
7fbd84000000-7fbd84021000 rw-p 7fbd84000000 00:00 0                                          
7fbd84021000-7fbd88000000 ---p 7fbd84021000 00:00 0                                          
7fbd88048000-7fbd88050000 r-xp 00000000 08:13 714272                     /lib64/librt-2.8.so 
7fbd88050000-7fbd8824f000 ---p 00008000 08:13 714272                     /lib64/librt-2.8.so 
7fbd8824f000-7fbd88250000 r--p 00007000 08:13 714272                     /lib64/librt-2.8.so 
7fbd88250000-7fbd88251000 rw-p 00008000 08:13 714272                     /lib64/librt-2.8.so 
7fbd88251000-7fbd8831a000 r-xp 00000000 08:13 2852394                    /usr/lib64/libasound.so.2.0.0
7fbd8831a000-7fbd8851a000 ---p 000c9000 08:13 2852394                    /usr/lib64/libasound.so.2.0.0
7fbd8851a000-7fbd8851d000 r--p 000c9000 08:13 2852394                    /usr/lib64/libasound.so.2.0.0
7fbd8851d000-7fbd88522000 rw-p 000cc000 08:13 2852394                    /usr/lib64/libasound.so.2.0.0
7fbd88522000-7fbd88527000 r-xp 00000000 08:13 2688475                    /usr/lib64/libXfixes.so.3.1.0
7fbd88527000-7fbd88726000 ---p 00005000 08:13 2688475                    /usr/lib64/libXfixes.so.3.1.0
7fbd88726000-7fbd88727000 r--p 00004000 08:13 2688475                    /usr/lib64/libXfixes.so.3.1.0
7fbd88727000-7fbd88728000 rw-p 00005000 08:13 2688475                    /usr/lib64/libXfixes.so.3.1.0
7fbd88728000-7fbd88732000 r-xp 00000000 08:13 2689172                    /usr/lib64/libXcursor.so.1.0.2
7fbd88732000-7fbd88931000 ---p 0000a000 08:13 2689172                    /usr/lib64/libXcursor.so.1.0.2
7fbd88931000-7fbd88932000 r--p 00009000 08:13 2689172                    /usr/lib64/libXcursor.so.1.0.2
7fbd88932000-7fbd88933000 rw-p 0000a000 08:13 2689172                    /usr/lib64/libXcursor.so.1.0.2
7fbd88933000-7fbd88bcb000 r--p 00000000 08:13 2105843                    /usr/lib64/locale/locale-archive
7fbd88bcb000-7fbd88bd2000 r-xp 00000000 08:13 2688999                    /usr/lib64/libXrandr.so.2.1.0   
7fbd88bd2000-7fbd88dd1000 ---p 00007000 08:13 2688999                    /usr/lib64/libXrandr.so.2.1.0   
7fbd88dd1000-7fbd88dd2000 r--p 00006000 08:13 2688999                    /usr/lib64/libXrandr.so.2.1.0
7fbd88dd2000-7fbd88dd3000 rw-p 00007000 08:13 2688999                    /usr/lib64/libXrandr.so.2.1.0
7fbd88dd3000-7fbd88ddc000 r-xp 00000000 08:13 2688549                    /usr/lib64/libXrender.so.1.3.0
7fbd88ddc000-7fbd88fdb000 ---p 00009000 08:13 2688549                    /usr/lib64/libXrender.so.1.3.0
7fbd88fdb000-7fbd88fdc000 r--p 00008000 08:13 2688549                    /usr/lib64/libXrender.so.1.3.0
7fbd88fdc000-7fbd88fdd000 rw-p 00009000 08:13 2688549                    /usr/lib64/libXrender.so.1.3.0
7fbd88fdd000-7fbd88fee000 r-xp 00000000 08:13 2810040                    /usr/lib64/libXext.so.6.4.0
7fbd88fee000-7fbd891ed000 ---p 00011000 08:13 2810040                    /usr/lib64/libXext.so.6.4.0
7fbd891ed000-7fbd891ee000 r--p 00010000 08:13 2810040                    /usr/lib64/libXext.so.6.4.0
7fbd891ee000-7fbd891ef000 rw-p 00011000 08:13 2810040                    /usr/lib64/libXext.so.6.4.0
7fbd891ef000-7fbd891f4000 r-xp 00000000 08:13 2688649                    /usr/lib64/libXdmcp.so.6.0.0
7fbd891f4000-7fbd893f3000 ---p 00005000 08:13 2688649                    /usr/lib64/libXdmcp.so.6.0.0
7fbd893f3000-7fbd893f4000 r--p 00004000 08:13 2688649                    /usr/lib64/libXdmcp.so.6.0.0
7fbd893f4000-7fbd893f5000 rw-p 00005000 08:13 2688649                    /usr/lib64/libXdmcp.so.6.0.0
7fbd893f5000-7fbd893f7000 r-xp 00000000 08:13 2688110                    /usr/lib64/libXau.so.6.0.0
7fbd893f7000-7fbd895f6000 ---p 00002000 08:13 2688110                    /usr/lib64/libXau.so.6.0.0
7fbd895f6000-7fbd895f7000 r--p 00001000 08:13 2688110                    /usr/lib64/libXau.so.6.0.0
7fbd895f7000-7fbd895f8000 rw-p 00002000 08:13 2688110                    /usr/lib64/libXau.so.6.0.0
7fbd895f8000-7fbd89703000 r-xp 00000000 08:13 2927831                    /usr/lib64/libX11.so.6.2.0
7fbd89703000-7fbd89903000 ---p 0010b000 08:13 2927831                    /usr/lib64/libX11.so.6.2.0
7fbd89903000-7fbd89905000 r--p 0010b000 08:13 2927831                    /usr/lib64/libX11.so.6.2.0
7fbd89905000-7fbd8990a000 rw-p 0010d000 08:13 2927831                    /usr/lib64/libX11.so.6.2.0
7fbd8990a000-7fbd89944000 r-xp 00000000 08:13 2541099                    /usr/lib64/libmikmod.so.2.0.4
7fbd89944000-7fbd89b44000 ---p 0003a000 08:13 2541099                    /usr/lib64/libmikmod.so.2.0.4
7fbd89b44000-7fbd89b45000 r--p 0003a000 08:13 2541099                    /usr/lib64/libmikmod.so.2.0.4
7fbd89b45000-7fbd89b47000 rw-p 0003b000 08:13 2541099                    /usr/lib64/libmikmod.so.2.0.4
7fbd89b47000-7fbd89b48000 rw-p 7fbd89b47000 00:00 0
7fbd89b48000-7fbd89b4a000 r-xp 00000000 08:13 714260                     /lib64/libdl-2.8.so
7fbd89b4a000-7fbd89d4a000 ---p 00002000 08:13 714260                     /lib64/libdl-2.8.so
7fbd89d4a000-7fbd89d4b000 r--p 00002000 08:13 714260                     /lib64/libdl-2.8.so
7fbd89d4b000-7fbd89d4c000 rw-p 00003000 08:13 714260                     /lib64/libdl-2.8.so
7fbd89d4c000-7fbd89dce000 r-xp 00000000 08:13 714281                     /lib64/libm-2.8.so
7fbd89dce000-7fbd89fcd000 ---p 00082000 08:13 714281                     /lib64/libm-2.8.so

I found pacth to resolve this error.

Reproducible: Always

Steps to Reproduce:
Comment 1 Azamat H. Hackimov 2009-05-23 05:26:12 UTC
Created attachment 192159 [details]
cdogs-sdl-0.4-64bit.patch
Comment 2 Mr. Bones. (RETIRED) gentoo-dev 2009-05-23 06:00:57 UTC
That doesn't look right to me.  You're replacing a pointer with a byte?  It looks to me like what it really wants to be doing is something like:

Pic *p = sys_mem_alloc(sizeof(Pic));
p->data = sys_mem_alloc(size);
Comment 3 Mr. Bones. (RETIRED) gentoo-dev 2009-07-06 16:37:10 UTC
amd64 team:  Please confirm and de-keyword if necessary.
Comment 4 Tristan Heaven (RETIRED) gentoo-dev 2009-07-07 09:40:03 UTC
Created attachment 197026 [details, diff]
cdogs-sdl-0.4-64bit.patch

I think this works, and makes it easier to understand what's supposed to happen (The data pointer was misleading).
Comment 5 Tristan Heaven (RETIRED) gentoo-dev 2009-07-15 13:10:55 UTC
Fixed, thanks.