Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
handling interrupted system calls [not a bug]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5270

PostPosted: Fri Mar 15, 2019 6:52 am    Post subject: handling interrupted system calls [not a bug] Reply with quote

Greetings,

I have a funky gentoo system over musl, at one stage, one of my bins gets into a weird situation where it opens a file for read and when ever it tries to read, it gets interrupted system calls error.
this step should take a few seconds to complete but due to that issue, it takes 10 minutes to complete.
is there a way kernel wise to prevent system call from being interrupted?
if not, how can I debug such issue?
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein


Last edited by DaggyStyle on Sun Mar 17, 2019 5:56 pm; edited 1 time in total
Back to top
View user's profile Send private message
mike155
l33t
l33t


Joined: 17 Sep 2010
Posts: 995
Location: Frankfurt, Germany

PostPosted: Fri Mar 15, 2019 8:39 pm    Post subject: Reply with quote

Quote:
it gets interrupted system calls error.

What happens? Does read() return with EAGAIN because the file was opened in nonblocking mode?
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5270

PostPosted: Sat Mar 16, 2019 3:57 pm    Post subject: Reply with quote

the file is opened with the r/w flag so I guess that it is indeed not blocking.
one thing I realize now, it is a standard file, why I use fd? I should use FILE instead.
I assume that the libc handles such scenarios when using the FILE api.
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
mike155
l33t
l33t


Joined: 17 Sep 2010
Posts: 995
Location: Frankfurt, Germany

PostPosted: Sat Mar 16, 2019 4:52 pm    Post subject: Reply with quote

Do you know strace? You could run your program with strace:
Code:
strace -f -r -T -o /tmp/strace.log <your program>

/tmp/strace.log will show you the history of system calls. The second column is the time when a system call was issued and the last column is the time it took.

We could help you to analyze your strace file, if you post it using wgetpaste. But please make sure that the strace file doesn't contain secret data... Examples: the strace file may contain the name of your user or the name of your home directory. If your program reads files with secret data, the strace log may contain parts of this data...
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5270

PostPosted: Sat Mar 16, 2019 5:01 pm    Post subject: Reply with quote

mike155 wrote:
Do you know strace? You could run your program with strace:
Code:
strace -f -r -T -o /tmp/strace.log <your program>

/tmp/strace.log will show you the history of system calls. The second column is the time when a system call was issued and the last column is the time it took.

We could help you to analyze your strace file, if you post it using wgetpaste. But please make sure that the strace file doesn't contain secret data... Examples: the strace file may contain the name of your user or the name of your home directory. If your program reads files with secret data, the strace log may contain parts of this data...

strace is a bit problematic to execute on that system, as said is it a funky and may I add none standard gentoo install.
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5270

PostPosted: Sun Mar 17, 2019 5:56 pm    Post subject: Reply with quote

so not a bug, apparently I forgot to to reset errno before accessing the file. no issue.
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum