Project

General

Profile

Bug #7073

Launching non-interactive program creates JNI core dump in process_linux.c due to ncurses

Added by Roger Borrello over 1 year ago. Updated over 1 year ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:

0%

billable:
No
vendor_id:
GCD
case_num:

process_launch_helper.p Magnifier (1.28 KB) Roger Borrello, 01/24/2023 06:51 PM

hs_err_pid453116.log Magnifier (156 KB) Roger Borrello, 01/24/2023 06:54 PM

6663_windows_open_edge_testcase.png (208 KB) Roger Borrello, 01/24/2023 06:56 PM

hs_err_pid471694.log Magnifier (155 KB) Roger Borrello, 01/24/2023 11:25 PM

History

#1 Updated by Roger Borrello over 1 year ago

uast/util/process_launch_helper.p can be used.

Using Swing, run the program, and pass in any command, like ls

Output:

adecomm.pl                   client-terminal.sh              frame_title_color_default_values.txt    man_on_moon.png                   test-gui.txt
a.txt                       client-terminal.xml              go_suite.txt                menu_title_color_attributes.txt           test-keep.txt
bms-medium.ini                   client.xml                  images                mn                       test.txt
browse_title_color_default_values.txt  default_server.cer              img-dis1.png                mobGetVersionTest.out               trusted-cert.store
can_qset_test1.ini               default_server.store              img-dis.png                person.d                   widget-hierarchy.txt
client_rfb_453027.log               default_server.store.old              img-down.png                popup_menu_title_color_attributes-gui.txt  x-1.txt
client_rfb_453116.log               default_server.store.old2          img.png                popup_menu_title_color_attributes.txt       x.txt
client.sh                   frame_loc_attributes_get2-1.txt          img-up.png                rfbfile.txt
client-swing.cmd               frame_title_color_default_values-chui.txt  library_member.txt            run1.txt
client-terminal.cmd               frame_title_color_default_values-gui.txt   list-item.txt                sterling.txt
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fb7b8613717, pid=453116, tid=0x00007fb7b72f7700
#
# JRE version: OpenJDK Runtime Environment (8.0_352-b08) (build 1.8.0_352-8u352-ga-1~20.04-b08)
# Java VM: OpenJDK 64-Bit Server VM (25.352-b08 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libc.so.6+0x188717]
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/rfb/projects/VirtualBox-VMs/shared/projects/testcases/deploy/client/hs_err_pid453116.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Aborted (core dumped)

Hotspot log attached, as well.

On OpenEdge, it works fine:

#2 Updated by Roger Borrello over 1 year ago

With logging added to process_linux.c we see it occur in fprintf(fp, "pseudoTerminalWait: move cursor part 2, tigetstr(cup)=%s\n", tigetstr("cup"));

   if (!silent)
   {
      // in interactive mode we're calling functions in NCURSES directly, 
      // as opposed to executing command line utilities for the same purpose
      // (NCURSES library is a requirement anyway so we want to have a more
      // efficient and more controlled use of that interface as well, while 
      // also avoiding the hard requirement that other utility programs be
      // installed in addition to P2J)

      // put "Press space bar to continue." message on the last line

      // move cursor to the beginning of the last terminal line 
      fp=fopen("/tmp/native.txt", "a+");
      fprintf(fp, "pseudoTerminalWait: move cursor part 1\n");
      fprintf(fp, "pseudoTerminalWait: move cursor part 2, tigetstr(cup)=%s\n", tigetstr("cup"));
      fprintf(fp, "pseudoTerminalWait: move cursor part 3, tigetnum(lines)=%d\n", tigetnum("lines"));
      fclose(fp);
      char *s;
      s = tparm(tigetstr("cup"), tigetnum("lines"), 0, 0, 0, 0, 0, 0, 0, 0);
      putp(s);

      // display prompt
      fp=fopen("/tmp/native.txt", "a+");
      fprintf(fp, "pseudoTerminalWait: display prompt\n");
      fclose(fp);
      printf("Press space bar to continue.");

      // move cursor to the end of the last terminal line (as in Progress)
      fp=fopen("/tmp/native.txt", "a+");
      fprintf(fp, "pseudoTerminalWait: move to end of last line\n");
      fclose(fp);
      s = tparm(tigetstr("cup"), tigetnum("lines"), tigetnum("cols"),
                0, 0, 0, 0, 0, 0, 0);
      putp(s);

#3 Updated by Greg Shah over 1 year ago

  • Status changed from New to Rejected
  • % Done changed from 0 to 100

That failing code is not code that is checked in to trunk. It is specific to your system. Your logging is broken.

#4 Updated by Roger Borrello over 1 year ago

Greg Shah wrote:

That failing code is not code that is checked in to trunk. It is specific to your system. Your logging is broken.

It was failing before my logging entries. It broke with this logging:

      // move cursor to the beginning of the last terminal line 
      fp=fopen("/tmp/native.txt", "a+");
      fprintf(fp, "pseudoTerminalWait: move cursor part\n");
      fclose(fp);
      char *s;
      s = tparm(tigetstr("cup"), tigetnum("lines"), 0, 0, 0, 0, 0, 0, 0, 0);  // <---- this was there it broke
      putp(s);

I just tested with trunk:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fba97557717, pid=471694, tid=0x00007fba9623b700
#
# JRE version: OpenJDK Runtime Environment (8.0_352-b08) (build 1.8.0_352-8u352-ga-1~20.04-b08)
# Java VM: OpenJDK 64-Bit Server VM (25.352-b08 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libc.so.6+0x188717]
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/rfb/projects/VirtualBox-VMs/shared/projects/testcases/deploy/client/hs_err_pid471694.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Aborted (core dumped)

#5 Updated by Greg Shah over 1 year ago

  • % Done changed from 100 to 0
  • Status changed from Rejected to New

Also available in: Atom PDF