Archive for the ‘bash’ Category

Doctrine 1.2.3 Segmentation fault

Samstag, Oktober 9th, 2010

Today we learned, that – with the stars properly aligned – doing the right mistakes in using Doctrine can actually make PHP cause a Segmentation fault.

So far I have not been able to reproduce the problem in an Apache environment; but running PHPUnit from the CLI, the issue could be reproduced consistently.

The root of the evil is using Doctrine’s Behaviour/Templates in an ill-advised way. In this particular situation, a model had a behaviour defined and, at the same time, a custom column definition for columns also specified by the behaviour.

Doctrine does a lot of internal magic — possibility for behaviour parameter validation is unfortunate, though. When creating your own behaviours for example, throwing exceptions to notify the programmer using the behaviour that some of the passed parameters are invalid, Doctrine catches and „swallows“ these so they never can be seen and considered… So far, looking at e.g. unit tests for the build-in behaviours I have not figured out how to do this „right“.

Anyhow, a Segmentation fault should hardly be the result of any configuration mistake. I will try to create a test case in a fresh environment (other that the fair size project this happened in), and take a closer look on how to reliably reproduce the issue and use a debugger to confirm the reason really can be found inside Doctrine’s code or if some other 3rd party software (XDebug, …) has any influence.

Mounting with /etc/fstab

Freitag, April 24th, 2009

Mental note (ok — actually a rather unnecessary duplication of already existing how-to’s):

One method to mount a NFS file system of another machine, is to add a line to /etc/fstab.

So instead of doing

me@myserver:~> umount server:/usr/local/pub
me@myserver:~> mount -t nfs server:/usr/local/pub /pub

all the time, just add the following line to your fstab

server:/usr/local/pub    /pub   nfs    rsize=8192,wsize=8192,timeo=14,intr

Leaving you in the comfy situation that the system knows what you are talking about if you just shout

me@myserver:~> mount /pub