Project

General

Profile

Bug #98

Java and Node GDP Interfaces crash in gdp_gcl_unlock_trace()

Added by Anonymous about 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
libgdp
Start date:
04/18/2017
Due date:
% Done:

0%


Description

Under RHEL and Ubuntu, I'm getting the following crash when running $PTII/bin/vergil ptolemy/actor/lib/jjs/modules/gdp/test/auto/GDPLogCreateAppendReadJS.xml

To replicate:

ssh -CX terra.eecs.berkeley.edu
cd /home/jenkins/workspace/ptII
export PTII=`pwd`
$PTII/bin/vergil ptolemy/actor/lib/jjs/modules/gdp/test/auto/GDPLogCreateAppendReadJS.xml

Below is the error message:

swarm.gdp.routers=gdp-03.eecs.berkeley.edu; gdp-02.eecs.berkeley.edu
GDP_GCL.java: newGCL(org.terraswarm.gdp.GDP_NAME@f950360, 3, org.terraswarm.gdp.GDP_NAME@45dd93cd)
GDP_GCL.java: GDP_GCL(org.terraswarm.gdp.GDP_NAME@f950360(89hI-eziGXyy1YW1yGt-CDtC9mwb0YFHqc0s--4QJr4^@), RA, org.terraswarm.gdp.GDP_NAME@45dd93cd(m5FiAV65ufV8Oe3SinfrOZPcbzXtlNOG-lmD-KSsE1U^@)

>>> gdp_gcl_open(89hI-eziGXyy1YW1yGt-CDtC9mwb0YFHqc0s--4QJr4)
_gdp_lib_init(NULL)
        @(#)libgdp 0.7.2 (2017-04-18 14:47) 73785f9556d4813480dde6f062bbf2fc4ab0a7a5
My GDP routing name = KDlOotQiCjQHzPSgSj1yQSfN-fa4ccGM2bMssrLJtoU
gdp_lib_init: OK
_gdp_chan_open(gdp-03.eecs.berkeley.edu; gdp-02.eecs.berkeley.edu)
Trying gdp-03.eecs.berkeley.edu
_gdp_chan_open: trying host gdp-03.eecs.berkeley.edu port 8007
_gdp_chan_open: talking to router at gdp-03.eecs.berkeley.edu:8007
gdp_event_loop: starting up I/O base loop
Inserted events:
  0x7fb084413220 [fd 115] Read Persist
  0x7fb0844139d0 [fd 116] Read Persist
  0x7fb084413a58 [fd 116] Write Persist
_gdp_req_new: allocated new pdu @ 0x7fb084415470
_gdp_pdu_out, fd = 116, basemd = (nil): CMD_ADVERTISE
gdp_init: OK
_gdp_req_new: allocated new pdu @ 0x7fb084415470

>>> _gdp_invoke(req=0x7fb084415360 rid=1): CMD_OPEN_RA (75), gcl@0x7fb084415a20
        datum @ 0x7fb0844154f0: recno -1, len 0, no timestamp
_gdp_pdu_out, fd = 116, basemd = (nil): CMD_OPEN_RA
_gdp_pdu_in(NAK_R_NOROUTE) => OK

*** Processing ack/nak 240=NAK_R_NOROUTE from socket 116
gdp_pdu_proc_resp(0x7fb08c000b90 NAK_R_NOROUTE) gcl 0x7fb084415a20
_gdp_req_dispatch >>> NAK_R_NOROUTE (240) [gcl->refcnt 2]
nak_router: received NAK_R_NOROUTE for CMD_OPEN_RA
_gdp_req_dispatch <<< NAK_R_NOROUTE [gcl->refcnt 2]
    ERROR: 600 no route available [Berkeley:Swarm-GDP:600]
<<< _gdp_invoke(0x7fb084415360 rid=1) CMD_OPEN_RA: ERROR: 600 no route available [Berkeley:Swarm-GDP:600]
Couldn't open GCL 89hI-eziGXyy1YW1yGt-CDtC9mwb0YFHqc0s--4QJr4:
        ERROR: 600 no route available [Berkeley:Swarm-GDP:600]
<<< gdp_gcl_open(89hI-eziGXyy1YW1yGt-CDtC9mwb0YFHqc0s--4QJr4): ERROR: 600 no route available [Berkeley:Swarm-GDP:600]
GDP_GCL: gdp_gcl_open() failed, trying to create the log and call gdp_gcl_open() again.
GDP_GCL.java: create(org.terraswarm.gdp.GDP_NAME@f950360, , org.terraswarm.gdp.GDP_NAME@45dd93cd, {})
>>> gdp_gcl_create
_gdp_gcl_create: gcl=89hI-eziGXyy1YW1yGt-CDtC9mwb0YFHqc0s--4QJr4
        logd=m5FiAV65ufV8Oe3SinfrOZPcbzXtlNOG-lmD-KSsE1U
_gdp_req_new: allocated new pdu @ 0x7fb084415470

>>> _gdp_invoke(req=0x7fb084415360 rid=2): CMD_CREATE (66), gcl@0x7fb0844158a0
        datum @ 0x7fb0844154f0: recno -1, len 34, no timestamp
00000000 f3 d8 48 f9 ec e2 19 7c b2 d5 85 b5 c8 6b 7e 08
         ⌧  ⌧  H  ⌧  ⌧  ⌧  ⌧  |  ⌧  ⌧  ⌧  ⌧  ⌧  k  ~  ⌧
00000010 3b 42 f6 6c 1b d1 81 47 a9 cd 2c fb ee 10 26 be
         ;  B  ⌧  l  ⌧  ⌧  ⌧  G  ⌧  ⌧  ,  ⌧  ⌧  ⌧  &  ⌧
00000020 00 00
         ⌧  ⌧
_gdp_pdu_out, fd = 116, basemd = (nil): CMD_CREATE
_gdp_pdu_in(NAK_S_INTERNAL) => OK

*** Processing ack/nak 224=NAK_S_INTERNAL from socket 116
gdp_pdu_proc_resp(0x7fb08c000b90 NAK_S_INTERNAL) gcl 0x7fb0844158a0
_gdp_req_dispatch >>> NAK_S_INTERNAL (224) [gcl->refcnt 2]
nak_server: received NAK_S_INTERNAL for CMD_CREATE
_gdp_req_dispatch <<< NAK_S_INTERNAL [gcl->refcnt 2]
    SEVERE: 500 internal server error [Berkeley:Swarm-GDP:500]
gdp_pdu_proc_resp(NAK_S_INTERNAL for CMD_CREATE): SEVERE: 500 internal server error [Berkeley:Swarm-GDP:500]
<<< _gdp_invoke(0x7fb084415360 rid=2) CMD_CREATE: SEVERE: 500 internal server error [Berkeley:Swarm-GDP:500]
Could not create GCL: SEVERE: 500 internal server error [Berkeley:Swarm-GDP:500]
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fb0d9b80976, pid=9469, tid=0x00007fb0e0126700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_121-b13) (build 1.8.0_121-b13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.121-b13 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libgdp.0.7.so+0x12976]  _gdp_gcl_unlock_trace+0x4
#
# 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/cxh/ptII/hs_err_pid9469.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.
#

To build Ptolemy II, see https://www.icyphy.org/accessors/wiki/Main/PtolemyII

For RHEL, the shared library that is used is $PTII/lib/linux-x86-64-rhel/libgdp.0.7.so

For Ubuntu $PTII/lib/libgdp.0.7.so

For Darwin $PTII/lib/libgdp.0.7.dylib

The above shared libraries were built by running 'make all_noavahi'

The Java interface also uses $PTII/lib/gdp-0.7-2.jar

The node interface also crashes in the same place:

cd $PTII/org/terraswarm/accessor/accessors/web/gdp/test/auto
gdb node
...

(gdb) where
#0  _gdp_gcl_unlock_trace (gcl=0x800000001, file=0x7ffff4a87440 "gdp_api.c", line=333, id=0x7ffff4a876b2 "*pgcl") at gdp_gcl_cache.c:499
#1  0x00007ffff4a71687 in gdp_gcl_create (gclname=<value optimized out>,
    logdname=0x1d78d68 "\233\221b\001^\271\271\365|9\355Ҋw\353\071\223\334o5\355\224ӆ\372Y\203\370\244\254\023U", gmd=0x1d94950, pgcl=0x1d78d40)
    at gdp_api.c:333
#2  0x00007ffff4ea3e3c in ffi_call_unix64 () from /home/cxh/src/ptII11.0.devel/node_modules/ffi/build/Release/ffi_bindings.node
#3  0x00007ffff4ea35e3 in ffi_call () from /home/cxh/src/ptII11.0.devel/node_modules/ffi/build/Release/ffi_bindings.node
#4  0x00007ffff4e9bb14 in FFI::FFICall(Nan::FunctionCallbackInfo<v8::Value> const&) ()
   from /home/cxh/src/ptII11.0.devel/node_modules/ffi/build/Release/ffi_bindings.node
#5  0x00007ffff4e9b436 in Nan::imp::FunctionCallbackWrapper(v8::FunctionCallbackInfo<v8::Value> const&) ()
   from /home/cxh/src/ptII11.0.devel/node_modules/ffi/build/Release/ffi_bindings.node
#6  0x0000000000981681 in v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) ()
#7  0x00000000009d5b0b in v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, \
v8::internal::(anonymous namespace)::BuiltinArguments<(v8::internal::BuiltinExtraArguments)1>) ()
#8  0x00000000009d60b1 in v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*) ()

History

#1 Updated by Anonymous about 6 years ago

  • Status changed from New to Closed

This change:

- Log -----------------------------------------------------------------
commit f759690d6c300b2ab034867e50baa3dfa9167014
Author: Eric Allman <eric@cs.berkeley.edu>
Date:   Tue Apr 18 16:23:05 2017 -0700

    Don't dereference null pointer if gdp_gcl_create fails.

Fixed the problem, so I'm closing this.

Thanks for the really fast response.

Also available in: Atom PDF