473,396 Members | 1,891 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,396 software developers and data experts.

in what circustances perror would cause core dump?

My program cored and the following is the call stack in dbx. I would
like to know what are the possibilities that when perror is being
called, it will core?

dbx: warning: cannot get thread count -- generic libthread_db.so error
dbx: warning: thread related commands will not be available
dbx: warning: see `help lwp', `help lwps' and `help where'
(l@22) dbx: warning: cannot get thread count -- generic
libthread_db.so error
terminated by signal SEGV (no mapping at the fault address)
0xff111278: ferror+0x0028: ldub [%i0 + 0xe], %o0
(/opt/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx) where
=>[1] ferror(0x0, 0x53683c, 0x53683c, 0xff13fdc8, 0xff1ea08c, 0x39),
at 0xff111278
[2] GL_MsgLogger::record(0xfbca30, 0x0, 0xfc8f1f98, 0x312, 0x1,
0xfc8f175d), at 0x380198
[3] GL_V5Session::Send(0xfc3a30, 0xfc8f85a0, 0x531628, 0xfbca30,
0xfc8f6008, 0xfc8f6010), at 0x34b0dc
Nov 14 '05 #1
7 1626
ma************@yahoo.com.hk (Martin) wrote:
My program cored and the following is the call stack in dbx. I would
like to know what are the possibilities that when perror is being
called, it will core?


There's no reason for perror() itself to dump core, so the only thing I
can imagine is that you made a mistake earlier on, either clobbering
over the allocation arena, or assigning a bogus value to errno; and that
this earlier error went unnoticed until it confused perror().

Richard
Nov 14 '05 #2

"Richard Bos" <rl*@hoekstra-uitgeverij.nl> wrote in message
news:41***************@news.individual.net...
ma************@yahoo.com.hk (Martin) wrote:
My program cored and the following is the call stack in dbx. I would
like to know what are the possibilities that when perror is being
called, it will core?


There's no reason for perror() itself to dump core, so the only thing I
can imagine is that you made a mistake earlier on, either clobbering
over the allocation arena, or assigning a bogus value to errno; and that
this earlier error went unnoticed until it confused perror().


Passing perror an invalid pointer would do the trick. Not bthat perror is to
blame for that, but *effectively* it's perror which causes the coredump by
dereferencing the faulty pointer. I agree, however, that the fault is not
perror().

So i'd advice to check wether the pointer which is passed to perror is
either valid or null.
Nov 14 '05 #3
"dandelion" <da*******@meadow.net> wrote:

"Richard Bos" <rl*@hoekstra-uitgeverij.nl> wrote in message
news:41***************@news.individual.net...
ma************@yahoo.com.hk (Martin) wrote:
My program cored and the following is the call stack in dbx. I would
like to know what are the possibilities that when perror is being
called, it will core?


There's no reason for perror() itself to dump core, so the only thing I
can imagine is that you made a mistake earlier on, either clobbering
over the allocation arena, or assigning a bogus value to errno; and that
this earlier error went unnoticed until it confused perror().


Passing perror an invalid pointer would do the trick. Not bthat perror is to
blame for that, but *effectively* it's perror which causes the coredump by
dereferencing the faulty pointer. I agree, however, that the fault is not
perror().


Erm... yes, of course. I was focusing on the error message, and
completely failed to look at the actual argument. Stupid.

Richard
Nov 14 '05 #4

"Richard Bos" <rl*@hoekstra-uitgeverij.nl> wrote in message
news:41***************@news.individual.net...
"dandelion" <da*******@meadow.net> wrote:

"Richard Bos" <rl*@hoekstra-uitgeverij.nl> wrote in message
news:41***************@news.individual.net...
ma************@yahoo.com.hk (Martin) wrote:

> My program cored and the following is the call stack in dbx. I would
> like to know what are the possibilities that when perror is being
> called, it will core?

There's no reason for perror() itself to dump core, so the only thing I can imagine is that you made a mistake earlier on, either clobbering
over the allocation arena, or assigning a bogus value to errno; and that this earlier error went unnoticed until it confused perror().


Passing perror an invalid pointer would do the trick. Not bthat perror is to blame for that, but *effectively* it's perror which causes the coredump by dereferencing the faulty pointer. I agree, however, that the fault is not perror().


Erm... yes, of course. I was focusing on the error message, and
completely failed to look at the actual argument. Stupid.


Considering all the times i've put my foot in my mouth, i would hardly call
it that.

Errare humanum est, after all.
Nov 14 '05 #5
On 8 Dec 2004 22:56:23 -0800, in comp.lang.c , ma************@yahoo.com.hk
(Martin) wrote:
My program cored and the following is the call stack in dbx. I would
like to know what are the possibilities that when perror is being
called, it will core?


calling perror() with a null argument would seem to be UB, so that might
core.

You might also get a core if your stack were so horribly corrupted before
the perror call, that it was working with garbage. Suspect earlier
problems.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Nov 14 '05 #6
In article <t2********************************@4ax.com>,
Mark McIntyre <ma**********@spamcop.net> wrote:
On 8 Dec 2004 22:56:23 -0800, in comp.lang.c , ma************@yahoo.com.hk
(Martin) wrote:
My program cored and the following is the call stack in dbx. I would
like to know what are the possibilities that when perror is being
called, it will core?

calling perror() with a null argument would seem to be UB, so that might
core.


No, calling perror() with a null argument is defined. From the standard
(7.19.10.4#2):

....first (if s is not a null pointer and the character pointed to by S is
not the null character), the string pointed to by s followed by a colon (
: ) ....

which suggests that s can be the null pointer.

Kevin Bagust.

Nov 14 '05 #7
In article <21**************************@posting.google.com >
Martin <ma************@yahoo.com.hk> wrote:
My program cored and the following is the call stack in dbx. I would
like to know what are the possibilities that when perror is being
called, it will core?
Calling perror() with an invalid argument could do that. What I
do not understand is why you are asking about perror() when the
text below suggests the code is calling ferror():
terminated by signal SEGV (no mapping at the fault address)
0xff111278: ferror+0x0028: ldub [%i0 + 0xe], %o0
(/opt/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx) where
=>[1] ferror(0x0, 0x53683c, 0x53683c, 0xff13fdc8, 0xff1ea08c, 0x39),
at 0xff111278
[2] GL_MsgLogger::record(0xfbca30, 0x0, 0xfc8f1f98, 0x312, 0x1,
0xfc8f175d), at 0x380198
[3] GL_V5Session::Send(0xfc3a30, 0xfc8f85a0, 0x531628, 0xfbca30,
0xfc8f6008, 0xfc8f6010), at 0x34b0dc


It is hard to be sure (because "optimization" can change things), but
given what I know about the specific machine, and this output from
the debugger, it looks like someone did:

ferror(fp)

where fp == NULL.
--
In-Real-Life: Chris Torek, Wind River Systems
Salt Lake City, UT, USA (40°39.22'N, 111°50.29'W) +1 801 277 2603
email: forget about it http://web.torek.net/torek/index.html
Reading email is like searching for food in the garbage, thanks to spammers.
Nov 14 '05 #8

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

Similar topics

3
by: Nick Craig-Wood | last post by:
I've just discovered that my python (Python 2.3.4 from debian package 2.3.4-1 running on debian testing x86 + linux 2.4.26) core dumps when I set recursionlimit very high and do lots of recursion....
1
by: Martin | last post by:
I use dbx and i got the following error: Reading GL_CliConnMgr core file header read successfully Reading ld.so.1 dbx: core file read error: address 0xff3e6000 not available dbx: core file...
6
by: John Liu | last post by:
I've two questions, they may or may not be related - 1. I copied the entire data directory from postgreSQL 7.3.2 (AIX4.3) to the installation postgreSQL 7.3.4 (AIX5.1), the same filesystem setup....
10
by: ken | last post by:
hello, i'm writing a c program on a linux system. i'm debugging a segmentation fault but i don't want it to dump a core file because the memory footprint of the program is over 300Mb and i don't...
3
by: John Liu | last post by:
AIX pg version 7.4 Select * from document2 core dump. Did a few more experiments with select * from document2 limit... I limit to 500000 it works, 600000 it exits but says "calloc:...
10
by: wong_powah | last post by:
I want to find out where (which line) my C program core dump. How to do that? Is there a web site describing the procedure? One approach is to use stack trace of the mdb debugger, but I does not...
2
by: sanjaykumarpatel | last post by:
Hi , I got the follwoing error in my alert log. Please help me what is the root cause of this error and what is the best solution to resolve this error. ORA-07445: exception encountered: core...
5
by: johnericaturnbull | last post by:
Hi - I am very new to python. I get this random core dump and am looking for a good way to catch the error. I know the function my core dump occurs. Is there any error catching/handling that I...
8
by: puzzlecracker | last post by:
Any ideas what may cause that for the string class to core dump? #0 0x0018de92 in std::string::c_str () from /usr/lib/libstdc++.so.5
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.