This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

type_info not initialized


Hiya,

I ran into a case where a typeid() returns an uninitialized object.

This bug occurs in both 2.95.1 and the CVS version of yesterday.

A little piece of the code I am executing now reads:

template<class EVENTREQUESTBASE, class EVENTREQUESTQUEUE = event_request_queue_tct<EVENTREQUESTBASE> >
class event_data_server_tct : public EVENTREQUESTQUEUE {
  typedef typename EVENTREQUESTBASE::event_type_ct event_type_ct;
//...
public:
  template<class EVENTCLIENT>
  void operator()(typename EVENTREQUESTBASE::event_request_data_ct rd, EVENTCLIENT& ec, void (EVENTCLIENT::*em)(event_type_ct const&))
      {
	busy_interface_ct::None const* p1 = new busy_interface_ct::None;
	cerr << typeid(p1).name() << endl;
	cerr << typeid(ec).name() << endl;
	event_request_data_tct<EVENTCLIENT, const busy_interface_ct::None> x1(ec, em, rd, busy_interface_ct::none);
	cerr << typeid(x1).name() << endl;
	cerr << typeid(&x1).name() << endl;
	event_request_data_tct<EVENTCLIENT, const busy_interface_ct::None>* event_request_data =
	    new event_request_data_tct<EVENTCLIENT, busy_interface_ct::None const>(ec, em, rd, busy_interface_ct::none);
	cerr << typeid(event_request_data).name() << endl;
      }
//...
};

Which outputs:

PCQ217busy_interface_ct4None
Q35libcw10_internal_t8Instance3Z16alarm_tst_app_ctim1Z19GlobalConverterVoid
Q2t21event_data_server_tct2Z17SignalRequestBaseZ18SignalRequestQueuet22event_request_data_tct2Z12libcw_app_ctZCQ217busy_interface_ct4None
øÿÿÿT       e@¨e@(oe@|oe@ðoe@
øÿÿÿT       e@¨e@(oe@|oe@ðoe@

I've tried all day to make a small working test case out of this one,
but I failed :(.  When I change anything significant, the bug goes away.
Things that make the bug go away are:

1) linking statically instead of with a shared library.
2) moving any class or function outside the shared library that would
   simplify the case.

For instance, without changing anything, but simply linking my program
with the static libcw.a, it outputs:

PCQ217busy_interface_ct4None
Q35libcw10_internal_t8Instance3Z16alarm_tst_app_ctim1Z19GlobalConverterVoid
Q2t21event_data_server_tct2Z17SignalRequestBaseZ18SignalRequestQueuet22event_request_data_tct2Z12libcw_app_ctZCQ217busy_interface_ct4None
PQ2t21event_data_server_tct2Z17SignalRequestBaseZ18SignalRequestQueuet22event_request_data_tct2Z12libcw_app_ctZCQ217busy_interface_ct4None
PQ2t21event_data_server_tct2Z17SignalRequestBaseZ18SignalRequestQueuet22event_request_data_tct2Z12libcw_app_ctZCQ217busy_interface_ct4None

I am stuck with this one - but I also need it to be fixed :/, I can't find
a work around of this case either.  Can someone help me to fix this?
With ideas, hints, things I could try.  I can't provide a working example
since I see no other way to do that than to give you my whole project --
and that is simply not released yet :/

I have the latest (cvs) egcs tree here.  Just tell me what to do to debug
gcc for this case :)

-- 
 Carlo Wood  <carlo@runaway.xs4all.nl>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]