Bug 21756 - r200: Mesa-7.4.2 release regression: "Quit on exit".
Summary: r200: Mesa-7.4.2 release regression: "Quit on exit".
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
: 21881 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-05-15 13:51 UTC by smoki
Modified: 2009-05-23 04:03 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
AssaultCube-exit.log (11.22 KB, text/plain)
2009-05-18 08:30 UTC, smoki
Details
AssaultCube-settings.log (1.83 KB, text/plain)
2009-05-18 08:31 UTC, smoki
Details
A patch that corrects this bug. (426 bytes, patch)
2009-05-19 00:49 UTC, Tai Chi Minh Ralph Eastwood
Details | Splinter Review
Patch with removed texUnit->_Current = NULL; (752 bytes, patch)
2009-05-20 03:22 UTC, Tai Chi Minh Ralph Eastwood
Details | Splinter Review

Description smoki 2009-05-15 13:51:42 UTC
Problematic commit is:

 mesa: Fixed a texture memory leak

 #63cde0ea0e2bc85005136c353c363777488804d2
 
 After that i can't quit/exit from many games like World of Goo, AssaultCube, RTCW, etc. They just freeze it's screens at quiting but not really quit:)... I can only restart X to quit games.
Comment 1 Michel Dänzer 2009-05-18 04:41:06 UTC
> I can only restart X to quit games.

Does killing the game processes also work, possibly with kill -9?

Does running the games in valgrind give any hints? Maybe the r200 driver needs texture object reference counting fixes like the r300 got recently in Git commits c28707b50701b1cf8727be29d61e2d939c6ee58f and 09c04db3c900e4ed833d060853b48c7ca23697e1 .
Comment 2 smoki 2009-05-18 08:30:30 UTC
Created attachment 25965 [details]
AssaultCube-exit.log
Comment 3 smoki 2009-05-18 08:31:14 UTC
Created attachment 25966 [details]
AssaultCube-settings.log
Comment 4 smoki 2009-05-18 08:33:00 UTC
(In reply to comment #1)
> > I can only restart X to quit games.
> 
> Does killing the game processes also work, possibly with kill -9?
> 
> Does running the games in valgrind give any hints? Maybe the r200 driver needs
> texture object reference counting fixes like the r300 got recently in Git
> commits c28707b50701b1cf8727be29d61e2d939c6ee58f and
> 09c04db3c900e4ed833d060853b48c7ca23697e1 .
> 

 Yes, killing process works also with kill -9 or killall somewhere also works with CTRL+C (World of Goo). In World of Goo there is no any error message when i call it from console, i can kill it with CTRL+C there, but in RTCW i must switch to another vt console and then i can kill it with 'killall wolf.x86', also RTCW show some error and then freeze when i try to exit:

 ----- CL_Shutdown -----
RE_Shutdown( 1 )
Mesa 7.4.2 implementation error: invalid reference to a deleted texture object
Please report at bugzilla.freedesktop.org
wolfsp.x86: main/texobj.c:305: _mesa_reference_texobj: Assertion `valid_texture_object(oldTex)' failed.
Received signal 6, exiting...

 Some games don't freeze on exit like 'Secret Maryo Chronicles', but emit same error:

 Mesa 7.4.2 implementation error: invalid reference to a deleted texture object
 Please report at bugzilla.freedesktop.org
 smc: main/texobj.c:305: _mesa_reference_texobj: Assertion `valid_texture_object(oldTex)' failed.


  In case of Assault Cube if i tried to exit i don't get Mesa implementation error but got freeze and first show some glibc error, but when i try to apply some video settings in game i got same impementation error like in RTCW, logs attached. 

  If that helps, i remember first time when r200 start to have problems with deleted texture objects i think, noticed in ppracer (bug #21019)... I'm not sure, but that seems to be in some conjuction and may be root cause of this problem.

Comment 5 Tai Chi Minh Ralph Eastwood 2009-05-19 00:49:18 UTC
Created attachment 25989 [details] [review]
A patch that corrects this bug.

Commit #63cde0ea0e2bc85005136c353c363777488804d2 deallocates a reference correctly, however the reference to the texture in _Current is never made in
texture_override.
So rather than assignment in texture_override, a reference is made.

Hopefully this will solve the problem - it works here.
Comment 6 Michel Dänzer 2009-05-19 01:07:26 UTC
Ah right, this is essentially what 7e0f47c1348273ed3bb39d00aa4a9498a28b8d6a does in master... Unfortunately that doesn't cherry-pick to the 7.4 branch cleanly, so I'll leave it to Brian how to handle this.
Comment 7 smoki 2009-05-19 02:12:46 UTC
(In reply to comment #5)
> Created an attachment (id=25989) [details]
> A patch that corrects this bug.
> 
> Commit #63cde0ea0e2bc85005136c353c363777488804d2 deallocates a reference
> correctly, however the reference to the texture in _Current is never made in
> texture_override.
> So rather than assignment in texture_override, a reference is made.
> 
> Hopefully this will solve the problem - it works here.
> 

 Thanks, works for me also.

Comment 8 Brian Paul 2009-05-19 08:05:13 UTC
OK, I've committed patch/attachment 25989 [details] [review] to Mesa, commit 46a2aad2cfec0ae54bc1a3ba5aacf6f59065d64b

Closing this bug.

Looks like a 7.4.3 release will be in order...
Comment 9 Michel Dänzer 2009-05-20 00:53:25 UTC
Note that the master commit also removes the texUnit->_Current = NULL assignment from update_texture_state(). Without that change, aren't we leaking texture objects again?
Comment 10 Tai Chi Minh Ralph Eastwood 2009-05-20 03:19:30 UTC
(In reply to comment #9)
> Note that the master commit also removes the texUnit->_Current = NULL
> assignment from update_texture_state(). Without that change, aren't we leaking
> texture objects again?
> 

Yes, you're right - I missed that by accident.
Comment 11 Tai Chi Minh Ralph Eastwood 2009-05-20 03:22:32 UTC
Created attachment 26028 [details] [review]
Patch with removed texUnit->_Current = NULL;

Fixes the potential memory leak as described in Comment #9.
Comment 12 Brian Paul 2009-05-20 07:15:54 UTC
OK, I've committed the follow-on patch.
commit 35f5222ae0a16e0ac275110b6cbbbd13f74fd101
Comment 13 Michel Dänzer 2009-05-23 04:03:41 UTC
*** Bug 21881 has been marked as a duplicate of this bug. ***


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.