Bug 246339 - fix SIGSEGV of linux java packaged with ADVA NMS
Summary: fix SIGSEGV of linux java packaged with ADVA NMS
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 12.1-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: Mark Johnston
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2020-05-09 19:21 UTC by John Hay
Modified: 2020-06-07 17:42 UTC (History)
3 users (show)

See Also:
markj: mfc-stable12+
markj: mfc-stable11-
markj: mfc-stable10-


Attachments
patch to add LINUX_SYS_linux_getcpu to linux_vsyscall (373 bytes, patch)
2020-05-09 19:21 UTC, John Hay
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Hay 2020-05-09 19:21:05 UTC
Created attachment 214321 [details]
patch to add LINUX_SYS_linux_getcpu to linux_vsyscall

The linux java packaged with the ADVA NMS SIGSEGV:

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0xffffffffff600800, pid=12763, tid=101256
#
# JRE version:  (11.0.4+11) (build )
# Java VM: OpenJDK 64-Bit Server VM (11.0.4+11, mixed mode, aot, sharing, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C  0xffffffffff600800

That is when it is trying to execute the vsyscall linux_getcpu.

Just by adding it, even though it is not implemented, allow their java to continue and the NMS is working.

The patch is simple:

--- sys/amd64/linux/linux_sysvec.c.orig	2019-11-01 02:01:48.000000000 +0200
+++ sys/amd64/linux/linux_sysvec.c	2020-05-09 20:43:42.010510000 +0200
@@ -667,7 +667,7 @@
 const unsigned long linux_vsyscall_vector[] = {
 	LINUX_SYS_gettimeofday,
 	LINUX_SYS_linux_time,
-				/* getcpu not implemented */
+	LINUX_SYS_linux_getcpu,	/* getcpu not implemented */
 };
 
 static int
Comment 1 commit-hook freebsd_committer 2020-05-31 18:20:44 UTC
A commit references this bug:

Author: markj
Date: Sun May 31 18:20:20 UTC 2020
New revision: 361664
URL: https://svnweb.freebsd.org/changeset/base/361664

Log:
  Handle getcpu() calls in vsyscall emulation on amd64.

  linux_getcpu() has been implemented since r356241.

  PR:		246339
  Submitted by:	John Hay <john@sanren.ac.za>
  MFC after:	1 week

Changes:
  head/sys/amd64/linux/linux_sysvec.c
Comment 2 commit-hook freebsd_committer 2020-06-07 17:41:12 UTC
A commit references this bug:

Author: markj
Date: Sun Jun  7 17:40:30 UTC 2020
New revision: 361897
URL: https://svnweb.freebsd.org/changeset/base/361897

Log:
  MFC r361664:
  Handle getcpu() calls in vsyscall emulation on amd64.

  PR:	246339

Changes:
_U  stable/12/
  stable/12/sys/amd64/linux/linux_sysvec.c
Comment 3 Mark Johnston freebsd_committer 2020-06-07 17:42:20 UTC
Thanks for the patch, John.