Hi, I have ran into this issue again, this time on resolute.

The problematic code:

- The loop in void src/hotspot/share/opto/callnode.cpp:
CallJavaNode::copy_call_debug_info(PhaseIterGVN* phase,

for (JVMState *jvms = this->jvms(); jvms != nullptr; jvms = jvms->caller()) {
    jvms->set_map(this);
    jvms->set_locoff(jvms->locoff()+jvms_adj);
    jvms->set_stkoff(jvms->stkoff()+jvms_adj);
    jvms->set_monoff(jvms->monoff()+jvms_adj);
    jvms->set_scloff(jvms->scloff()+jvms_adj);
    jvms->set_endoff(jvms->endoff()+jvms_adj);
  }
 
and the similiar loop in
src/hotspot/share/opto/callnode.cpp:void JVMState::adapt_position(int delta)


  for (JVMState* jvms = this; jvms != nullptr; jvms = jvms->caller()) {
    jvms->set_locoff(jvms->locoff() + delta);
    jvms->set_stkoff(jvms->stkoff() + delta);
    jvms->set_monoff(jvms->monoff() + delta);
    jvms->set_scloff(jvms->scloff() + delta);
    jvms->set_endoff(jvms->endoff() + delta);
  }

The generated code contains vector instructions

```
00000000003bb5d0 <JVMState::adapt_position(int)>:
  3bb5d0:       e7 03 00 03 20 22       vlvgf   %v0,%r3,3
  3bb5d6:       e7 00 00 03 20 4d       vrepf   %v0,%v0,3
  3bb5dc:       b3 c1 00 4b             ldgr    %f4,%r11
  3bb5e0:       b9 04 00 bf             lgr     %r11,%r15
  3bb5e4:       e7 20 20 0c 00 06       vl      %v2,12(%r2)
  3bb5ea:       18 13                   lr      %r1,%r3
  3bb5ec:       5a 10 20 1c             a       %r1,28(%r2)
  3bb5f0:       e7 62 00 00 20 f3       vaf     %v6,%v2,%v0
  3bb5f6:       e7 60 20 0c 00 0e       vst     %v6,12(%r2)
  3bb5fc:       50 10 20 1c             st      %r1,28(%r2)
  3bb600:       e3 20 20 00 00 02       ltg     %r2,0(%r2)
  3bb606:       a7 74 ff ef             jne     3bb5e4 
<JVMState::adapt_position(int)+0x14>
  3bb60a:       b3 cd 00 b4             lgdr    %r11,%f4
  3bb60e:       07 fe                   br      %r14
```

and instead of uniform adjustment we get one of the values only
partially changed:

work: locoff 10 stkoff 21 monoff 21 scloff 21 endoff 21 adj -4 
result: locoff 6 stkoff 17 monoff 19 scloff 17 endoff 17

monoff: 21 - 4 = 19

I wonder if the root cause is vector register store/load somewhere in
kernel during the context switch because it is very prevalent on
jammy/noble with 'gs' flag enabled and I have seen only one instance in
pipeline in resolute.

I have worked it around by adding -fno-slp-tree-vectorize in openjdk
configure args, but it would be nice to understand/fix the root cause.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2095441

Title:
  S390x build of openjdk crashes with the segmentation fault

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-z-systems/+bug/2095441/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to