As alluded to in yesterday's post, I'm currently hunting an elusive bug with xdebug.
The problem is, that it only happens sporadically and when I know it happend it is too late to set a break point. So usual debugging methods don't work. Instead I want to use xdebug's execution tracing: let it log all function calls and then pick through the log when the bug occurs.
Now, the trace function offers three different formats set in the xdebug.trace_format option:
However for what I want, I found the human readable formats much too verbose. A full function trace of a page load in DokuWiki has about 25k lines.
To ease my debugging I looked for tools that could read the computer readable format. I found a few promising candidates, but in the end they either didn't work or they did not provide what I needed. So instead of hunting the bug, I built a tool:
It's a very simple PHP script that parses and outputs the function trace. A bit of CSS and some jQuery makes it easy to collapse parts you're not interested in. Eg. you can hide all PHP internal functions and you can hide functions by clicking their name. You can also hide whole blocks of code.
You'll find the code at Github.
Now back to finding that bug…
Today I figured something out that really confused me yesterday. I was trying to use up xdebug's function tracing, so I set up my config like this:
zend_extension=/usr/lib/php/modules/xdebug.so xdebug.remote_enable=off xdebug.remote_host=127.0.0.1 xdebug.remote_port=9000 xdebug.remote_handler=dbgp xdebug.trace_enable_trigger=1 xdebug.trace_output_dir=/tmp/ xdebug.trace_output_name=xdebug.%t
But sending the XDEBUG_TRACE trigger never did produce any output in /tmp/. I then tried to call xdebug_start_trace() and xdebug_stop_trace() directly. But still no output in /tmp/.
Next I made a simple test script doing nothing more than starting tracing, echoing “test” and stop tracing. I ran it from the command line and I got a trace file in /tmp/! So I ran the same file through my webserver… and got nothing.
That's when it dawned on me and I changed my test file to this:
<?php xdebug_start_trace(); echo "test"; xdebug_stop_trace(); print_r(glob('/tmp/*'));
I ran it from my webserver and there they were! All the traces I produced earlier. But doing an ls /tmp/ did not show them!?
A bit googling finally brought the answer. In ArchLinux, Apache is started from systemd with the option PrivateTmp=true. Apparently that creates a virtual /tmp/ using the Kernel's file system namespace feature – here's a blog post describing it a bit more.
So the solution is to reconfigure the xdebug.trace_output_dir to point to a different directory.
TIL: /tmp/ might not be what you think it is.
"Sie stehen also um diesen Bus herum, brüllen aus vollem Halse und blicken auf einen Bus voll mit verängstigten Menschen. Einige von ihnen fangen an zu weinen. Wenn ich das auf dem Video sehen kann, haben die Menschen die da waren, es erst recht gesehen. Sie schreien weiter. Da steht am Ende also ein hasserfüllt schreiender Vater und brüllt so laut er kann einigen weinenden Flüchtlingskindern, Frauen und Männern entgegen: „Wir sind das Volk“ und „Ausländer raus!“ und andere Ekelhaftigkeiten. Sieht er nicht, dass das Menschen sind? Kinder? Kinder verdammt nochmal. So wie seine?"
Johnny Depp plays Donald Trump in a fake 80ies Biopic. 50min movie.
This weekend we cooked three mails from a Marley Spoon recipe box. A recipe or cook box is a subscription were you get a box with ingredients and recipes each week so you don't need to think about what to cook or go shopping.
There are many different services offering such services. My friend Anika recently tested a whole bunch of them and reviewed them in detail. Check her posts on how the different options compare1).
Our box was a trial we got as a gift for Christmas. It was a three meal box for two. It contained ingredients for the following recipes:
The beef was our absolute favorite but the other dishes were very good, too. When you look at the ingredients you'd think they are not enough to feed two people, but in the end we found the amount always exactly right.
All in all we really enjoyed the experience. We won't keeping the subscription though for just one reason: the price. A box is 48 EUR - that's 8 EUR per meal. We can get a meal for that price in any of the surrounding restaurants and won't even have to cook!
However as a gift idea, this is quite wonderful. The next time someone asks what to give us for birthday this will be a really nice option.
Here are a few pics.
A while ago I blogged about our self-built trash manager inside an IKEA BEKVÄM. And while it worked fine in general, it turned out that getting a full trash bag out of it was really cumbersome. It also held only two kinds of trash (plastic and residual waste) but had no room for paper.
So we began thinking about other solutions. Kaddi always thought it would be nice to have a bench in the kitchen to sit on and that it would be a great way to combine that with the trash problem. This week we finally talked it through and came up with a plan.
Below you can see some pictures of how we built it. The inner box runs on wheels and contains two IKEA VARIERA bins. It has enough space for paper recycling as well. Material cost was about 160 EUR.
We're back from one week on Tenrife and as usual, here are a few select pictures we took.
We stayed in the northern, a little bit less touristy part, but thanks to a rental car we had access to the whole island. The weather was fine. It never rained, though the first few days were a bit cloudy. It was not too hot - perfect for hiking. In the last days it was even warm enough to bathe.
Enjoy the pics…
Older Posts are available in the Archive. Keep up to date with the RSS Feed.