Program: 141638
Project: 141638
Buggy source:
@Override public void onCreate(){
  super.onCreate();
  Log.i(TAG,"String_Node_Str");
  prefs=PreferenceManager.getDefaultSharedPreferences(this);
  final int bufferMs=prefs.getInt(Preferences.BUFFER_MS,500);
  sampleRate=Integer.parseInt(prefs.getString(Preferences.SAMPLING_RATE,"String_Node_Str"));
  sampleFormat=0;
  final boolean stereo=prefs.getBoolean(Preferences.STEREO,true);
  if (!stereo) {
    sampleFormat|=Xmp.XMP_FORMAT_MONO;
  }
  bufferSize=(sampleRate * (stereo ? 2 : 1) * 2* bufferMs / 1000) & ~0x3;
  final int channelConfig=stereo ? AudioFormat.CHANNEL_OUT_STEREO : AudioFormat.CHANNEL_OUT_MONO;
  final int minSize=AudioTrack.getMinBufferSize(sampleRate,channelConfig,AudioFormat.ENCODING_PCM_16BIT);
  if (bufferSize < minSize) {
    bufferSize=minSize;
  }
  audio=new AudioTrack(AudioManager.STREAM_MUSIC,sampleRate,channelConfig,AudioFormat.ENCODING_PCM_16BIT,bufferSize,AudioTrack.MODE_STREAM);
  Xmp.init();
  isAlive=false;
  isLoaded=false;
  paused=false;
  notifier=new Notifier(this);
  final XmpPhoneStateListener listener=new XmpPhoneStateListener(this);
  final TelephonyManager tm=(TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
  tm.listen(listener,XmpPhoneStateListener.LISTEN_CALL_STATE);
  audioManager=(AudioManager)getSystemService(Context.AUDIO_SERVICE);
  remoteControlResponder=new ComponentName(getPackageName(),RemoteControlReceiver.class.getName());
  registerRemoteControl();
  watchdog=new Watchdog(10);
  watchdog.setOnTimeoutListener(new Watchdog.onTimeoutListener(){
    public void onTimeout(){
      Log.e(TAG,"String_Node_Str");
      stopSelf();
    }
  }
);
  watchdog.start();
}

Fixed version (ground truth):
@Override public void onCreate(){
  super.onCreate();
  Log.i(TAG,"String_Node_Str");
  prefs=PreferenceManager.getDefaultSharedPreferences(this);
  final int bufferMs=prefs.getInt(Preferences.BUFFER_MS,500);
  sampleRate=Integer.parseInt(prefs.getString(Preferences.SAMPLING_RATE,"String_Node_Str"));
  sampleFormat=0;
  final boolean stereo=prefs.getBoolean(Preferences.STEREO,true);
  if (!stereo) {
    sampleFormat|=Xmp.XMP_FORMAT_MONO;
  }
  bufferSize=(sampleRate * (stereo ? 2 : 1) * 2* bufferMs / 1000) & ~0x3;
  final int channelConfig=stereo ? AudioFormat.CHANNEL_OUT_STEREO : AudioFormat.CHANNEL_OUT_MONO;
  final int minSize=AudioTrack.getMinBufferSize(sampleRate,channelConfig,AudioFormat.ENCODING_PCM_16BIT);
  if (bufferSize < minSize) {
    bufferSize=minSize;
  }
  audio=new AudioTrack(AudioManager.STREAM_MUSIC,sampleRate,channelConfig,AudioFormat.ENCODING_PCM_16BIT,bufferSize,AudioTrack.MODE_STREAM);
  Xmp.init();
  isAlive=false;
  isLoaded=false;
  paused=false;
  notifier=new Notifier(this);
  final XmpPhoneStateListener listener=new XmpPhoneStateListener(this);
  final TelephonyManager tm=(TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
  tm.listen(listener,XmpPhoneStateListener.LISTEN_CALL_STATE);
  audioManager=(AudioManager)getSystemService(Context.AUDIO_SERVICE);
  remoteControlResponder=new ComponentName(getPackageName(),RemoteControlReceiver.class.getName());
  registerRemoteControl();
  watchdog=new Watchdog(10);
  watchdog.setOnTimeoutListener(new Watchdog.onTimeoutListener(){
    public void onTimeout(){
      Log.e(TAG,"String_Node_Str");
      stopSelf();
      return;
    }
  }
);
  watchdog.start();
}