Bug 21501 - Assertion `lvl->size > 0' failed.
Summary: Assertion `lvl->size > 0' failed.
Status: RESOLVED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Radeon (show other bugs)
Version: XOrg git
Hardware: Other All
: medium normal
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
: 24080 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-05-01 07:12 UTC by rem11_1999
Modified: 2009-12-03 11:24 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
RADEON_DEBUG=tex scourge (631.31 KB, application/octet-stream)
2009-11-25 08:05 UTC, rem11_1999
no flags Details
RADEON_DEBUG=tex scourge (50.13 KB, application/octet-stream)
2009-11-25 13:46 UTC, rem11_1999
no flags Details
scourge log (79.68 KB, application/octet-stream)
2009-11-28 07:28 UTC, rem11_1999
no flags Details
proposed patch (1.36 KB, text/plain)
2009-11-28 15:27 UTC, Maciej Cencora
no flags Details

Description rem11_1999 2009-05-01 07:12:22 UTC
When I launch game Scourge (lastest version : 0.21.1) after loading screen it exit with this message on console :

scourge: radeon_mipmap_tree.c:113: compute_tex_image_offset: Assertion `lvl->size > 0' failed.

info :

distrib : gentoo (arch amd64)
Xorg-server : 1.6.1
xf86-video-ati : from git
drm : from kernel 2.6.28
libdrm : from git
mesa : from git branch radeon-rewrite

If I use mesa from git branch master, no more crash.
Comment 1 Maciej Cencora 2009-11-18 14:23:54 UTC
Can you reproduce the bug on current mesa_7_7_branch?
Comment 2 rem11_1999 2009-11-18 23:28:55 UTC
I just retest and the bug is here with a little different (and more informative ?) debug message :

scourge: radeon_texture.c:875: migrate_image_to_miptree: Assertion `srclvl->size == dstlvl->size' failed.


updated info :

distrib : gentoo (arch amd64)
Xorg-server : 1.7.1
xf86-video-ati : from git
drm : from kernel 2.6.32-rc6 
libdrm : from git
mesa : from git branch master

with KMS/DRI2

updated 1 hour ago..

Comment 3 rem11_1999 2009-11-18 23:34:58 UTC
A little info, my card is a X1700 (rv530)
Comment 4 Maciej Cencora 2009-11-19 00:54:59 UTC
The miptree fixes were merged to mesa_7_7_branch not master branch. Could you retest it on mesa_7_7_branch?
Comment 5 rem11_1999 2009-11-20 13:02:23 UTC
Tested with mesa branch master from now (after branch 7.7 was merged in) and same error message :

scourge: radeon_texture.c:875: migrate_image_to_miptree: Assertion `srclvl->size == dstlvl->size' failed.
Comment 6 Maciej Cencora 2009-11-22 03:38:15 UTC
(In reply to comment #5)
> Tested with mesa branch master from now (after branch 7.7 was merged in) and
> same error message :
> 
> scourge: radeon_texture.c:875: migrate_image_to_miptree: Assertion
> `srclvl->size == dstlvl->size' failed.
> 

Something's wrong. You aren't using the latest version, since the migrate_image_to_miptree function has been moved to radeon_mipmap_tree.c file.
Comment 7 rem11_1999 2009-11-23 00:14:08 UTC
Ok, now it seems I have the latest change but same result :

scourge: radeon_mipmap_tree.c:438: migrate_image_to_miptree: Assertion `srclvl->size == dstlvl->size' failed.
Comment 8 Maciej Cencora 2009-11-23 13:09:28 UTC
Please check if commit 960464e42dce138fde11c379ce7744bc4be14aa2 on mesa_7_7_branch fixes the problem.
Comment 9 rem11_1999 2009-11-24 07:49:51 UTC
Just used up to date 7.7 branch 

OpenGL vendor string: DRI R300 Project                                         
OpenGL renderer string: Mesa DRI R300 (RV530 71D5) 20090101  TCL DRI2          
OpenGL version string: 1.5 Mesa 7.7-devel 


but same error :

For font >large< using locale >all<
scourge: radeon_mipmap_tree.c:445: migrate_image_to_miptree: Assertion `srclvl->size == dstlvl->size' failed.
Aborted
Comment 10 Maciej Cencora 2009-11-24 08:03:27 UTC
Could you apply this patch http://pastebin.ca/1684143 and provide me with an app log? Please set RADEON_DEBUG=tex env variable when running the app.
Comment 11 rem11_1999 2009-11-25 06:47:49 UTC
here is the log :

Setting video mode: 1024x768x16                                                       
Mesa: Mesa 7.7-devel DEBUG build Nov 25 2009 15:35:03                                 
Mesa warning: software DXTn compression/decompression available                       
Mesa: Initializing x86-64 optimizations                                               
For font >normal< using locale >all<                                                  
For font >ui< using locale >all<                                                      
For font >mono< using locale >all<                                                    
For font >large< using locale >all<                                                   
Found matching miptree 0x24e5bf0                                                      
Found matching miptree 0x255a700                                                      
Found matching miptree 0x2582ad0                                                      
Found matching miptree 0x256e8f0                                                      
Found matching miptree 0x25c5bf0                                                      
Found matching miptree 0x25c63d0      
........
...........
..........
Found matching miptree 0x4b33f60
Found matching miptree 0x4b33830
No matching miptree found, allocating new one 0x4ecef90
miptree level 0
width 256 vs 256
height 64 vs 64
depth 1 vs 1
scourge: radeon_mipmap_tree.c:449: migrate_image_to_miptree: Assertion `srclvl->size == dstlvl->size' failed.
Aborted

Comment 12 Maciej Cencora 2009-11-25 07:49:01 UTC
(In reply to comment #11)
> here is the log :
> 
> Setting video mode: 1024x768x16                                                 
> Mesa: Mesa 7.7-devel DEBUG build Nov 25 2009 15:35:03                           
> Mesa warning: software DXTn compression/decompression available                 
> Mesa: Initializing x86-64 optimizations                                         
> For font >normal< using locale >all<                                            
> For font >ui< using locale >all<                                                
> For font >mono< using locale >all<                                              
> For font >large< using locale >all<                                             
> Found matching miptree 0x24e5bf0                                                
> Found matching miptree 0x255a700                                                
> Found matching miptree 0x2582ad0                                                
> Found matching miptree 0x256e8f0                                                
> Found matching miptree 0x25c5bf0                                                
> Found matching miptree 0x25c63d0      
> ........
> ...........
> ..........
> Found matching miptree 0x4b33f60
> Found matching miptree 0x4b33830
> No matching miptree found, allocating new one 0x4ecef90
> miptree level 0
> width 256 vs 256
> height 64 vs 64
> depth 1 vs 1
> scourge: radeon_mipmap_tree.c:449: migrate_image_to_miptree: Assertion
> `srclvl->size == dstlvl->size' failed.
> Aborted
> 


Did you run the app with RADEON_DEBUG=tex env var? If yes, please recompile the mesa with debug option (pass --enable-debug to configure script). Please attach full log.
Comment 13 rem11_1999 2009-11-25 07:59:21 UTC
oups forgot to set env var... it should be better :

..........

height0 64 vs 64                                                                      
depth0 1 vs 1                                                                         
MATCHED                                                                               
Found matching miptree 0x478cc50                                                      
Checking image level 0, face 0, mt 0x478cc50 ... OK                                   
radeon_validate_texture_miptree: Validating texture 0x43837c0 now, minLod = 0, maxLod = 0, baseLevel = 0                                                                    
Checking if miptree 0x4384060 matches texObj 0x43837c0                                
texObj baseLevel 0, miptree baseLevel 0                                               
target 3553 vs 3553                                                                   
format 11 vs 3                                                                        
numLevels 9 vs 9                                                                      
width0 256 vs 256                                                                     
height0 64 vs 64                                                                      
depth0 1 vs 1
NOT MATCHED
level 0, face 0: rs:1024 256x64 at 0
level 1, face 0: rs:512 128x32 at 65536
level 2, face 0: rs:256 64x16 at 81920
level 3, face 0: rs:128 32x8 at 86016
level 4, face 0: rs:64 16x4 at 87040
level 5, face 0: rs:32 8x2 at 87296
level 6, face 0: rs:32 4x1 at 87360
level 7, face 0: rs:32 2x1 at 87392
level 8, face 0: rs:32 1x1 at 87424
No matching miptree found, allocating new one 0x478c350
Checking image level 0, face 0, mt 0x4384060 ... MIGRATING
miptree level 0
width 256 vs 256
height 64 vs 64
depth 1 vs 1
scourge: radeon_mipmap_tree.c:449: migrate_image_to_miptree: Assertion `srclvl->size == dstlvl->size' failed.
Aborted
Comment 14 rem11_1999 2009-11-25 08:05:11 UTC
Created attachment 31476 [details]
RADEON_DEBUG=tex scourge

the missing attachment.....
Comment 15 Maciej Cencora 2009-11-25 13:03:45 UTC
I need some more info to figure out what's going on. Please create another log with this patch applied http://pastebin.ca/1687296 . Revert previous one first.

I've tried to reproduce the bug on my rv380 (kms) but failed.
Comment 16 rem11_1999 2009-11-25 13:46:18 UTC
Created attachment 31478 [details]
RADEON_DEBUG=tex scourge

Here is the new log...
Comment 17 Maciej Cencora 2009-11-27 15:18:09 UTC
Sorry, but I need another one log with this patch http://pastebin.ca/1690281
Comment 18 rem11_1999 2009-11-28 07:28:14 UTC
Created attachment 31535 [details]
scourge log

New log
Comment 19 Pavel Rojtberg 2009-11-28 07:53:22 UTC
*** Bug 24080 has been marked as a duplicate of this bug. ***
Comment 20 Maciej Cencora 2009-11-28 15:27:47 UTC
Created attachment 31544 [details]
proposed patch

Ok, I've found the what's causing these assertions to fail. Unfortunately current solution is to disable failing assertions. Proper solution would be to fix the FBOs handling. More info in the attached patch.
Comment 21 rem11_1999 2009-11-30 12:49:26 UTC
With your patch no more problem.... the games works. Thanks :)
Comment 22 Maciej Cencora 2009-12-03 11:24:52 UTC
I've pushed the patch to mesa_7_7_branch. Closing.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.