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

core dump on writing to pipe

Could you tell me scenarios in which core's dumped when writing to a
pipe.

write (pipefd,&Struct,structsize);

on windows too this give a memory "read" violation. Could anyone tell
me why.
thanks in advance.

mojo

Nov 14 '05 #1
8 2486
In article <11**********************@g14g2000cwa.googlegroups .com>,
mojozoox <ma*******@HotPop.com> wrote:
Could you tell me scenarios in which core's dumped when writing to a
pipe.
Pipes are not part of standard C. Can you repeat the
problem with writing to a file opened for binary output?

write (pipefd,&Struct,structsize); on windows too this give a memory "read" violation. Could anyone tell
me why.


structsize perhaps does not match sizeof(Struct) ?

The contents of Struct has perhaps not been initialized and
windows is perhaps detecting this?

pipefd might not be valid?

Struct might not even be the right type -- e.g., it might
really be a pointer to a structure and so you might be
taking the address of a pointer instead of passing
the address of a structure.
--
"[...] it's all part of one's right to be publicly stupid." -- Dave Smey
Nov 14 '05 #2
"mojozoox" <ma*******@HotPop.com> wrote:
# Could you tell me scenarios in which core's dumped when writing to a
# pipe.
#
# write (pipefd,&Struct,structsize);
#
# on windows too this give a memory "read" violation. Could anyone tell

How about adding fprintf(stderr,"%d %p %d\n',pipefd,&Struct,structsize)
and see if the output looks rational.

--
SM Ryan http://www.rawbw.com/~wyrmwif/
What kind of convenience store do you run here?
Nov 14 '05 #3
SM Ryan wrote:
"mojozoox" <ma*******@HotPop.com> wrote:
Could you tell me scenarios in which core's dumped when writing
to a pipe.

write (pipefd,&Struct,structsize);

on windows too this give a memory "read" violation. Could anyone


How about adding fprintf(stderr,"%d %p %d\n',pipefd,&Struct,structsize)
and see if the output looks rational.


Apart from the fact that there is no write(...) function in
standard C, and that Windoze is not Posix (neither of which is
on-topic here), your suggested diagnostic is one of the few places
that really need a cast. In this case (void*)&Struct.

Please correct your unconventional quote char. I edited this to
fix it.

--
Chuck F (cb********@yahoo.com) (cb********@worldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!
Nov 14 '05 #4
CBFalconer <cb********@yahoo.com> writes:
SM Ryan wrote:
"mojozoox" <ma*******@HotPop.com> wrote:
Could you tell me scenarios in which core's dumped when writing
to a pipe.

write (pipefd,&Struct,structsize);

on windows too this give a memory "read" violation. Could anyone


How about adding fprintf(stderr,"%d %p %d\n',pipefd,&Struct,structsize)
and see if the output looks rational.


Apart from the fact that there is no write(...) function in
standard C, and that Windoze is not Posix (neither of which is
on-topic here), your suggested diagnostic is one of the few places
that really need a cast. In this case (void*)&Struct.


You might need casts for the other arguments as well. I'm guessing
pipefd is probably an int (if so, it doesn't need a cast), but
structsize is likely to be (and probably should be) a size_t.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 14 '05 #5
is there way to read a core file kindly let me know!

Nov 14 '05 #6
In article <11**********************@l41g2000cwc.googlegroups .com>,
mojozoox <ma*******@HotPop.com> wrote:
is there way to read a core file kindly let me know!


A core file is like any other binary file -- just fopen() it
and fread() it.

Making sense of what you find there is a platform- and version-
specific problem.
--
Beware of bugs in the above code; I have only proved it correct,
not tried it. -- Donald Knuth
Nov 14 '05 #7
mojozoox wrote:
is there way to read a core file kindly let me know!


Write a C program that opens it in binary more then reads it.

Alternatively, ask in a group dedicated to your system since we don't
deal with implementation specific tools here.
--
Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.
Nov 14 '05 #8
"mojozoox" <ma*******@HotPop.com> wrote:
# is there way to read a core file kindly let me know!

The debugger on your system. Perhaps gdb or sdb or dbg or dbx or mky mus.
--
SM Ryan http://www.rawbw.com/~wyrmwif/
So basically, you just trace.
Nov 14 '05 #9

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....
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:...
6
by: wenmang | last post by:
Here is the code which causes core dump when is built differently, 1 for regular dev built, the other for packaging build. class my_class{ public: my_class(){}; ~my_class(){}; private:...
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...
0
by: eso40043 | last post by:
Hello, due to a memory leak (bug, I guess) in pyraf(or rather in IRAF) I have to fork an iterative process that goes through hundreds of image frames and does unspeakable things to them. In the...
4
by: Aidan | last post by:
Hi, I'm having a bit of trouble with a python script I wrote, though I'm not sure if it's related directly to python, or one of the other software packages... The situation is that I'm trying...
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...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.