LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 02-26-2006, 05:12 AM   #1
bianchi
Member
 
Registered: Nov 2005
Location: Italy
Posts: 36

Rep: Reputation: 15
problem with operator new


buon giorno

when I try to use the operator new (for any type)
I get this message :
"operator new (sz=1228) at ../../../../gcc-3.4.1/libstdc++-v3/libsupc++/new_op.cc:46
46 ../../../../gcc-3.4.1/libstdc++-v3/libsupc++/new_op.cc: No such file or directory.
in ../../../../gcc-3.4.1/libstdc++-v3/libsupc++/new_op.cc
Program recieved signal SIGSEGV, Segmentation fault.
malloc_consolidate (av=0x40b2a780) at malloc.c:4391
4391 malloc.c:No such file of directory.
in malloc.c"

What is this mean ?
What should I do ?

Grazie,
Bianchi
 
Old 02-26-2006, 07:32 AM   #2
FLLinux
Member
 
Registered: Jul 2004
Location: USA
Distribution: Fedora 9, LFS 6.3, Unbuntu 8.04, Slax 6.0.7
Posts: 145

Rep: Reputation: 15
Are you compiling a C or a C++ program?
 
Old 02-26-2006, 08:05 AM   #3
bianchi
Member
 
Registered: Nov 2005
Location: Italy
Posts: 36

Original Poster
Rep: Reputation: 15
c++ app

c++ app
 
Old 02-26-2006, 10:23 AM   #4
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
how are you compiling, with gcc or g++
 
Old 02-26-2006, 11:27 PM   #5
bianchi
Member
 
Registered: Nov 2005
Location: Italy
Posts: 36

Original Poster
Rep: Reputation: 15
g++

I use g++ . is there any cflag for this problem ?
 
Old 02-26-2006, 11:35 PM   #6
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
I'm surprised the top of the stack traceback starts somewhere in gcc instead of some line in your program's code ... but often times the same memory corruption that caused the SIGSEGV will also corrupt your stack.

I'd take the stack traceback with a grain of salt - you're probably NOT seeing the actual point of failure.

Strong suggestion:
1. Compile your app with "-g"
2. Execute it inside of gdb
3. If you know where the "new" is occurring - great. Set a breakpoint just
before you create the object.
4. Otherwise, see if you can use gdb to home in on which class/object
is failing.
5. *Definitely* double-check the constructors (*all* the constructors) of
any class object you suspect.

'Hope that helps .. PSM
 
Old 02-27-2006, 01:06 AM   #7
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 51
can you show us your code?
 
  


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
problem compiling with overloading method 'operator<<' freeindy Programming 4 04-29-2005 08:58 AM
Simple Operator Precedence C++ Problem rovitotv Programming 9 03-21-2005 10:02 PM
Operator Overloading problem ashwinipahuja Programming 1 06-23-2004 05:59 AM
logical operator problem. Xiangbuilder Programming 5 09-07-2003 10:02 PM
Script file problem (or operator problem) HELP! lostone Linux - General 1 05-17-2001 06:11 PM

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

All times are GMT -5. The time now is 09:55 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