Recommend trying -O0, the effects of -O2 confuse the debugger (e.g. the variable 'data' has probably been optimized away, hence the apparent NULL pointer). Craig P Prescott writes: > I'll recompile the whole thing with -O0 and see if that helps, just to > understand this.