Changeset 900


Ignore:
Timestamp:
2012-05-10T15:25:45+02:00 (2 years ago)
Author:
moo
Message:

fixed #279: segv on cache full

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xcache.c

    r894 r900  
    840840                    entry_php = (xc_entry_php_t *) xc_stack_pop(s); 
    841841                    TRACE("unhold %d:%s", entry_php->file_inode, entry_php->entry.name.str.val); 
    842                     entry_php->refcount ++; 
     842                    --entry_php->refcount; 
    843843                    assert(entry_php->refcount >= 0); 
    844844                } 
     
    19401940        if (stored_php) { 
    19411941            compiler->new_entry.php = stored_php; 
    1942             xc_php_addref_unlocked(stored_php); 
    19431942            xc_entry_php_init(&compiler->new_entry, compiler->opened_path TSRMLS_CC); 
    19441943            stored_entry = xc_entry_php_store_unlocked(cache, compiler->entry_hash.entryslotid, &compiler->new_entry TSRMLS_CC); 
    1945             TRACE(" cached %d:%s, holding", compiler->new_entry.file_inode, stored_entry->entry.name.str.val); 
    1946             xc_entry_hold_php_unlocked(cache, stored_entry TSRMLS_CC); 
     1944            if (stored_entry) { 
     1945                xc_php_addref_unlocked(stored_php); 
     1946                TRACE(" cached %d:%s, holding", compiler->new_entry.file_inode, stored_entry->entry.name.str.val); 
     1947                xc_entry_hold_php_unlocked(cache, stored_entry TSRMLS_CC); 
     1948            } 
     1949            else { 
     1950                gaveup = 1; 
     1951            } 
    19471952            break; 
    19481953        } 
     
    20222027        /* entry_store */ 
    20232028        compiler->new_entry.php = stored_php; 
    2024         xc_php_addref_unlocked(stored_php); 
    20252029        stored_entry = xc_entry_php_store_unlocked(cache, compiler->entry_hash.entryslotid, &compiler->new_entry TSRMLS_CC); 
    2026         if (!stored_entry) { 
    2027             xc_php_release_unlocked(cache, stored_php); 
     2030        if (stored_entry) { 
     2031            xc_php_addref_unlocked(stored_php); 
     2032            TRACE(" cached %d:%s, holding", compiler->new_entry.file_inode, stored_entry->entry.name.str.val); 
     2033            xc_entry_hold_php_unlocked(cache, stored_entry TSRMLS_CC); 
    20282034        } 
    20292035    } LEAVE_LOCK_EX(cache); 
Note: See TracChangeset for help on using the changeset viewer.