Re: PyROOT + geometry

From: OKUMURA, Akira <oxon_at_astro.isas.jaxa.jp>
Date: Mon, 23 May 2011 13:10:11 -0700


Hello ROOTers again,

The last line of the sample script, world.Draw(), should be replaced by world.Draw("ogl").

Regards,

--
OKUMURA, Akira oxon@{astro.isas.jaxa.jp,stanford.edu}
Institute of Space and Astronautical Science (ISAS/JAXA)
Now at KIPAC/SLAC/Stanford
Varian Physics #306, 382 Via Pueblo Mall, MC 4060
Stanford, CA 94305-4060
TEL 650-736-0971/FAX 650-724-5065
Skype : okumura.akira

On 2011/05/22, at 13:05, OKUMURA, Akira wrote:


> Hello ROOTers,
>
> A very simple python script using the ROOT geom library cause a segmentation fault, while the C++ equivalent runs as expected. Would you tell me what the problem is in my test.py, please?
>
> Using ROOT 5.29/01 + Python 2.6.1 + Mac OS X 10.6.7.
>
> This problem does not happen on SL 5.5 (64 bit) with ROOT 5.28 + python 2.6.6.
>
> Regards,
>
> -------------------
> test.py
>
> import ROOT
>
> manager = ROOT.TGeoManager("manager", "Galaxy")
> worldbox = ROOT.TGeoBBox("worldbox", 100, 100, 100)
> world = ROOT.TGeoVolume("world", worldbox)
> manager.SetTopVolume(world)
>
> manager.CloseGeometry()
> world.Draw()
>
> -------------------
> error log
>
> $ python
> Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
> [GCC 4.2.1 (Apple Inc. build 5646)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import test
> Info in <TGeoManager::TGeoManager>: Geometry manager, Galaxy created
> Info in <TGeoManager::SetTopVolume>: Top volume is world. Master volume is world
> Info in <TGeoManager::CheckGeometry>: Fixing runtime shapes...
> Info in <TGeoManager::CheckGeometry>: ...Nothing to fix
> Info in <TGeoManager::CloseGeometry>: Counting nodes...
> Info in <TGeoManager::Voxelize>: Voxelizing...
> Info in <TGeoManager::CloseGeometry>: Building cache...
> Info in <TGeoNavigator::BuildCache>: --- Maximum geometry depth set to 100
> Info in <TGeoManager::CloseGeometry>: 1 nodes/ 1 volume UID's in Galaxy
> Info in <TGeoManager::CloseGeometry>: ----------------modeler ready----------------
> Info in <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
>>>>
> *** Break *** segmentation violation
>
>
>
> ===========================================================
> There was a crash.
> This is the entire stack trace of all threads:
> ===========================================================
>
> Thread 4 (process 9389):
> #0 0x00007fff84421f4a in __workq_kernreturn ()
> #1 0x00007fff8442235c in _pthread_wqthread ()
> #2 0x00007fff84421fc5 in start_wqthread ()
>
> Thread 3 (process 9389):
> #0 0x00007fff8442112a in kevent ()
> #1 0x00007fff84422ffd in _dispatch_mgr_invoke ()
> #2 0x00007fff84422cd4 in _dispatch_queue_invoke ()
> #3 0x00007fff844227fe in _dispatch_worker_thread2 ()
> #4 0x00007fff84422128 in _pthread_wqthread ()
> #5 0x00007fff84421fc5 in start_wqthread ()
>
> Thread 2 (process 9389):
> #0 0x00007fff84485f6e in wait4 ()
> #1 0x00007fff8449a526 in system ()
> #2 0x000000010110c135 in TUnixSystem::StackTrace ()
> #3 0x0000000101109281 in TUnixSystem::DispatchSignals ()
> #4 <signal handler called>
> #5 0x00007fff84f3e2e5 in glEnable ()
> #6 0x00000001088c4d22 in TGLViewer::InitGL ()
> #7 0x00000001088c4e21 in TGLViewer::PreDraw ()
> #8 0x00000001088c69a8 in TGLViewer::DoDrawMono ()
> #9 0x00000001088c74cc in TGLViewer::DoDraw ()
> #10 0x00000001088c9f06 in TGLRedrawTimer::Notify ()
> #11 0x00000001010b197d in TTimer::CheckTimer ()
> #12 0x0000000101106556 in TUnixSystem::DispatchTimers ()
> #13 0x000000010110952e in TUnixSystem::DispatchOneEvent ()
> #14 0x00000001010a11f8 in TSystem::ProcessEvents ()
> #15 0x000000010123a15d in G__G__Base2_249_0_25 ()
> #16 0x0000000101882b6a in Cint::G__CallFunc::Execute ()
> #17 0x000000010058e911 in PyROOT::TBoolExecutor::Execute ()
> #18 0x0000000100595092 in PyROOT::TMethodHolder<PyROOT::TScopeAdapter, PyROOT::TMemberAdapter>::CallSafe ()
> #19 0x0000000100595246 in PyROOT::TMethodHolder<PyROOT::TScopeAdapter, PyROOT::TMemberAdapter>::Execute ()
> #20 0x000000010059283e in PyROOT::TMethodHolder<PyROOT::TScopeAdapter, PyROOT::TMemberAdapter>::operator() ()
> #21 0x000000010059a0c8 in PyROOT::(anonymous namespace)::mp_call ()
> #22 0x000000010000aff3 in PyObject_Call ()
> #23 0x000000010008a51a in PyEval_EvalFrameEx ()
> #24 0x000000010008acce in PyEval_EvalCodeEx ()
> #25 0x000000010002c88f in PyClassMethod_New ()
> #26 0x000000010000aff3 in PyObject_Call ()
> #27 0x000000010008a54e in PyEval_EvalFrameEx ()
> #28 0x00000001000892e1 in PyEval_EvalFrameEx ()
> #29 0x00000001000892e1 in PyEval_EvalFrameEx ()
> #30 0x000000010008acce in PyEval_EvalCodeEx ()
> #31 0x000000010002c8e1 in PyClassMethod_New ()
> #32 0x000000010000aff3 in PyObject_Call ()
> #33 0x000000010001a9df in PyClass_New ()
> #34 0x000000010000aff3 in PyObject_Call ()
> #35 0x00000001000849db in PyEval_CallObjectWithKeywords ()
> #36 0x00000001000b1db6 in initthread ()
> #37 0x00007fff844414f6 in _pthread_start ()
> #38 0x00007fff844413a9 in thread_start ()
>
> Thread 1 (process 9389):
> #0 0x00007fff84442f8a in __semwait_signal ()
> #1 0x00007fff84446da1 in _pthread_cond_wait ()
> #2 0x00000001000adcea in PyThread_acquire_lock ()
> #3 0x00000001000852e4 in PyEval_RestoreThread ()
> #4 0x00000001004f1a62 in readline_until_enter_or_signal [inlined] () at /Users/oxon/sw/readline-2.6.4/Modules/readline.c:919
> #5 0x00000001004f1a62 in call_readline (sys_stdin=<value temporarily unavailable, due to optimizations>, sys_stdout=<value temporarily unavailable, due to optimizations>, prompt=<value temporarily unavailable, due to optimizations>) at Modules/readline.c:1002
> #6 0x00000001000076a1 in PyOS_Readline ()
> #7 0x0000000100008a57 in PyTokenizer_FromString ()
> #8 0x00000001000090a0 in PyTokenizer_Get ()
> #9 0x0000000100005698 in PyParser_AddToken ()
> #10 0x00000001000a2320 in PyParser_ASTFromFile ()
> #11 0x00000001000a443f in PyRun_InteractiveOneFlags ()
> #12 0x00000001000a4615 in PyRun_InteractiveLoopFlags ()
> #13 0x00000001000a4685 in PyRun_AnyFileExFlags ()
> #14 0x00000001000b0286 in Py_Main ()
> #15 0x0000000100000e6c in start ()
> ===========================================================
>
>
> The lines below might hint at the cause of the crash.
> If they do not help you then please submit a bug report at
> http://root.cern.ch/bugs. Please post the ENTIRE stack trace
> from above as an attachment in addition to anything else
> that might help us fixing this issue.
> ===========================================================
> #5 0x00007fff84f3e2e5 in glEnable ()
> #6 0x00000001088c4d22 in TGLViewer::InitGL ()
> #7 0x00000001088c4e21 in TGLViewer::PreDraw ()
> #8 0x00000001088c69a8 in TGLViewer::DoDrawMono ()
> #9 0x00000001088c74cc in TGLViewer::DoDraw ()
> #10 0x00000001088c9f06 in TGLRedrawTimer::Notify ()
> #11 0x00000001010b197d in TTimer::CheckTimer ()
> #12 0x0000000101106556 in TUnixSystem::DispatchTimers ()
> #13 0x000000010110952e in TUnixSystem::DispatchOneEvent ()
> #14 0x00000001010a11f8 in TSystem::ProcessEvents ()
> ===========================================================
>
> --
> OKUMURA, Akira oxon@{astro.isas.jaxa.jp,stanford.edu}
> Institute of Space and Astronautical Science (ISAS/JAXA)
> Now at KIPAC/SLAC/Stanford
> Varian Physics #306, 382 Via Pueblo Mall, MC 4060
> Stanford, CA 94305-4060
> TEL 650-736-0971/FAX 650-724-5065
> Skype : okumura.akira
>
Received on Mon May 23 2011 - 22:10:26 CEST

This archive was generated by hypermail 2.2.0 : Tue May 24 2011 - 05:50:01 CEST