Skip to content

Instantly share code, notes, and snippets.

@thomas-holmes
thomas-holmes / moving-triangles.glsl
Created April 12, 2019 15:36
Some shader fooling. Copied a bunch of it from tuts/samples
#define PI 3.14159265359
#define TWO_PI 6.28318530718
//POLYGON FUNCTION
float polygon(vec2 uv, vec2 pos, float size, float blur, int sides){
uv = uv-pos;
//Angle and radius of polygon
float angle = atan(uv.x,uv.y)+PI;
float rad = TWO_PI/float(sides);
float dist = cos(floor(0.5+angle/rad)*rad-angle)*length(uv);
#include "stdafx.h"
#include <iostream>
#include <string>
#include "tree.hh"
#include "tree_util.hh"
using namespace std;
int main()
{

To reproduce this bug the file must be in an OverlayFS mount

Reproduced on:

  • linux-image-4.4.0-159-generic/xenial-updates,xenial-security,now 4.4.0-159.187 amd64
  • linux-image-4.4.0-165-generic/xenial-updates,xenial-security,now 4.4.0-165.193 amd64

Install packages libacl1-dev, build-essential, and gcc.

Included is a C program that reproduces the bug and two scripts. Run them in order.

  • make-overlay.sh: creates directories in /tmp and mounts /tmp/overlay as an overlay filesystem