Crash when reading 1000 image files from fibers

Cay Horstmann cay.horstmann at gmail.com
Sun Sep 1 06:50:03 UTC 2019


I just checked out Loom from Github on a Linux machine and changed the 
example from http://horstmann.com/unblog/2019-07-27/ to use fibers. Good 
news: The code is much clearer than with completable futures. I schedule 
1000 fibers that do this work:

    public void load(LocalDate date, ImageInfo info) {
       try {
          URL url = new URL(info.getUrlForDate(date));
          var in = url.openStream();
          info.findImage(new String(in.readAllBytes()));
          in.close();
          url = new URL(info.getImagePath());
          in = url.openStream();
          info.setImageData(in.readAllBytes());
          in.close();
          process(info); // Saves the bytes to a file
       } catch (Exception ex) {
          ex.printStackTrace();
       }
    }

Unfortunately, after about 800 images, the program dies with the message 
below.

Does this look like I am touching anything that's not yet supported? If 
not, do you really want crash reports sent to 
http://bugreport.java.com/bugreport/crash.jsp, or is there some other 
process?

Cheers,

Cay


#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f7e777a7087, pid=31798, tid=31824
#
# JRE version: OpenJDK Runtime Environment (14.0) (build 
14-internal+0-adhoc.cay.loom)
# Java VM: OpenJDK 64-Bit Server VM (14-internal+0-adhoc.cay.loom, mixed 
mode, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0xfd9087]  StackValue::create_stack_value(ScopeValue*, 
unsigned char*, bool)+0x317
#
# Core dump will be written. Default location: Core dumps may be 
processed with "/usr/share/apport/apport %p %s %c %d %P" (or dumping to 
/data/temp/loom/core.31798)
#
# An error report file with more information is saved as:
# /data/temp/loom/hs_err_pid31798.log
Compiled method (c2)   23452 3001  s    4 
sun.net.www.http.ChunkedInputStream::read (135 bytes)
  total in heap  [0x00007f7e68c2a010,0x00007f7e68c2ac80] = 3184
  relocation     [0x00007f7e68c2a188,0x00007f7e68c2a1c8] = 64
  main code      [0x00007f7e68c2a1e0,0x00007f7e68c2aa00] = 2080
  stub code      [0x00007f7e68c2aa00,0x00007f7e68c2aa38] = 56
  metadata       [0x00007f7e68c2aa38,0x00007f7e68c2aa50] = 24
  scopes data    [0x00007f7e68c2aa50,0x00007f7e68c2ab50] = 256
  scopes pcs     [0x00007f7e68c2ab50,0x00007f7e68c2ac30] = 224
  dependencies   [0x00007f7e68c2ac30,0x00007f7e68c2ac38] = 8
  handler table  [0x00007f7e68c2ac38,0x00007f7e68c2ac68] = 48
  nul chk table  [0x00007f7e68c2ac68,0x00007f7e68c2ac80] = 24
Compiled method (c2)   23452 3001  s    4 
sun.net.www.http.ChunkedInputStream::read (135 bytes)
  total in heap  [0x00007f7e68c2a010,0x00007f7e68c2ac80] = 3184
  relocation     [0x00007f7e68c2a188,0x00007f7e68c2a1c8] = 64
  main code      [0x00007f7e68c2a1e0,0x00007f7e68c2aa00] = 2080
  stub code      [0x00007f7e68c2aa00,0x00007f7e68c2aa38] = 56
  metadata       [0x00007f7e68c2aa38,0x00007f7e68c2aa50] = 24
  scopes data    [0x00007f7e68c2aa50,0x00007f7e68c2ab50] = 256
  scopes pcs     [0x00007f7e68c2ab50,0x00007f7e68c2ac30] = 224
  dependencies   [0x00007f7e68c2ac30,0x00007f7e68c2ac38] = 8
  handler table  [0x00007f7e68c2ac38,0x00007f7e68c2ac68] = 48
  nul chk table  [0x00007f7e68c2ac68,0x00007f7e68c2ac80] = 24
Compiled method (c2)   23455 3001  s    4 
sun.net.www.http.ChunkedInputStream::read (135 bytes)
  total in heap  [0x00007f7e68c2a010,0x00007f7e68c2ac80] = 3184
  relocation     [0x00007f7e68c2a188,0x00007f7e68c2a1c8] = 64
  main code      [0x00007f7e68c2a1e0,0x00007f7e68c2aa00] = 2080
  stub code      [0x00007f7e68c2aa00,0x00007f7e68c2aa38] = 56
  metadata       [0x00007f7e68c2aa38,0x00007f7e68c2aa50] = 24
  scopes data    [0x00007f7e68c2aa50,0x00007f7e68c2ab50] = 256
  scopes pcs     [0x00007f7e68c2ab50,0x00007f7e68c2ac30] = 224
  dependencies   [0x00007f7e68c2ac30,0x00007f7e68c2ac38] = 8
  handler table  [0x00007f7e68c2ac38,0x00007f7e68c2ac68] = 48
  nul chk table  [0x00007f7e68c2ac68,0x00007f7e68c2ac80] = 24
Compiled method (c2)   23455 3001  s    4 
sun.net.www.http.ChunkedInputStream::read (135 bytes)
  total in heap  [0x00007f7e68c2a010,0x00007f7e68c2ac80] = 3184
  relocation     [0x00007f7e68c2a188,0x00007f7e68c2a1c8] = 64
  main code      [0x00007f7e68c2a1e0,0x00007f7e68c2aa00] = 2080
  stub code      [0x00007f7e68c2aa00,0x00007f7e68c2aa38] = 56
  metadata       [0x00007f7e68c2aa38,0x00007f7e68c2aa50] = 24
  scopes data    [0x00007f7e68c2aa50,0x00007f7e68c2ab50] = 256
  scopes pcs     [0x00007f7e68c2ab50,0x00007f7e68c2ac30] = 224
  dependencies   [0x00007f7e68c2ac30,0x00007f7e68c2ac38] = 8
  handler table  [0x00007f7e68c2ac38,0x00007f7e68c2ac68] = 48
  nul chk table  [0x00007f7e68c2ac68,0x00007f7e68c2ac80] = 24
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#
Abandon (core dumped)

-- 

Cay S. Horstmann | http://horstmann.com | mailto:cay at horstmann.com


More information about the loom-dev mailing list