[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: running debugger



Beni,

The dreaded gdb SIGTTOU problem. See the attached message.

I thought that it had to do with a multi-threaded program, but I didn't 
think hdgeant was multi-threaded. At any rate, I get around this by 
putting a .gdbinit file in my home directory containing the following line:

set print thread-events off

YMMV.

  -- Mark

Beni Zihlmann wrote:
> Hi All,
> I try to run hdgeant in debug mode and get the following:
> after starting the debugger and run hdgeant_d it suspends the process
> it start to run but never gets anywhere. any ideas? below is what I
> see on the screen:
>
> ifarml3> gdb /group/halld/Users/zihlmann/HALLD//bin/linux/hdgeant_d
> GNU gdb Red Hat Linux (6.6-35.fc8rh)
> Copyright (C) 2006 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and 
> you are
> welcome to change it and/or distribute copies of it under certain 
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for 
> details.
> This GDB was configured as "i386-redhat-linux-gnu"...
> Using host libthread_db library "/lib/libthread_db.so.1".
> (gdb) run
> Starting program: 
> /u/group/halld/Users/zihlmann/HALLD/bin/Linux_Fedora8-i686-gcc4.1.2/hdgeant_d 
>
>
> Suspended (tty output)
> ifarml3> fg
> gdb /group/halld/Users/zihlmann/HALLD//bin/linux/hdgeant_d
>
> warning: Missing the separate debug info file: 
> /usr/lib/debug/.build-id/ac/2eeb206486bb7315d6ac4cd64de0cb50838ff6.debug
>
> Program received signal SIGTTOU, Stopped (tty output).
> 0x00614eb6 in _dl_debug_vdprintf () from /lib/ld-linux.so.2
> (gdb) bt
> #0  0x00614eb6 in _dl_debug_vdprintf () from /lib/ld-linux.so.2
> #1  0x006151dc in _dl_dprintf () from /lib/ld-linux.so.2
> #2  0x006143fa in _dl_signal_error () from /lib/ld-linux.so.2
> #3  0x006137a1 in _dl_map_object_deps () from /lib/ld-linux.so.2
> #4  0x0060944d in dl_main () from /lib/ld-linux.so.2
> #5  0x0061a3db in _dl_sysdep_start () from /lib/ld-linux.so.2
> #6  0x006072f8 in _dl_start () from /lib/ld-linux.so.2
> #7  0x00606857 in _start () from /lib/ld-linux.so.2
> (gdb)
>
> cheers,
> Beni
>

-- BEGIN included message

I only get this when running in the debugger. I'm trying to find a 
different bug, but in the debugger I can't get past this. I have 
stripped down my MyProcessor.cc to a do only the set-up things. Find it 
and the header attached.

===error starts here===

This GDB was configured as "i386-redhat-linux-gnu"...
(gdb) r /u/scratch/marki/piplus_2.0gev.hddm
Starting program: 
/scratch/marki/halld_my_2008_06_13_fitest/bin/Linux-i686/fitter_d 
/u/scratch/marki/piplus_2.0gev.hddm
[Thread debugging using libthread_db enabled]

Suspended (tty output)
roentgen:fitter:1060> fg
gdb fitter_d
[New Thread 0xb7f376d0 (LWP 12185)]

Program received signal SIGTTOU, Stopped (tty output).
0x00110416 in __kernel_vsyscall ()
Missing separate debuginfos, use: debuginfo-install gcc.i386 glibc.i686
(gdb) bt
#0 0x00110416 in __kernel_vsyscall ()
#1 0x0370afe3 in __write_nocancel () from /lib/libc.so.6
#2 0x036a5fec in _IO_new_file_write () from /lib/libc.so.6
#3 0x036a7167 in _IO_new_do_write () from /lib/libc.so.6
#4 0x036a6b15 in _IO_new_file_overflow () from /lib/libc.so.6
#5 0x036a9913 in __overflow () from /lib/libc.so.6
#6 0x036a30a8 in putc () from /lib/libc.so.6
#7 0x0420d42c in __gnu_cxx::stdio_sync_filebuf<char, 
std::char_traits<char> >::overflow () from /usr/lib/libstdc++.so.6
#8 0x042109fa in std::ostream::put () from /usr/lib/libstdc++.so.6
#9 0x04210bad in std::endl<char, std::char_traits<char> > () from 
/usr/lib/libstdc++.so.6
#10 0x0420dc0f in std::ostream::operator<< () from /usr/lib/libstdc++.so.6
#11 0x0823678c in DMagneticFieldMapCalibDB::ReadMap (this=0x9121d40, 
runnumber=1, context=
{static npos = 4294967295, _M_dataplus = {<std::allocator<char>> = 
{<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data 
fields>}, _M_p = 0xbf94add0 "�<'\004�n\020\t\001"}}) at 
DMagneticFieldMapCalibDB.cc:66
#12 0x08237a1a in DMagneticFieldMapCalibDB (this=0x9121d40, 
japp=0xbf94ae88) at DMagneticFieldMapCalibDB.cc:22
#13 0x08176f47 in DApplication (this=0xbf94ae88, narg=2, 
argv=0xbf94b0f4) at DApplication.cc:38
#14 0x08140524 in main (narg=1684104530, argv=0x20676e69) at fitter.cc:10

// MyProcessor.cc
//

#include <iostream>
#include <vector>
#include <string>

#include "MyProcessor.h"
#include "FDC/DFDCHit.h"
#include "FDC/DFDCPseudo_factory.h"
#include "FDC/DFDCSegment_factory.h"
#include "TRACKING/DMCThrown.h"
#include "TRACKING/DMCTrackHit.h"
#include "DANA/DApplication.h"

//------------------------------------------------------------------
// MyProcessor 
//------------------------------------------------------------------
MyProcessor::MyProcessor()
{
}

//------------------------------------------------------------------
// ~MyProcessor 
//------------------------------------------------------------------
MyProcessor::~MyProcessor()
{
  cout << "MyProcessor destructor called\n";
}

//------------------------------------------------------------------
// init 
//------------------------------------------------------------------
jerror_t MyProcessor::init(void)
{
}

//------------------------------------------------------------------
// fini
//------------------------------------------------------------------
jerror_t MyProcessor::fini(void)
{
  cout << "fini called\n";
}

//------------------------------------------------------------------
// brun 
//------------------------------------------------------------------
jerror_t MyProcessor::brun(JEventLoop *eventLoop, int runnumber)
{
DApplication* dapp=dynamic_cast<DApplication*>(eventLoop->GetJApplication());
  bfield = dapp->GetBfield();
  JFactory_base *base = eventLoop->GetFactory("DFDCSegment");
	segment_factory = dynamic_cast<DFDCSegment_factory*>(base);
	return NOERROR;
}

//------------------------------------------------------------------
// erun 
//------------------------------------------------------------------
jerror_t MyProcessor::erun()
{
 return NOERROR;
}

//------------------------------------------------------------------
// evnt 
//------------------------------------------------------------------

jerror_t MyProcessor::evnt(JEventLoop *eventLoop, int eventnumber)
{

  cout << "----------- New Event " << eventnumber << " -------------" << endl;
  vector<const DFDCHit*>fdchits;
  //eventLoop->Get(fdchits);  

  vector<const DFDCPseudo*>pseudopoints;
  eventLoop->Get(pseudopoints);  
  
  vector<const DMCTrackHit*>truepoints;
  eventLoop->Get(truepoints);

  vector<const DMCThrown*>thrown;
  eventLoop->Get(thrown);

  int size =  pseudopoints.size();
  cout << "number of pseudopoints = " << size << endl;

  // test of B field map

  {

    double x=0.0, y = 0.0, z = 65.0, Bx, By, Bz;
    bfield->GetField(x, y, z, Bx, By, Bz);
    cout << "r = " << x << ',' << y << ',' << z
	 << " B = " << Bx << ',' << By << ',' << Bz << endl;
    
  }
  
  return NOERROR;
 
}

// Author: David Lawrence  June 25, 2004
//
//
// MyProcessor.h
//
/// Example program for a Hall-D analyzer which uses DANA
///

#ifndef _MYPROCESSOR_H_
#define _MYPROCESSOR_H_

#include <JANA/JEventProcessor.h>
#include "HDGEOMETRY/DMagneticFieldMap.h"
#include "FDC/DFDCSegment_factory.h"
#include <TH1F.h>
#include <TFile.h>

class MyProcessor:public JEventProcessor
{
 public:
  MyProcessor();
  ~MyProcessor();
  jerror_t init(void);						///< Called once at program start.
  jerror_t brun(JEventLoop *eventLoop, int runnumber);			///< Called everytime a new run number is detected.
  jerror_t evnt(JEventLoop *eventLoop, int eventnumber);		///< Called every event.
  int eventNo;
  jerror_t erun(void);
  jerror_t fini(void);
		
 private:
  
  const DMagneticFieldMap *bfield;
  
  DFDCSegment_factory *segment_factory;
  ofstream *dataFile; 
  ofstream *trajFile; 

  TH1F *hPsHits;
  TFile *rootfile;
};

#endif // _MYPROCESSOR_H_

-- END included message