473,287 Members | 2,263 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

new () keeps core-dump instead of generating exception

Hi, all,

I am trying to allocate some objects during application starts up. The
objects are created through new operator, but for some reason, the
application keeps crashing and here is the debug trace:
(gdb) where
#0 0xb64349dd in _int_malloc () from /lib/tls/libc.so.6
#1 0xb6433ced in malloc () from /lib/tls/libc.so.6
#2 0xb659789e in operator new () from /usr/lib/libstdc++.so.5

I am using redhat Linux 2.4.21-15.ELsm, any idea why is that?
Mar 6 '08 #1
6 3097
On Thu, 06 Mar 2008 20:00:37 +0100, we*****@yahoo.com <we*****@yahoo.com>
wrote:
Hi, all,

I am trying to allocate some objects during application starts up. The
objects are created through new operator, but for some reason, the
application keeps crashing and here is the debug trace:
(gdb) where
#0 0xb64349dd in _int_malloc () from /lib/tls/libc.so.6
#1 0xb6433ced in malloc () from /lib/tls/libc.so.6
#2 0xb659789e in operator new () from /usr/lib/libstdc++.so.5

I am using redhat Linux 2.4.21-15.ELsm, any idea why is that?

Without some code, we can't help you .
Mar 6 '08 #2
On 2008-03-06 20:00, we*****@yahoo.com wrote:
Hi, all,

I am trying to allocate some objects during application starts up. The
objects are created through new operator, but for some reason, the
application keeps crashing and here is the debug trace:
(gdb) where
#0 0xb64349dd in _int_malloc () from /lib/tls/libc.so.6
#1 0xb6433ced in malloc () from /lib/tls/libc.so.6
#2 0xb659789e in operator new () from /usr/lib/libstdc++.so.5
In addition to what David said:

Either you have a bad version of libc (not likely) or the problem is in
stack-frame not shown in the above backtracer, find the stack-frame
which is in your code and start looking there.

--
Erik Wikström
Mar 6 '08 #3
On Mar 7, 2:20*am, Erik Wikström <Erik-wikst...@telia.comwrote:
On 2008-03-06 20:00, wenm...@yahoo.com wrote:
Hi, all,
I am trying to allocate some objects during application starts up. The
objects are created through new operator, but for some reason, the
application keeps crashing and here is the debug trace:
(gdb) where
#0 *0xb64349dd in _int_malloc () from /lib/tls/libc.so.6
#1 *0xb6433ced in malloc () from /lib/tls/libc.so.6
#2 *0xb659789e in operator new () from /usr/lib/libstdc++.so.5

In addition to what David said:

Either you have a bad version of libc (not likely) or the problem is in
stack-frame not shown in the above backtracer, find the stack-frame
which is in your code and start looking there.

--
Erik Wikström
as said by others, we need some code as to what/where/how you are
using new. Anyways, new should throw an exception on failure. my guess
is that are you catching the bad allocation exception??
for genericity you may use catch(...) as uncaught exceptions tend to
dump core, atleast in the platforms i have used(aix & sun).

Thanks,
Balaji.
Mar 7 '08 #4
On Mar 6, 8:00 pm, "wenm...@yahoo.com" <wenm...@yahoo.comwrote:
I am trying to allocate some objects during application starts up. The
objects are created through new operator, but for some reason, the
application keeps crashing and here is the debug trace:
(gdb) where
#0 0xb64349dd in _int_malloc () from /lib/tls/libc.so.6
#1 0xb6433ced in malloc () from /lib/tls/libc.so.6
#2 0xb659789e in operator new () from /usr/lib/libstdc++.so.5
I am using redhat Linux 2.4.21-15.ELsm, any idea why is that?
Any idea as to why you're using redhat Linux, no.

If you meant why you're crashing, it's impossible to say, but in
general, supposing that you've linked in the right versions of
everything, it's probable that you've mucked up the free store
arena with some illegal memory writes earlier. (Or, as someone
else suggested, you've requested more memory than is available,
and aren't catching the exception---and possibly cannot catch
it, if you're still running static initializers.)

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Mar 7 '08 #5
Two things you can try:
1. As suggested by Balaji above, use catch(...)

2. Use the "nothrow" version of new:
e.g.
int *i = new (nothrow) int[10];
if(i==NULL)
{
cout << "see if it comes here" << endl;
}
Mar 7 '08 #6
On 7 mar, 15:05, Shobhit Gupta <shobhitgupt...@gmail.comwrote:
Two things you can try:
1. As suggested by Balaji above, use catch(...)
Where? He said that it was during program start-up, which I
understand to mean before main.
2. Use the "nothrow" version of new:
e.g.
int *i = new (nothrow) int[10];
if(i==NULL)
{
cout << "see if it comes here" << endl;
}
If new is crashing, then that probably won't change anything.

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Mar 7 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Martin | last post by:
I got a core from my client but i am not able to find out where it crashed. I got the following: From my experience, when i got lots of warning which complains about the path mismatch.. I can...
1
by: Bernavich2004 | last post by:
Thank you in advance for your help. I create an Add-in in .NET by using the wizard ( language is C#). Once my core project is created I F5 the add-in and it shows up just fine in my TOOL menu,...
5
by: Eddie | last post by:
I have a MySQL-server running Innodb. We have installed ~ 2GB of memory in the server. In spite of this MySQL keeps crashing due to out-of-memory errors. The server is a dual xeon i686 running...
10
by: I. Myself | last post by:
Suppose we spawn a child process with Popen. I'm thinking of an executable file, like a compiled C program. Suppose it is supposed to run for one minute, but it just keeps going and going. Does...
5
by: Michael Russell | last post by:
Hi all, Using C#, I've created a simple wrapper class for using Excel. I have Office Pro 2003 installed on my devel machine. The wrapper class works great, reading and writing to/from Excel. ...
5
by: su | last post by:
to find which process dumped core at the promt we give $ file core.28424 core.28424: ELF 32-bit LSB core file of 'soffice.bin' (signal 11), Intel 80386, version 1 (SYSV), from 'soffice.bin' ...
1
by: John Machin | last post by:
Here are some data points that illustrate the improvement in speed since 2.1 for one (probably atypical) application: rummaging through a 120MB Microsoft Excel spreadsheet file using the xlrd...
0
by: Sabri.Pllana | last post by:
We apologize if you receive multiple copies of this call for papers. *********************************************************************** 2008 International Workshop on Multi-Core Computing...
2
by: Zach | last post by:
I compiled a game client and it crashed (segmentation fault) resulting in a core file being generated. I'm trying to find out exactly what caused it to crash. Any ideas how I can do this with gdb?...
8
by: Grizlyk | last post by:
To continue some ideas of "C++ Archeology: Limits of OO paradigm", i want to ask about C++ development. There are C++ compilers, that has been written in old good C. Are C or pascal perfect...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.