[PHP-DEV] PHP 4.0 Bug #9259: crash when accessing shared memory + more info on bug #8985

2001-02-14 Thread fuf

From: [EMAIL PROTECTED]
Operating system: linux-2.2.18
PHP version:  4.0.4pl1
PHP Bug Type: Reproduceable crash
Bug description:  crash when accessing shared memory + more info on bug #8985

hello,

  when accessing a shared memory region that i don't have access to (because of the 
permissions), php segfaults.
  so if i have a shared memory region created by another user with key 0x123 and 
permissions 0600 and call shm_attach(0x123), php crashes:


  also, i know some more info concerning the bug #8985: when one process is reading 
some variable from the shared memory and some other is writing _another_ variable to 
the same shared memory region, the data gets corrupted - possibly because of the 
reorganizing before each shm_put_var(). while this is understandable (shm_put_var() 
first removes the variable, reorganizes the region and writes the variable back), it 
renders this extension almost unusable in multitasking environments because a big 
global lock for the whole shared memory region is needed.
  i can supply more information if needed of course.

thanks,
Michal Vitecek


-- 
Edit Bug report at: http://bugs.php.net/?id=9259&edit=1



-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #13970 Updated: possible deadlock?

2001-12-18 Thread fuf

ID: 13970
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Old Status: Feedback
Status: Open
Bug Type: Performance problem
Operating System: linux, kernel 2.2.x
PHP Version: 4.0.6
New Comment:

4.1.0 works all okay - i've encoutered no strange behaviour.

thanks for the good work!

   Michal Vitecek

Previous Comments:


[2001-12-12 19:14:35] [EMAIL PROTECTED]

Could you try PHP 4.1.0 see if it help? and report the result?



[2001-11-07 06:29:06] [EMAIL PROTECTED]

okay - i tried with php4-20011107. no luck though because there were some other 
issues:
- compilation problems (the configure script wrongly thinks that 
gdImageColorResolve is undefined in gd-2.0.1)
- stability problems (the apache children segfaulted - one each ~3 secs)
- other problems (this version claimed that some files couldn't be stated 
because of permissions - apparently wrong because the files are created by the same 
user that reads them and are normally accessible + no problems with 4.0.5-6).



[2001-11-07 05:45:22] [EMAIL PROTECTED]

Any chance you could test the current CVS code?  Snapshots are available from 
http://snaps.php.net



[2001-11-07 05:28:04] [EMAIL PROTECTED]

hello,

with php 4.0.6 apache stops responding after 3-12 hours of working whereas with 4.0.5 
everything's okay. it definitely looks like some kind of a deadlock and it's 
unpredictable when the it happens.

php is compiled with these options:
CFLAGS="-O6 -march=i686 -fomit-frame-pointer" \
./configure \
-with-sybase-ct=/home/sybase \
--enable-sysvsem \
--enable-sysvshm \
--enable-memory-limit \
--enable-sockets \
--disable-session \
--with-gmp \
--with-dbase \
--with-gd \
--enable-gd-native-ttf \
--with-freetype-dir=/usr/local \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-zlib-dir=/usr \
--without-mysql \
--with-apache=../apache

the same bad behaviour occurs with php compiled as a standalone aplication when the 
script runs for a longish time.

the memory-limit patch for 4.0.6 was installed.

thanks
Michal Vitecek





Edit this bug report at http://bugs.php.net/?id=13970&edit=1


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP 4.0 Bug #8985: shm_put_var wont put the given var into memory

2001-01-29 Thread fuf

From: [EMAIL PROTECTED]
Operating system: linux-2.2.18
PHP version:  4.0.4pl1
PHP Bug Type: Semaphore related
Bug description:  shm_put_var wont put the given var into memory

hello,

  this is the same bug as described in #7046. a call to shm_put_var() returns true all 
the time, but checking whether the variable has been _really_ stored reveals that it 
hasn't.
  this doesn't happen on my 1 cpu box (i can't reproduce it however much i try), but 
on a loaded server with 4 cpus it happens pretty often. of course i call sem_acquire() 
before writing the variable into the shared memory, so it should be safe.
  i can supply the whole source in which this happens (445 lines) but basically it's 
just list this:

$semid = sem_get($sem_key, 1);
sem_acquire($semid);
$var = shm_get_var($shmid, $var_key); // $var is an array
// some change to $var, $var is still an array
shm_put_var($shmid, $var_key, $var);
if(!is_array(shm_get_var($shmid, $var_key)))
echo "failed to write \$var :(\n";
sem_release($semid);

  could the problem be caused by the true multitasking on the 4 cpu server?

thanks for any help with this,
Michal Vitecek


-- 
Edit Bug report at: http://bugs.php.net/?id=8985&edit=1



-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]