changeset 8973:cf1bcb59ea52

8164383: jhsdb dumps core on Solaris 12 when loading dumped core Summary: Add the required extra parameters to Plookup_by_addr() and proc_arg_grab() as per the change to libproc with Solaris 12. Reviewed-by: sspitsyn
author fmatte
date Tue, 02 Oct 2018 09:45:39 -0400
parents a606f067c786
children 50ed692d0a48
files agent/src/os/solaris/proc/salibproc.h agent/src/os/solaris/proc/saproc.cpp
diffstat 2 files changed, 21 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/agent/src/os/solaris/proc/salibproc.h	Mon Oct 01 06:12:34 2018 -0700
+++ b/agent/src/os/solaris/proc/salibproc.h	Tue Oct 02 09:45:39 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -46,6 +46,17 @@
 extern "C" {
 #endif
 
+/* extended symbol table information */
+typedef struct {
+        const char      *prs_object;            /* object name */
+        const char      *prs_name;              /* symbol name */
+        Lmid_t          prs_lmid;               /* link map id */
+        uint_t          prs_id;                 /* symbol id */
+        uint_t          prs_table;              /* symbol table id */
+} prsyminfo_t;
+
+typedef struct ps_prochandle ps_prochandle_t;
+
 /*
  * 'object_name' is the name of a load object obtained from an
  * iteration over the process's address space mappings (Pmapping_iter),
@@ -53,8 +64,10 @@
  * or else it is one of the special PR_OBJ_* values above.
  */
 
-extern int Plookup_by_addr(struct ps_prochandle *,
-    uintptr_t, char *, size_t, GElf_Sym *);
+extern int Plookup_by_addr(ps_prochandle_t *, uintptr_t, char *,
+                           size_t, GElf_Sym *, prsyminfo_t *);
+extern ps_prochandle_t *proc_arg_grab(const char *, int, int,
+                                      int *, const char **);
 
 typedef int proc_map_f(void *, const prmap_t *, const char *);
 extern int Pobject_iter(struct ps_prochandle *, proc_map_f *, void *);
@@ -88,7 +101,6 @@
 #define G_ELF           13      /* Libelf error, elf_errno() is meaningful */
 #define G_NOTE          14      /* Required PT_NOTE Phdr not present in core */
 
-extern struct ps_prochandle *proc_arg_grab(const char *, int, int, int *);
 extern  const pstatus_t *Pstatus(struct ps_prochandle *);
 
 /* Flags accepted by Prelease (partial) */
--- a/agent/src/os/solaris/proc/saproc.cpp	Mon Oct 01 06:12:34 2018 -0700
+++ b/agent/src/os/solaris/proc/saproc.cpp	Tue Oct 02 09:45:39 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -755,7 +755,8 @@
 #endif
 
   // connect to process/core
-  struct ps_prochandle* ph = proc_arg_grab(cmdLine_cstr, (isProcess? PR_ARG_PIDS : PR_ARG_CORES), PGRAB_FORCE, &gcode);
+  ps_prochandle_t* ph = proc_arg_grab(cmdLine_cstr, (isProcess? PR_ARG_PIDS : PR_ARG_CORES), PGRAB_FORCE, &gcode, NULL);
+
   env->ReleaseStringUTFChars(cmdLine, cmdLine_cstr);
   if (! ph) {
      if (gcode > 0 && gcode < sizeof(proc_arg_grab_errmsgs)/sizeof(const char*)) {
@@ -1233,7 +1234,8 @@
    char nameBuf[SYMBOL_BUF_SIZE + 1];
    GElf_Sym sym;
    int res = Plookup_by_addr((struct ps_prochandle*) p_ps_prochandle, (uintptr_t) address,
-                                 nameBuf, sizeof(nameBuf), &sym);
+                             nameBuf, sizeof(nameBuf), &sym, NULL);
+
    if (res != 0) { // failed
       return 0;
    }