Ticket #20 (new defect)

Opened 3 years ago

Last modified 2 years ago

'eAccelerator: Could not release lock!' errors in Apache errorlog on windows

Reported by: Rabrynil Assigned to: somebody
Priority: minor Milestone: 1.0
Component: eAccelerator Version: 0.9.5
Keywords: lock errors apache php 5 Cc:

Description

I will first describe my situation.

Operating environment

OS: Windows Server 2003 Enterprise Edition

Webserver: Apache HTTPD 2.0.55

PHP: PHP 5.1.2 (running as module)

eAccelerator Build Info

Version: 0.9.5-cvs200603090012-dev (latest svn snapshot)

Build as eAccelerator.dll with Microsoft Visual C++ 2003 Enterprise Edition

Used PHP 5.1.2 sourcefiles to build 'Release PHP5 Configuration'

BuildLog of eAccelerator.dll
Compiling...
webui.c
shm.c
session.c
optimize.c
\php\ext\eaccelerator\optimize.c(2947) : warning C4018: '<=' : signed/unsigned mismatch
\php\ext\eaccelerator\optimize.c(2948) : warning C4018: '<' : signed/unsigned mismatch
opcodes.c
mm.c
\php\ext\eaccelerator\mm.c(635) : warning C4013: 'ea_debug_error' undefined; assuming extern returning int
loader.c
\php\ext\eaccelerator\loader.c(659) : warning C4018: '<' : signed/unsigned mismatch
execute.c
encoder.c
\php\ext\eaccelerator\encoder.c(966) : warning C4018: '<' : signed/unsigned mismatch
eaccelerator.c
\php\ext\eaccelerator\eaccelerator.c(1229) : warning C4101: 'tv_start' : unreferenced local variable
ea_store.c
ea_restore.c
debug.c
content.c
cache.c
\php\ext\eaccelerator\cache.c(219) : warning C4013: 'calc_zval' undefined; assuming extern returning int
\php\ext\eaccelerator\cache.c(256) : warning C4013: 'store_zval' undefined; assuming extern returning int
\php\ext\eaccelerator\cache.c(368) : warning C4013: 'restore_zval' undefined; assuming extern returning int
\php\ext\eaccelerator\cache.c(427) : warning C4013: 'fixup_zval' undefined; assuming extern returning int
Linking...
   Creating library .\Release/eAccelerator.lib and object .\Release/eAccelerator.exp
   eAccelerator.dll created successfully

I had to download the execute.c sourcefile from http://dev.eaccelerator.net/eaccelerator/branches/eAccelerator/ to be able to compile it. It wasn't present in the snapshot I downloaded.

I have configured it in php.ini as an extension with the following settings:

;;;;;;;;;;;;;;;;;;;;;;;;;;;
; eAccelerator Novixa.net ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;
  extension="eAccelerator.dll"
  eaccelerator.shm_size="0"
  eaccelerator.cache_dir="F:\Novixa.net\phpcache\"
  eaccelerator.enable="1"
  eaccelerator.optimizer="1"
  eaccelerator.check_mtime="1"
  eaccelerator.debug="0"
  eaccelerator.filter=""
  eaccelerator.shm_max="0"
  eaccelerator.shm_ttl="0"
  eaccelerator.shm_prune_period="0"
  eaccelerator.shm_only="1"
  eaccelerator.compress="9"
  eaccelerator.keys     = "shm_only"
  eaccelerator.sessions = "shm_only"
  eaccelerator.content  = "shm_only"

Well, the accelerator seems to work fine. Scripts seem to be speeded up slightly as expected and Apache generates no fatal errors.

The real problem is that Apache/eAccelerator is writing the message eAccelerator: Could not release lock'' every few seconds to the Apache errorlog file. The errorlog grows to around 1 mb plaintext in an afternoon.

Hans suggested it had something to do with the memory manager not being able to release a lock on a certain memory segment. It is certainly not a disk/filesystem probleme because it's been configured completely as "shm_only".

Thanks in advance for fixing this bug.

Regards, Rabrynil

Change History

03/21/06 00:52:46 changed by Stadler

I guess, that the problem is, that the files in the win32-dir are very outdated. execute.c has been removed in changeset [135]. The last update in the win32-directory was in changeset [122], which is 8 months ago. I suppose, thats the reason, why eacceleator_info() and so on don't work in his binaries.

03/28/06 11:36:33 changed by bart

Can you apply this patch

Index: mm.c
===================================================================
--- mm.c        (revision 190)
+++ mm.c        (working copy)
@@ -587,6 +587,8 @@

 static int mm_do_unlock(mm_mutex* lock) {
   if (ReleaseMutex(g_lock.hMutex) == 0) {
+    /* lock couldn't be release */
+    ea_debug_error("Release mutex error: %d\n", GetLastError());
     return 0;
   }
   return 1;

And report back the output?

(If you can't patch, you can get the patched version here: http://bart.eaccelerator.net/bugs/20/mm.c)

03/28/06 17:55:09 changed by Rabrynil

Compiling...
webui.c
shm.c
session.c
optimize.c
\php\ext\eaccelerator\optimize.c(2950) : warning C4018: '<=' : signed/unsigned mismatch
\php\ext\eaccelerator\optimize.c(2951) : warning C4018: '<' : signed/unsigned mismatch
opcodes.c
mm.c
\php\ext\eaccelerator\mm.c(591) : warning C4013: 'ea_debug_error' undefined; assuming extern returning int
loader.c
\php\ext\eaccelerator\loader.c(659) : warning C4018: '<' : signed/unsigned mismatch
execute.c
encoder.c
\php\ext\eaccelerator\encoder.c(966) : warning C4018: '<' : signed/unsigned mismatch
eaccelerator.c
\php\ext\eaccelerator\eaccelerator.c(1229) : warning C4101: 'tv_start' : unreferenced local variable
ea_store.c
ea_restore.c
debug.c
content.c
cache.c
\php\ext\eaccelerator\cache.c(219) : warning C4013: 'calc_zval' undefined; assuming extern returning int
\php\ext\eaccelerator\cache.c(256) : warning C4013: 'store_zval' undefined; assuming extern returning int
\php\ext\eaccelerator\cache.c(368) : warning C4013: 'restore_zval' undefined; assuming extern returning int
\php\ext\eaccelerator\cache.c(427) : warning C4013: 'fixup_zval' undefined; assuming extern returning int
Linking...
   Creating library .\Release/eAccelerator.lib and object .\Release/eAccelerator.exp

Compiling went successfull.

Apache outputs the following every now and then (same frequency) to the ErrorLog?:

Release mutex error: 288
eAccelerator: Could not release lock!
Release mutex error: 288
eAccelerator: Could not release lock!
Release mutex error: 288
eAccelerator: Could not release lock!
uptime wordt niet herkend als een interne
of externe opdracht, programma of batchbestand.
Release mutex error: 288
eAccelerator: Could not release lock!
uptime wordt niet herkend als een interne
of externe opdracht, programma of batchbestand.
Release mutex error: 288
eAccelerator: Could not release lock!

03/29/06 12:14:38 changed by anonymous

  • summary changed from 'eAccelerator: Could not release lock!' errors in Apache errorlog to 'eAccelerator: Could not release lock!' errors in Apache errorlog on windows.

03/29/06 12:16:52 changed by anonymous

This is the human readable message from MSDN: ERROR_NOT_OWNER 288 Attempt to release mutex not owned by caller.

I think it's the same kind of problem like with sysvipc.

04/11/06 13:16:32 changed by bart

  • milestone deleted.

There aren't any windows developers in the eAccelerator team. We all work on unix like systems. For this we really have no clue how to debug something like this. Because the problem has always existed but only turned up now because return codes are checked now. I changed the unlock function to always return success so the error's aren't logged anymore.

04/14/06 11:51:10 changed by bart

  • milestone set to 1.0.

06/30/06 16:04:48 changed by bart

  • priority changed from major to minor.