Anonymous avatar Anonymous committed 9978dc0

'fix bug #92267: remove LD_PRELOAD from env for AthFile-subprocesses'

Comments (0)

Files changed (2)

+2012-03-30  Sebastien Binet  <binet@cern.ch>
+
+	* tagging PyUtils-00-12-02
+	* fix bug #92267: remove LD_PRELOAD from env for AthFile-subprocesses
+	* M python/AthFile/impl.py
+
 2012-03-30  Frank Winklmeier  <fwinkl@cern>
 
 	* tagging PyUtils-00-12-01

python/AthFile/impl.py

         if 'PYTHONINSPECT' in self._sub_env:
             del self._sub_env['PYTHONINSPECT']
 
+        # prevent from running athena with igprof
+        for k in ('LD_PRELOAD', 'IGPROF'):
+            if k in self._sub_env:
+                del self._sub_env[k]
+
     def _root_open(self, fname, raw=False):
         import PyUtils.Helpers as H
         with H.restricted_ldenviron(projects=['AtlasCore']):
                 re.compile("Error in <T.*?File::Init>:.*? not a ROOT file")]):
                 # for AttributeListLayout which uses CINT for its dict...
                 # first try the APR version
-                if 0 != root.gSystem.Load('libRootCollection'):
+                ooo = root.gSystem.Load('libRootCollection')
+                if ooo < 0:
                     # then try the POOL one
                     root.gSystem.Load('liblcg_RootCollection')
                 if raw:
                        file_name,]
                 subprocess.call(cmd, env=self._sub_env)
                 #
-                with H.restricted_ldenviron(projects=projects):
+                with H.restricted_ldenviron(projects=None):
                     is_tag, tag_ref, tag_guid, nentries, runs, evts = self._is_tag_file(f_root, evtmax)
                     if is_tag:
                         f['stream_names'] = ['TAG']
                             }
                         import os
                         stdout = open('athfile-%i.log.txt' % os.getpid(), "a")
+                        print >> stdout,"="*80
+                        print >> stdout,self._sub_env
+                        print >> stdout,"="*80
+                        stdout.flush()
                         sc = app.run(stdout=stdout, env=self._sub_env)
+                        stdout.flush()
                         stdout.close()
                         import AthenaCommon.ExitCodes as ath_codes
                         if sc == 0:
                                 raise IOError(sc, err)
                             msg.info('athena failed to initialize.')
                             msg.info('=> probably an empty input POOL file')
-                        if os.path.exists(out_pkl_fname):
-                            os.remove(out_pkl_fname)
+                        ## if os.path.exists(out_pkl_fname):
+                        ##     os.remove(out_pkl_fname)
                     # TAG-file
                     # app.exit()
             else: # bytestream
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.