LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-01-2004, 12:10 AM   #1
ashwinipahuja
Member
 
Registered: Mar 2004
Posts: 79

Rep: Reputation: 15
Angry problem with using STL set and its funciton erase , insert


hi
every body
i am working on a project which has maximum use of STL. the code is of millions of line so i can 't cut and paste and their is to much class
inheritence in the code .
the problem is that code crashes out whenever it finds set STL and its funciton like erase , insert
is there something explicit we have to define which is not done on microsoft windows
i will be thankful if anybody replies back
 
Old 06-01-2004, 12:21 AM   #2
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
you're probably corrupting memory somewhere. get out a debugger, and find out where and how exactly it's crashing. or use a mem prof'ing tool like purify: http://www-acs.ucsd.edu/offerings/us.../purify,d.html
 
Old 06-01-2004, 01:13 AM   #3
ashwinipahuja
Member
 
Registered: Mar 2004
Posts: 79

Original Poster
Rep: Reputation: 15
hello sir
i know that the line from where the code crashes out. every time i am facing problem due to set. the same code is running fone in MSVC (vc++)
and there is no memory leak there. so is n't it possible that there is some problem with the Set library fucntion
plz reply me
 
Old 06-01-2004, 06:22 AM   #4
llama_meme
Member
 
Registered: Nov 2001
Location: London, England
Distribution: Gentoo, FreeBSD
Posts: 590

Rep: Reputation: 30
It's possible there could be a bug in the libraries, but probably not as serious a bug as that. Memory leaks aren't local, they can have subtle effects accross a whole program. The most likely scenario is that there's some memory-related bug in your program which for whatever reason doesn't surface when the program's compiled with MSVC in Windows, but has now come to the surface.

Also, you've started about 4 threads on this exact same question. Keep it all in one thread; you can always bump the thread up with a reply if it gets too far down the list (once every 24 hours).

Alex
 
Old 06-01-2004, 01:24 PM   #5
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
this is what debuggers are for. when it crashes, do a backtrace of the stack, im willing to bet you'll find it crashes in some memory alloc/deallo routine, look at the instruction that caused the fault, and i bet you'll find a junk pointer being dereferenced. i wrote a program on linux that uses nearly all of the set functions, and it works fine. USE PURIFY.
 
Old 06-02-2004, 12:29 AM   #6
ashwinipahuja
Member
 
Registered: Mar 2004
Posts: 79

Original Poster
Rep: Reputation: 15
Angry can i use rational rose purify for the linux based platform source code

hi
every body
i want to know how to use purify on linux based code . i have rational rose installed on my pc. should i have to move the code form linux platform to windows platform where it is installed
help me
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
constructor of set STL gets initialized before the control enters ashwinipahuja Programming 0 06-02-2004 11:46 PM
set STL errors code attached ashwinipahuja Programming 0 06-01-2004 02:36 AM
system crashes when set STL is met ashwinipahuja Programming 0 06-01-2004 02:28 AM
Vector(STL) question(push_back & erase) Ohmu Programming 1 01-29-2004 04:50 PM
C++ STL problem jaycee999 Programming 5 05-31-2002 03:01 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration