472,789 Members | 1,317 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,789 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 2468
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: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?

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.