Solved

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

Posted on 2011-09-23
4
1,938 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Linux Network manager connection based on location 3 70
BATCH to EXE Converter 2 69
Getting Variable not defined error in Python 1 41
Ruby or Python 7 50
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is about my first experience with programming Arduino.

756 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