Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

linux strace shows read(13, <unfinished ...> as last strace when program throws segmentation fault.

Posted on 2011-09-23
4
Medium Priority
?
2,296 Views
Last Modified: 2013-11-13
In Linux, I did  strace for my program (multi-thread processing) when I stop the process. the last strace statement is below. what does it mean "read(13, <unfinished ...>?
Does it mean the program try to read something from file descriptor 13, and not finish and then get segmentation fault?
or the program read something invalid?

write(5, "{NULL, 7, 1, SM_ProcMgmt.C, 74, "..., 87) = 87
write(12, "\0\0\0\0", 4)                = 4
read(13,  <unfinished ...>

I did a gdb for the core file, and see segmentation fault as below. I check the line 1513, is return(NULL) from a function which return void* ( void*SM_ProcMgmt::signalThread(void* arg)).
So return (null) should be valid. Any idea would be appreciated on how to further debug and what could be wrong?

# 0  0x00000000 in ?? ()
#1  0xf7df05df in SM_ProcMgmt::signalThread (arg=0xffc21f30) at SM_ProcMgmt.C:1513
#2  0x00c1f832 in start_thread () from /lib/libpthread.so.0
#3  0x00b89f6e in clone () from /lib/libc.so.6



+++ killed by SIGSEGV (core dumped) +++
0
Comment
Question by:ndoung
  • 2
4 Comments
 
LVL 35

Accepted Solution

by:
Duncan Roe earned 2000 total points
ID: 36594174
Yes there is an unfinished read() on file unit 13. However it is not even likely that this is the cause of the SIGSEGV (unless, for instance, the buffer address is out of range).
You need to look back up your strace output until you find what is open on file unit 13. If, say, it's a pipe (as distinct from a regular file) then incomplete read is perfectly normal until something writes to the other end of the pipe.
From the stack trace it more looks like clone() has been given a bad argument. But the clone() call is not in the strace output - did you use strace -f? You need to do that with multithreaded programs to see threads other than the first.
If you gdb the program, you can examine variables at the time of the SIGSEGV
0
 

Author Comment

by:ndoung
ID: 37230297
I've requested that this question be deleted for the following reason:

I no longer need to resolve the problem. So I do not need to pursuit.
0
 
LVL 35

Expert Comment

by:Duncan Roe
ID: 37230298
Just because ndoung no longer wishes to pursue this problem is no reason to delete valid answers andrefund his points. I think my initial answer was valid as far as it went - I expected the asker to pursue it further but he has chosen not to
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Progress

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question