Program: 23221
Project: 23221
Buggy source:
public PackageManagerService(Context context,boolean factoryTest){
  EventLog.writeEvent(LOG_BOOT_PROGRESS_PMS_START,SystemClock.uptimeMillis());
  if (mSdkVersion <= 0) {
    Log.w(TAG,"String_Node_Str");
  }
  mContext=context;
  mFactoryTest=factoryTest;
  mNoDexOpt="String_Node_Str".equals(SystemProperties.get("String_Node_Str"));
  mMetrics=new DisplayMetrics();
  mSettings=new Settings();
  mSettings.addSharedUserLP("String_Node_Str",Process.SYSTEM_UID,ApplicationInfo.FLAG_SYSTEM);
  mSettings.addSharedUserLP("String_Node_Str",MULTIPLE_APPLICATION_UIDS ? RADIO_UID : FIRST_APPLICATION_UID,ApplicationInfo.FLAG_SYSTEM);
  mSettings.addSharedUserLP("String_Node_Str",MULTIPLE_APPLICATION_UIDS ? LOG_UID : FIRST_APPLICATION_UID,ApplicationInfo.FLAG_SYSTEM);
  String separateProcesses=SystemProperties.get("String_Node_Str");
  if (separateProcesses != null && separateProcesses.length() > 0) {
    if ("String_Node_Str".equals(separateProcesses)) {
      mDefParseFlags=PackageParser.PARSE_IGNORE_PROCESSES;
      mSeparateProcesses=null;
      Log.w(TAG,"String_Node_Str");
    }
 else {
      mDefParseFlags=0;
      mSeparateProcesses=separateProcesses.split("String_Node_Str");
      Log.w(TAG,"String_Node_Str" + separateProcesses);
    }
  }
 else {
    mDefParseFlags=0;
    mSeparateProcesses=null;
  }
  Installer installer=new Installer();
  if (installer.ping() && Process.supportsProcesses()) {
    mInstaller=installer;
  }
 else {
    mInstaller=null;
  }
  WindowManager wm=(WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
  Display d=wm.getDefaultDisplay();
  d.getMetrics(mMetrics);
synchronized (mInstallLock) {
synchronized (mPackages) {
      mHandlerThread.start();
      mHandler=new PackageHandler(mHandlerThread.getLooper());
      File dataDir=Environment.getDataDirectory();
      mAppDataDir=new File(dataDir,"String_Node_Str");
      mDrmAppPrivateInstallDir=new File(dataDir,"String_Node_Str");
      if (mInstaller == null) {
        File miscDir=new File(dataDir,"String_Node_Str");
        miscDir.mkdirs();
        mAppDataDir.mkdirs();
        mDrmAppPrivateInstallDir.mkdirs();
      }
      readPermissions();
      mRestoredSettings=mSettings.readLP();
      long startTime=SystemClock.uptimeMillis();
      EventLog.writeEvent(LOG_BOOT_PROGRESS_PMS_SYSTEM_SCAN_START,startTime);
      int scanMode=SCAN_MONITOR;
      if (mNoDexOpt) {
        Log.w(TAG,"String_Node_Str");
        scanMode|=SCAN_NO_DEX;
      }
      final HashSet<String> libFiles=new HashSet<String>();
      mFrameworkDir=new File(Environment.getRootDirectory(),"String_Node_Str");
      mDalvikCacheDir=new File(dataDir,"String_Node_Str");
      if (mInstaller != null) {
        boolean didDexOpt=false;
        String bootClassPath=System.getProperty("String_Node_Str");
        if (bootClassPath != null) {
          String[] paths=splitString(bootClassPath,':');
          for (int i=0; i < paths.length; i++) {
            try {
              if (dalvik.system.DexFile.isDexOptNeeded(paths[i])) {
                libFiles.add(paths[i]);
                mInstaller.dexopt(paths[i],Process.SYSTEM_UID,true);
                didDexOpt=true;
              }
            }
 catch (            FileNotFoundException e) {
              Log.w(TAG,"String_Node_Str" + paths[i]);
            }
catch (            IOException e) {
              Log.w(TAG,"String_Node_Str" + paths[i],e);
            }
          }
        }
 else {
          Log.w(TAG,"String_Node_Str");
        }
        if (mSharedLibraries.size() > 0) {
          Iterator<String> libs=mSharedLibraries.values().iterator();
          while (libs.hasNext()) {
            String lib=libs.next();
            try {
              if (dalvik.system.DexFile.isDexOptNeeded(lib)) {
                libFiles.add(lib);
                mInstaller.dexopt(lib,Process.SYSTEM_UID,true);
                didDexOpt=true;
              }
            }
 catch (            FileNotFoundException e) {
              Log.w(TAG,"String_Node_Str" + lib);
            }
catch (            IOException e) {
              Log.w(TAG,"String_Node_Str" + lib,e);
            }
          }
        }
        libFiles.add(mFrameworkDir.getPath() + "String_Node_Str");
        String[] frameworkFiles=mFrameworkDir.list();
        if (frameworkFiles != null) {
          for (int i=0; i < frameworkFiles.length; i++) {
            File libPath=new File(mFrameworkDir,frameworkFiles[i]);
            String path=libPath.getPath();
            if (libFiles.contains(path)) {
              continue;
            }
            if (!path.endsWith("String_Node_Str") && !path.endsWith("String_Node_Str")) {
              continue;
            }
            try {
              if (dalvik.system.DexFile.isDexOptNeeded(path)) {
                mInstaller.dexopt(path,Process.SYSTEM_UID,true);
                didDexOpt=true;
              }
            }
 catch (            FileNotFoundException e) {
              Log.w(TAG,"String_Node_Str" + path);
            }
catch (            IOException e) {
              Log.w(TAG,"String_Node_Str" + path,e);
            }
          }
        }
        if (didDexOpt) {
          String[] files=mDalvikCacheDir.list();
          if (files != null) {
            for (int i=0; i < files.length; i++) {
              String fn=files[i];
              if (fn.startsWith("String_Node_Str") || fn.startsWith("String_Node_Str")) {
                Log.i(TAG,"String_Node_Str" + fn);
                (new File(mDalvikCacheDir,fn)).delete();
              }
            }
          }
        }
      }
      mFrameworkInstallObserver=new AppDirObserver(mFrameworkDir.getPath(),OBSERVER_EVENTS,true);
      mFrameworkInstallObserver.startWatching();
      scanDirLI(mFrameworkDir,PackageParser.PARSE_IS_SYSTEM,scanMode | SCAN_NO_DEX);
      mSystemAppDir=new File(Environment.getRootDirectory(),"String_Node_Str");
      mSystemInstallObserver=new AppDirObserver(mSystemAppDir.getPath(),OBSERVER_EVENTS,true);
      mSystemInstallObserver.startWatching();
      scanDirLI(mSystemAppDir,PackageParser.PARSE_IS_SYSTEM,scanMode);
      mAppInstallDir=new File(dataDir,"String_Node_Str");
      if (mInstaller == null) {
        mAppInstallDir.mkdirs();
      }
      ArrayList<String> deletePkgsList=mSettings.getListOfIncompleteInstallPackages();
      for (int i=0; i < deletePkgsList.size(); i++) {
        cleanupInstallFailedPackage(deletePkgsList.get(i));
      }
      deleteTempPackageFiles();
      EventLog.writeEvent(LOG_BOOT_PROGRESS_PMS_DATA_SCAN_START,SystemClock.uptimeMillis());
      mAppInstallObserver=new AppDirObserver(mAppInstallDir.getPath(),OBSERVER_EVENTS,false);
      mAppInstallObserver.startWatching();
      scanDirLI(mAppInstallDir,0,scanMode);
      mDrmAppInstallObserver=new AppDirObserver(mDrmAppPrivateInstallDir.getPath(),OBSERVER_EVENTS,false);
      mDrmAppInstallObserver.startWatching();
      scanDirLI(mDrmAppPrivateInstallDir,0,scanMode | SCAN_FORWARD_LOCKED);
      EventLog.writeEvent(LOG_BOOT_PROGRESS_PMS_SCAN_END,SystemClock.uptimeMillis());
      Log.i(TAG,"String_Node_Str" + ((SystemClock.uptimeMillis() - startTime) / 1000f) + "String_Node_Str");
      updatePermissionsLP();
      mSettings.writeLP();
      EventLog.writeEvent(LOG_BOOT_PROGRESS_PMS_READY,SystemClock.uptimeMillis());
      Runtime.getRuntime().gc();
    }
  }
}

Fixed version (ground truth):
public PackageManagerService(Context context,boolean factoryTest){
  EventLog.writeEvent(LOG_BOOT_PROGRESS_PMS_START,SystemClock.uptimeMillis());
  if (mSdkVersion <= 0) {
    Log.w(TAG,"String_Node_Str");
  }
  mContext=context;
  mFactoryTest=factoryTest;
  mNoDexOpt="String_Node_Str".equals(SystemProperties.get("String_Node_Str"));
  mMetrics=new DisplayMetrics();
  mSettings=new Settings();
  mSettings.addSharedUserLP("String_Node_Str",Process.SYSTEM_UID,ApplicationInfo.FLAG_SYSTEM);
  mSettings.addSharedUserLP("String_Node_Str",MULTIPLE_APPLICATION_UIDS ? RADIO_UID : FIRST_APPLICATION_UID,ApplicationInfo.FLAG_SYSTEM);
  mSettings.addSharedUserLP("String_Node_Str",MULTIPLE_APPLICATION_UIDS ? LOG_UID : FIRST_APPLICATION_UID,ApplicationInfo.FLAG_SYSTEM);
  String separateProcesses=SystemProperties.get("String_Node_Str");
  if (separateProcesses != null && separateProcesses.length() > 0) {
    if ("String_Node_Str".equals(separateProcesses)) {
      mDefParseFlags=PackageParser.PARSE_IGNORE_PROCESSES;
      mSeparateProcesses=null;
      Log.w(TAG,"String_Node_Str");
    }
 else {
      mDefParseFlags=0;
      mSeparateProcesses=separateProcesses.split("String_Node_Str");
      Log.w(TAG,"String_Node_Str" + separateProcesses);
    }
  }
 else {
    mDefParseFlags=0;
    mSeparateProcesses=null;
  }
  Installer installer=new Installer();
  if (installer.ping() && Process.supportsProcesses()) {
    mInstaller=installer;
  }
 else {
    mInstaller=null;
  }
  WindowManager wm=(WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
  Display d=wm.getDefaultDisplay();
  d.getMetrics(mMetrics);
synchronized (mInstallLock) {
synchronized (mPackages) {
      mHandlerThread.start();
      mHandler=new PackageHandler(mHandlerThread.getLooper());
      File dataDir=Environment.getDataDirectory();
      mAppDataDir=new File(dataDir,"String_Node_Str");
      mDrmAppPrivateInstallDir=new File(dataDir,"String_Node_Str");
      if (mInstaller == null) {
        File miscDir=new File(dataDir,"String_Node_Str");
        miscDir.mkdirs();
        mAppDataDir.mkdirs();
        mDrmAppPrivateInstallDir.mkdirs();
      }
      readPermissions();
      mRestoredSettings=mSettings.readLP();
      long startTime=SystemClock.uptimeMillis();
      EventLog.writeEvent(LOG_BOOT_PROGRESS_PMS_SYSTEM_SCAN_START,startTime);
      int scanMode=SCAN_MONITOR;
      if (mNoDexOpt) {
        Log.w(TAG,"String_Node_Str");
        scanMode|=SCAN_NO_DEX;
      }
      final HashSet<String> libFiles=new HashSet<String>();
      mFrameworkDir=new File(Environment.getRootDirectory(),"String_Node_Str");
      mDalvikCacheDir=new File(dataDir,"String_Node_Str");
      if (mInstaller != null) {
        boolean didDexOpt=false;
        String bootClassPath=System.getProperty("String_Node_Str");
        if (bootClassPath != null) {
          String[] paths=splitString(bootClassPath,':');
          for (int i=0; i < paths.length; i++) {
            try {
              if (dalvik.system.DexFile.isDexOptNeeded(paths[i])) {
                libFiles.add(paths[i]);
                mInstaller.dexopt(paths[i],Process.SYSTEM_UID,true);
                didDexOpt=true;
              }
            }
 catch (            FileNotFoundException e) {
              Log.w(TAG,"String_Node_Str" + paths[i]);
            }
catch (            IOException e) {
              Log.w(TAG,"String_Node_Str" + paths[i],e);
            }
          }
        }
 else {
          Log.w(TAG,"String_Node_Str");
        }
        if (mSharedLibraries.size() > 0) {
          Iterator<String> libs=mSharedLibraries.values().iterator();
          while (libs.hasNext()) {
            String lib=libs.next();
            try {
              if (dalvik.system.DexFile.isDexOptNeeded(lib)) {
                libFiles.add(lib);
                mInstaller.dexopt(lib,Process.SYSTEM_UID,true);
                didDexOpt=true;
              }
            }
 catch (            FileNotFoundException e) {
              Log.w(TAG,"String_Node_Str" + lib);
            }
catch (            IOException e) {
              Log.w(TAG,"String_Node_Str" + lib,e);
            }
          }
        }
        libFiles.add(mFrameworkDir.getPath() + "String_Node_Str");
        String[] frameworkFiles=mFrameworkDir.list();
        if (frameworkFiles != null) {
          for (int i=0; i < frameworkFiles.length; i++) {
            File libPath=new File(mFrameworkDir,frameworkFiles[i]);
            String path=libPath.getPath();
            if (libFiles.contains(path)) {
              continue;
            }
            if (!path.endsWith("String_Node_Str") && !path.endsWith("String_Node_Str")) {
              continue;
            }
            try {
              if (dalvik.system.DexFile.isDexOptNeeded(path)) {
                mInstaller.dexopt(path,Process.SYSTEM_UID,true);
                didDexOpt=true;
              }
            }
 catch (            FileNotFoundException e) {
              Log.w(TAG,"String_Node_Str" + path);
            }
catch (            IOException e) {
              Log.w(TAG,"String_Node_Str" + path,e);
            }
          }
        }
        if (didDexOpt) {
          String[] files=mDalvikCacheDir.list();
          if (files != null) {
            for (int i=0; i < files.length; i++) {
              String fn=files[i];
              if (fn.startsWith("String_Node_Str") || fn.startsWith("String_Node_Str")) {
                Log.i(TAG,"String_Node_Str" + fn);
                (new File(mDalvikCacheDir,fn)).delete();
              }
            }
          }
        }
      }
      mFrameworkInstallObserver=new AppDirObserver(mFrameworkDir.getPath(),OBSERVER_EVENTS,true);
      mFrameworkInstallObserver.startWatching();
      scanDirLI(mFrameworkDir,PackageParser.PARSE_IS_SYSTEM,scanMode | SCAN_NO_DEX);
      mSystemAppDir=new File(Environment.getRootDirectory(),"String_Node_Str");
      mSystemInstallObserver=new AppDirObserver(mSystemAppDir.getPath(),OBSERVER_EVENTS,true);
      mSystemInstallObserver.startWatching();
      scanDirLI(mSystemAppDir,PackageParser.PARSE_IS_SYSTEM,scanMode);
      mAppInstallDir=new File(dataDir,"String_Node_Str");
      if (mInstaller == null) {
        mAppInstallDir.mkdirs();
      }
      ArrayList<PackageSetting> deletePkgsList=mSettings.getListOfIncompleteInstallPackages();
      for (int i=0; i < deletePkgsList.size(); i++) {
        cleanupInstallFailedPackage(deletePkgsList.get(i));
      }
      deleteTempPackageFiles();
      EventLog.writeEvent(LOG_BOOT_PROGRESS_PMS_DATA_SCAN_START,SystemClock.uptimeMillis());
      mAppInstallObserver=new AppDirObserver(mAppInstallDir.getPath(),OBSERVER_EVENTS,false);
      mAppInstallObserver.startWatching();
      scanDirLI(mAppInstallDir,0,scanMode);
      mDrmAppInstallObserver=new AppDirObserver(mDrmAppPrivateInstallDir.getPath(),OBSERVER_EVENTS,false);
      mDrmAppInstallObserver.startWatching();
      scanDirLI(mDrmAppPrivateInstallDir,0,scanMode | SCAN_FORWARD_LOCKED);
      EventLog.writeEvent(LOG_BOOT_PROGRESS_PMS_SCAN_END,SystemClock.uptimeMillis());
      Log.i(TAG,"String_Node_Str" + ((SystemClock.uptimeMillis() - startTime) / 1000f) + "String_Node_Str");
      updatePermissionsLP();
      mSettings.writeLP();
      EventLog.writeEvent(LOG_BOOT_PROGRESS_PMS_READY,SystemClock.uptimeMillis());
      Runtime.getRuntime().gc();
    }
  }
}