Okay, a bit more digging and I’ve discovered the following:
Both EXC_BAD_ACCESS and signal 13 (EACCES) refer to memory access errors.
Most bizarre of all though is that the cause of this attempt to access the unavailable memory appears to be linked to the number of command line arguments. Using gdb as above and then doing:
(which if I’m understanding correctly prints the place in the source corresponding to where the error happened) gives:
4231 }
4232 }
4233
4234 }
4235
4236
4237 //______________________________________________________________________________
4238 int main(int argc, char **argv)
4239 {
4240 if (argc < 2) {
(This is actually in the file rootcint.cxx, which gets copied to rootcint_tmp.cxx before being compiled into rootcint_tmp during the build process, but is then deleted. In order to let gdb find the place in the source I repeated what the build system does manually and copied rootcint.cxx to rootcint_tmp.cxx, I assume that they’re the same files because trying all the examples below with bin/rootcint gives the same results as using core/utils/src/rootcint_tmp). The only pointer in the above segment of code is argv, indicating that this may be the problem. I’m guessing a single integer wouldn’t cause an issue like this?
Anyway, i tried to test this by removing some of the command line arguments from the rootcint_tmp command and it seems that the critical number is 40 arguments. What’s more the length of the arguments don’t seem to matter for example, the result of:
is of course an error:
but crucially, not a crash, whereas:
results in a segmentation fault. This is not a command line length issue because:
[quote]$ core/utils/src/rootcint_tmp -cint -f core/base/src/G__Base1.cxx -c core/base/inc/TApplication.h core/base/inc/TApplicationImp.h core/base/inc/TAtt3D.h core/base/inc/TAttAxis.h core/base/inc/TAttBBox.h core/base/inc/TAttFill.h core/base/inc/TAttLine.h core/base/inc/TAttMarker.h core/base/inc/TAttPad.h core/base/inc/TAttText.h core/base/inc/TBenchmark.h core/base/inc/TBrowser.h core/base/inc/TBrowserImp.h core/base/inc/TBuffer.h core/base/inc/TBuffer3D.h core/base/inc/TBuffer3DTypes.h core/base/inc/TCanvasImp.h core/base/inc/TColor.h core/base/inc/TContextMenu.h core/base/inc/TContextMenuImp.h core/base/inc/TControlBarImp.h core/base/inc/TDatime.h core/base/inc/TDirectory.h core/base/inc/TEnv.h core/base/inc/TError.h core/base/inc/TException.h core/base/inc/TExec.h core/base/inc/TFolder.h core/base/inc/TGuiFactory.h core/base/inc/TInspectorImp.h core/base/inc/TMD5.h core/base/inc/TMacro.h core/base/inc/TMathBase.h core/base/inc/TMemberInspector.h spurious/but/nonetheless/outrageously/long/and/complicated/argument core/base/inc/LinkDef1.h
[/quote]
Throws the expected error:
[quote]Error: cannot open file “spurious/but/nonetheless/outrageously/long/and/complicated/argument” :0:
!!!Removing core/base/src/G__Base1.cxx core/base/src/G__Base1.h !!!
Error: core/utils/src/rootcint_tmp: error loading headers…
[/quote]
To illustrate that this works even for non-invented filenames:
[quote]$ core/utils/src/rootcint_tmp -cint -f core/base/src/G__Base1.cxx -c core/base/inc/TApplication.h core/base/inc/TApplicationImp.h core/base/inc/TAtt3D.h core/base/inc/TAttAxis.h core/base/inc/TAttBBox.h core/base/inc/TAttFill.h core/base/inc/TAttLine.h core/base/inc/TAttMarker.h core/base/inc/TAttPad.h core/base/inc/TAttText.h core/base/inc/TBenchmark.h core/base/inc/TBrowser.h core/base/inc/TBrowserImp.h core/base/inc/TBuffer.h core/base/inc/TBuffer3D.h core/base/inc/TBuffer3DTypes.h core/base/inc/TCanvasImp.h core/base/inc/TColor.h core/base/inc/TContextMenu.h core/base/inc/TContextMenuImp.h core/base/inc/TControlBarImp.h core/base/inc/TDatime.h core/base/inc/TDirectory.h core/base/inc/TEnv.h core/base/inc/TError.h core/base/inc/TException.h core/base/inc/TExec.h core/base/inc/TFolder.h core/base/inc/TGuiFactory.h core/base/inc/TInspectorImp.h core/base/inc/TMD5.h core/base/inc/TMacro.h core/base/inc/TMathBase.h core/base/inc/TMemberInspector.h core/base/inc/TMessageHandler.h core/base/inc/LinkDef1.h
Error: link requested for unknown class TFileHandler core/base/inc/LinkDef1.h:148:
Error: link requested for unknown class TStyle core/base/inc/LinkDef1.h:150:
Error: link requested for unknown class TVirtualX core/base/inc/LinkDef1.h:151:
Error: link requested for unknown class TVirtualViewer3D core/base/inc/LinkDef1.h:154:
Error: link requested for unknown class TGLManager core/base/inc/LinkDef1.h:156:
Error: link requested for unknown class TVirtualGLPainter core/base/inc/LinkDef1.h:157:
Error: link requested for unknown class TVirtualGLManip core/base/inc/LinkDef1.h:158:
Error: link requested for unknown class TVirtualPS core/base/inc/LinkDef1.h:159:
Error: link requested for unknown class TGLPaintDevice core/base/inc/LinkDef1.h:160:
Error: link requested for unknown class TVirtualPadEditor core/base/inc/LinkDef1.h:162:
Error: link requested for unknown class TVirtualFFT core/base/inc/LinkDef1.h:164:
Warning: Error occurred during reading source files
Note: Link requested for undefined class TVirtualPad (ignore this message) :0:
Warning: Error occurred during dictionary source generation
!!!Removing core/base/src/G__Base1.cxx core/base/src/G__Base1.h !!!
Error: core/utils/src/rootcint_tmp: error loading headers…
$ core/utils/src/rootcint_tmp -cint -f core/base/src/G__Base1.cxx -c core/base/inc/TApplication.h core/base/inc/TApplicationImp.h core/base/inc/TAtt3D.h core/base/inc/TAttAxis.h core/base/inc/TAttBBox.h core/base/inc/TAttFill.h core/base/inc/TAttLine.h core/base/inc/TAttMarker.h core/base/inc/TAttPad.h core/base/inc/TAttText.h core/base/inc/TBenchmark.h core/base/inc/TBrowser.h core/base/inc/TBrowserImp.h core/base/inc/TBuffer.h core/base/inc/TBuffer3D.h core/base/inc/TBuffer3DTypes.h core/base/inc/TCanvasImp.h core/base/inc/TColor.h core/base/inc/TContextMenu.h core/base/inc/TContextMenuImp.h core/base/inc/TControlBarImp.h core/base/inc/TDatime.h core/base/inc/TDirectory.h core/base/inc/TEnv.h core/base/inc/TError.h core/base/inc/TException.h core/base/inc/TExec.h core/base/inc/TFolder.h core/base/inc/TGuiFactory.h core/base/inc/TInspectorImp.h core/base/inc/TMD5.h core/base/inc/TMacro.h core/base/inc/TMathBase.h core/base/inc/TMemberInspector.h core/base/inc/TMessageHandler.h core/base/inc/TNamed.h core/base/inc/LinkDef1.h
Segmentation fault
[/quote]
I may be misinterpreting what’s going on but it does seem like for 64 bit compilation under OSX 10.5.7 (and apparently only on my mac), having too many command line arguments is crashing rootcint. Does anybody have any suggestions as to why this might be happening, is there some system variable that I’ve inadvertently modified?
Any help appreciated,
Cheers,
Hugh