Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005627 [Resin] major always 01-03-14 13:16 09-12-14 10:50
Reporter bean View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version 4.0.38
Summary 0005627: data corruption due to improper handing of EINTR
Description several JNI methods do not handle an errno of EINTR. The result is corrupted data.

EINTR is the status return of a syscall that was interrupted in order to deliver a signal to the thread. In general, the user process should just restart the syscall. The problem is most likely to occur when resin is sitting on a recv() waiting to get data and the recv syscall gets interrupted by a signal.

The bad methods are:
common/streams.c: std_read(), std_write(), cse_fill_buffer()
resin_os/std.c: std_read(), std_read_nonblock(), std_write(), std_write_nonblock()
Additional Information (1) The Azul JVM, Zing, can sometimes have a high signal rate, which has then hit this problem.

(2) I've uploaded a fixed version of std.c, with the code ifdef'd by #ifdef FIX_EINTR, to illustrate the correct behavior.

Attached Files  std.c [^] (11,818 bytes) 01-03-14 13:16
 std.c.2 [^] (11,855 bytes) 01-15-14 08:30

- Relationships

- Notes
(0006389)
bean
01-15-14 08:32

I found a typo in std.c after uploading it. The next file, std.c.2, has the typo fixed as well as identifying on other place where EINTR was not correctly handled.
 

- Issue History
Date Modified Username Field Change
01-03-14 13:16 bean New Issue
01-03-14 13:16 bean File Added: std.c
01-15-14 08:25 bean Issue Monitored: bean
01-15-14 08:30 bean File Added: std.c.2
01-15-14 08:32 bean Note Added: 0006389
09-12-14 10:50 ferg Assigned To  => ferg
09-12-14 10:50 ferg Status new => closed
09-12-14 10:50 ferg Resolution open => fixed
09-12-14 10:50 ferg Fixed in Version  => 4.0.41
09-12-14 10:50 ferg Additional Information Updated


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
33 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker