Hiya, I found that this bug is being caused by what I consider to be a pretty serious design flaw. I cannot fix it without significant changes to how things are "working" now.
I'd like to get some Linden eyes on this at this point for comments :). You probably want to start reading somewhere here: https://jira.secondlife.com/browse/SNOW-103?focusedCommentId=122363&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_122363 The kernel of the problem, summarized, is as follows: If two different threads use the same APR memory pool for any LLAPRFile, then closing of a file by one thread causes the file descriptor of the other to be closed as well (and other nasty things). I think that it should just never happen that two different threads use the same pool for LLAPRFile objects. However, this is the case, EVEN though the code attempts to not do that by calling LLThread::getLocalAPRFilePool(). Namely, getLocalAPRFilePool() returns the same pool for two different threads without any problem. Can the original designer/coder of this part please comment? Am I correct to think that the idea of getLocalAPRFilePool() is to return a memory pool that is local the calling thread? It is not, because all it does is return a pointer from LLThread; when that LLThread object is accessible by any thread, then it doesn't really work. The problem LLThread is the base class of LLTextureCache which is a singleton! Obviously it is going to be used by more than one thread. _______________________________________________ Policies and (un)subscribe information available here: http://wiki.secondlife.com/wiki/SLDev Please read the policies before posting to keep unmoderated posting privileges
