Message: RE: Mixed data type NTUPLE Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None RE: Mixed data type NTUPLE 

Forum: Analysis
Re: None Mixed data type NTUPLE (Fan Lei)
Re: None Re: Mixed data type NTUPLE (Tony Johnson)
Re: None Re: Mixed data type NTUPLE (Fan Lei)
Date: 13 Sep, 2004
From: <tony_johnson@slac.stanford.edu>

Hi Fan, I looked into this a little more. Three comments:

1) It is a very good idea to set the environment variable 

setenv JNI_SHOW_DEBUG 1 

when using JAIDA. If you do this it will print an error
message if you make an error like specifying your column as
String instead of string. Otherwise it just follows the AIDA
convention of returning null or false which no-one remembers to
test for.

2) There is a bug in AIDAJNI which I think is causing the crash
you are seeing. To fix it in the short term you will need
to build your own version of AIDAJNI from the source, and
replace the definition of 

    JITuple::fill(int column, const std::string & value)  

At line 509 of hep/aida/jni/JITuple.cpp with this:

JNIEXPORT bool JITuple::fill(int column, const std::string & value) {
        
	jstring jvalue;
      NEWSTRING(jvalue, value)
	env->CallVoidMethod(ref, fillOILjava_lang_StringECVMethod, column, jvalue);
	DELSTRING(jvalue);
	return !JNIUtil::exceptions(env);
}

The source code for AIDAJNI can be found at:

http://java.freehep.org/aidajni/SourceDistributions.html

3) Be very careful when calling the fill method to specify the 
string properly (const std::string&), otherwise C++ will accidentally
call the method which takes bool as an argument instead. This works:

	const std::string test = "Just Testing";
	tuple->fill(6,test);

Tony 


> -----Original Message-----
> From: fan.lei@cern.ch [mailto:fan.lei@cern.ch] 
> Sent: Monday, September 13, 2004 8:57 AM
> To: publichypernews
> Subject: Re: Mixed data type NTUPLE
> 
> *** Discussion title: Analysis
> Email replies to PublicHyperNews@slac.stanford.edu must include:
>   In-Reply-To: <"/analysis/85/1/1"@geant4-hn.slac.stanford.edu>
>   Subject: ...change this to be about your reply.
> 
> The reason I used "String" instead of "string" was that the 
> lower case in fact make the program crash during the run. 
> Using the upper case it at least completed the execution but 
> mixed type tuples were not saved in the aida file. Below is 
> the gdb of the crash case. It brook down when booking the 
> mixed type tuples.
> 
> Fan
> 
> ---------------------------------------------
> 
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 1081983616 (LWP 751)]
> 0x43ac5e78 in ?? ()
> (gdb) bt
> #0  0x43ac5e78 in ?? ()
> #1  0x43abe104 in ?? ()
> #2  0x402e2a54 in JavaCalls::call_helper ()
>    from /usr/local/java/j2sdk1.4.2/jre/lib/i386/client/libjvm.so
> #3  0x403969ed in os::os_exception_wrapper ()
>    from /usr/local/java/j2sdk1.4.2/jre/lib/i386/client/libjvm.so
> #4  0x402e2ca6 in JavaCalls::call ()
>    from /usr/local/java/j2sdk1.4.2/jre/lib/i386/client/libjvm.so
> #5  0x402eb4a7 in jni_invoke_nonstatic ()
>    from /usr/local/java/j2sdk1.4.2/jre/lib/i386/client/libjvm.so
> #6  0x402ee6de in jni_CallObjectMethod ()
>    from /usr/local/java/j2sdk1.4.2/jre/lib/i386/client/libjvm.so
> #7  0x40ae5b36 in JNU_GetStringPlatformChars ()
>    from /usr/local/j2sdk/j2sdk1.4.2/jre/lib/i386/libjava.so
> #8  0x40ae9e7f in Java_java_io_UnixFileSystem_canonicalize0 ()
>    from /usr/local/j2sdk/j2sdk1.4.2/jre/lib/i386/libjava.so
> #9  0x43ac6bf2 in ?? ()
> #10 0x43ac0d04 in ?? ()
> #11 0x43ac0d04 in ?? ()
> #12 0x43ac0d04 in ?? ()
> #13 0x43ac0c83 in ?? ()
> #14 0x43ac0ddb in ?? ()
> #15 0x43ac0ddb in ?? ()
> #16 0x43ac0ddb in ?? ()
> #17 0x43abe104 in ?? ()
> #18 0x402e2a54 in JavaCalls::call_helper ()
>    from /usr/local/java/j2sdk1.4.2/jre/lib/i386/client/libjvm.so
> #19 0x403969ed in os::os_exception_wrapper ()
>    from /usr/local/java/j2sdk1.4.2/jre/lib/i386/client/libjvm.so
> #20 0x402e2ca6 in JavaCalls::call ()
>    from /usr/local/java/j2sdk1.4.2/jre/lib/i386/client/libjvm.so
> #21 0x402e2de6 in JavaCalls::call_static ()
>    from /usr/local/java/j2sdk1.4.2/jre/lib/i386/client/libjvm.so
> #22 0x403dbc15 in call_initializeSystemClass ()
>    from /usr/local/java/j2sdk1.4.2/jre/lib/i386/client/libjvm.so
> #23 0x403deae8 in Threads::create_vm ()
>    from /usr/local/java/j2sdk1.4.2/jre/lib/i386/client/libjvm.so
> #24 0x403057ef in JNI_CreateJavaVM ()
>    from /usr/local/java/j2sdk1.4.2/jre/lib/i386/client/libjvm.so
> #25 0x4013c0b8 in JNICcreateJVM () from 
> /fred/flei/AIDAJNI-3.2.2/lib/Linux-g++/libFHJNI.so
> #26 0x4013c400 in JNIUtil::createJVM(JNIEnv_**, JavaVM_**) ()
>    from /fred/flei/AIDAJNI-3.2.2/lib/Linux-g++/libFHJNI.so
> #27 0x4008a616 in JAIDA::JIAnalysisFactory::JIAnalysisFactory() ()
>    from /fred/flei/AIDAJNI-3.2.2/lib/Linux-g++/libAIDAJNI.so
> ---Type <return> to continue, or q <return> to quit---
> #28 0x4008b1bf in AIDA_createAnalysisFactory ()
>    from /fred/flei/AIDAJNI-3.2.2/lib/Linux-g++/libAIDAJNI.so
> #29 0x0806245f in Histo::book() ()
> #30 0x0805294c in AnalysisManager::BeginOfRun() 
> (this=0x8c95b50) at src/AnalysisManager.cc:82
> #31 0x0805fee7 in exrdmRunAction::BeginOfRunAction(G4Run 
> const*) (this=0x8cbf290, aRun=0xa4b90a8)
>     at src/exrdmRunAction.cc:29
> #32 0x085dfed3 in G4RunManager::RunInitialization() ()
> #33 0x085dfad8 in G4RunManager::BeamOn(int, char const*, int) ()
> #34 0x085e8a67 in G4RunMessenger::SetNewValue(G4UIcommand*, 
> G4String) ()
> #35 0x08744974 in G4UIcommand::DoIt(G4String) ()
> #36 0x087522ee in G4UImanager::ApplyCommand(char const*) ()
> #37 0x0875ae5e in G4UIbatch::SessionStart() ()
> #38 0x08750589 in G4UImanager::ExecuteMacroFile(char const*) ()
> #39 0x0875fac7 in 
> G4UIcontrolMessenger::SetNewValue(G4UIcommand*, G4String) () 
> #40 0x08744974 in G4UIcommand::DoIt(G4String) ()
> #41 0x087522ee in G4UImanager::ApplyCommand(char const*) ()
> #42 0x080515d0 in main (argc=2, argv=0xbfffe024) at exRDM.cc:96
> #43 0x42015574 in __libc_start_main () from /lib/tls/libc.so.6
> 
>   
> 

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: RE: Mixed data type NTUPLE   (Fan Lei - 15 Sep, 2004)
 Add Message Add Message
to: "RE: Mixed data type NTUPLE"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]