Solved

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

Posted on 2011-09-23
4
1,986 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 34

Accepted Solution

by:
Duncan Roe earned 500 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 34

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
A short article about a problem I had getting the GPS LocationListener working.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
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…

734 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