diff --git a/memcache.inc b/memcache.inc
index af916b3..f9de04c 100644
--- a/memcache.inc
+++ b/memcache.inc
@@ -177,6 +177,10 @@ function cache_set($cid, $data, $table = 'cache', $expire = CACHE_PERMANENT, $he
     return _cache_set($cid, $data, $table, $expire, $headers);
   }
 
+  if ($cid == 'variables' && empty($data)) {
+    file_put_contents('/tmp/variable_cache.txt', print_r(debug_backtrace(), 1), FILE_APPEND);
+  }
+
   // The created time should always be set as late as possible, this is
   // especially true immediately after a full bin flush, so use time() here
   // instead of request time.
