[foreign-jextract] Segmentation fault from generated code

Filip Krakowski filip.krakowski at hhu.de
Thu Dec 17 18:43:02 UTC 2020


Hi,

I work on a simple wrapper for ucx (https://github.com/openucx/ucx) and 
am experiencing a segmentation fault when calling any generated method. 
The strange thing is that the segmentation fault disappears as soon as I 
attach a (remote) debugger and manually step through the code.

   * Screenshot - https://i.imgur.com/okl3epv.png

My code does only access a struct's layout. I don't create any 
additional threads.

    log.info("Starting");
    var layout = ucp_params_t.$LAYOUT();
    log.info("{}", layout);

The generated layout looks like this.

    static final MemoryLayout ucp_params$struct$LAYOUT_ =
    MemoryLayout.ofStruct(
             C_LONG.withName("field_mask"),
             C_LONG.withName("features"),
             C_LONG.withName("request_size"),
             C_POINTER.withName("request_init"),
             C_POINTER.withName("request_cleanup"),
             C_LONG.withName("tag_sender_mask"),
             C_INT.withName("mt_workers_shared"),
             MemoryLayout.ofPaddingBits(32),
             C_LONG.withName("estimated_num_eps"),
             C_LONG.withName("estimated_num_ppn")
    ).withName("ucp_params");


Is this a known Issue? I use the latest build from last night.

Best regards
Filip


More information about the panama-dev mailing list