By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,249 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

Core Dump in Deleting STL [stlport4] vector

P: n/a
I am having problem with an application which core dumps while deleting
a vector
here is the snippet :

Event_Node_t struct defined in the header :

+++++++++++++++++++++++++++++++++++++
struct Event_Node_t
{
int id : 24;
int frame : 3;
unsigned is_first_start : 1;
unsigned disqualified : 1;
unsigned truncated : 1;
Event_t e_type;
int pos, pwm_sep;
// pos is the last base of the codon, numbered starting at 1
double score, pwm_score;
Event_Node_t * frame_pred;
Event_Node_t * best_pred;

Event_Node_t () // default constructor
{ is_first_start = disqualified = truncated = 0; }

void Set_Frame_From_Pos
(void);
};

+++++++++++++++++++++++++++++++++++++++++++++++

In the CC file

static Event_Node_t * Last_Event [6];

//Last_Event initialized

Initialize_Terminal_Events(First_Event, Final_Event, Best_Event,
Last_Event);

//function definition

static void Initialize_Terminal_Events(Event_Node_t & first_event,
Event_Node_t & final_event,
Event_Node_t * best_event [6], Event_Node_t * last_event [6])

// Set up first_event and final_event and make all
// entries in best_event and last_event point to
// first_event .

{
int i;

first_event . e_type = INITIAL;
first_event . pos = 0;
first_event . score = 0.0;
first_event . best_pred = NULL;
first_event . frame_pred = NULL;

for (i = 0; i < 6; i ++)
last_event [i] = best_event [i] = & first_event;

final_event . e_type = TERMINAL;
final_event . frame_pred = NULL;

return;
}
+++++++++++++++++++

A few operations done on the Last_Event

+++++++++++++++++++++

Clear_Events()

Definition :

static void Clear_Events(void)

// Free memory in chains pointed to by Last_Event . Note that
// the initial event is not dynamically allocated (it's the global
// variable First_Event ) so it is not cleared.

1>{
2 Event_Node_t * p, * q;
3 int i;
4 printf("inside clear events \n");
5 for (i = 0; i < 6; i ++)
6 for (p = Last_Event [i]; p != NULL && p -e_type !=
INITIAL; p = q) {
7 q = p -frame_pred;
8 delete p;
9 }
10>
11 return;
}
The program core dump during Last_Event[0] is deleted after a no. of
iterations in the loop at line 6 mentioned above . I Am not sure if
this issue is very much
related to the article posted here :

http://www.core-dump.com.hr/?q=node/129

The program is compiled with Sunpro CC compiler with stlport4 libraries

CC -o ../bin/jimmer3 ../obj/jimmer3.o -library=stlport4 -lm -L ../lib
-lGLMicm -lGLMcommon

The earlier problem was that when compiling the program with native
libCstd , it had a huge performence lag. so i opted to compile it with
stlport4

Kindly help me out on this.

Thanx in advance

Simon

Sep 19 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
simon wrote:

I am having problem with an application which core dumps while deleting
a vector
I've reviewed your code, and see no vector.
here is the snippet :
[snipped]
The earlier problem was that when compiling the program with native
libCstd , it had a huge performence lag. so i opted to compile it with
stlport4
What are you using from the Standard Library?

Best regards,

Tom

Sep 19 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.