#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2017
    Posts
    1
    Rep Power
    0

    help - rights issue


    denkovi board, jar file runs fine if I sudo it from command line, but cant get it to run via cgi script, it fails and so Im assuming its a rights issue.

    Error log is pasted below.

    Can someone tell me where my rights issue is, how to fix it?

    PS - I know virtually nothing about java...

    Code:
    ==============
    
    #
    # A fatal error has been detected by the Java Runtime Environment:
    #
    #  SIGSEGV (0xb) at pc=0x00007f4d4040d35d, pid=8322, tid=0x00007f4d5b2b4700
    #
    # JRE version: OpenJDK Runtime Environment (8.0_121-b13) (build 1.8.0_121-8u121-b13-0ubuntu1.16.04.2-b13)
    # Java VM: OpenJDK 64-Bit Server VM (25.121-b13 mixed mode linux-amd64 compressed oops)
    # Problematic frame:
    # C  [ftd2xx7653569820999802099.so+0xa35d]  libusb_close+0x1f
    #
    # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
    #
    # If you would like to submit a bug report, please visit:
    #   Java Crash Reporting Page
    # The crash happened outside the Java Virtual Machine in native code.
    # See problematic frame for where to report the bug.
    #
    
    ---------------  T H R E A D  ---------------
    
    Current thread (0x00007f4d5400a000):  JavaThread "main" [_thread_in_native, id=8329, stack(0x00007f4d5b1b4000,0x00007f4d5b2b5000)]
    
    siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000045
    
    Registers:
    [deleted]
    
    Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
    j  com.sun.jna.Native.invokeInt(JI[Ljava/lang/Object;)I+0
    j  com.sun.jna.Function.invoke([Ljava/lang/Object;Ljava/lang/Class;Z)Ljava/lang/Object;+219
    j  com.sun.jna.Function.invoke(Ljava/lang/reflect/Method;[Ljava/lang/Class;Ljava/lang/Class;[Ljava/lang/Object;Ljava/util/Map;)Ljava/lang/Object;+249
    j  com.sun.jna.Library$Handler.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;+348
    j  com.ftdi.$Proxy0.FT_CreateDeviceInfoList(Lcom/sun/jna/ptr/IntByReference;)I+16
    j  com.ftdi.FTDevice.getDevicesBySerialNumber(Ljava/lang/String;)Ljava/util/List;+12
    j  denkovirelaycommandlinetool_27.h.a(Ljava/lang/String;)Ljava/lang/String;+2
    j  denkovirelaycommandlinetool_27.DenkoviRelayCommandLineTool_27.main([Ljava/lang/String;)V+820
    v  ~StubRoutines::call_stub
    
    ---------------  P R O C E S S  ---------------
    
    Java Threads: ( => current thread )
      0x00007f4d5429c800 JavaThread "process reaper" daemon [_thread_blocked, id=8341, stack(0x00007f4d40631000,0x00007f4d4066a000)]
      0x00007f4d5414a000 JavaThread "Service Thread" daemon [_thread_blocked, id=8338, stack(0x00007f4d40883000,0x00007f4d40984000)]
      0x00007f4d54132000 JavaThread "C1 CompilerThread1" daemon [_thread_blocked, id=8337, stack(0x00007f4d40984000,0x00007f4d40a85000)]
      0x00007f4d5412f000 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=8336, stack(0x00007f4d40a85000,0x00007f4d40b86000)]
      0x00007f4d5412d000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=8335, stack(0x00007f4d40b86000,0x00007f4d40c87000)]
      0x00007f4d54106000 JavaThread "Finalizer" daemon [_thread_blocked, id=8334, stack(0x00007f4d40c87000,0x00007f4d40d88000)]
      0x00007f4d54101800 JavaThread "Reference Handler" daemon [_thread_blocked, id=8333, stack(0x00007f4d40d88000,0x00007f4d40e89000)]
    =>0x00007f4d5400a000 JavaThread "main" [_thread_in_native, id=8329, stack(0x00007f4d5b1b4000,0x00007f4d5b2b5000)]
    
    Other Threads:
      0x00007f4d540fa000 VMThread [stack: 0x00007f4d40e89000,0x00007f4d40f8a000] [id=8332]
      0x00007f4d5414c000 WatcherThread [stack: 0x00007f4d40782000,0x00007f4d40883000] [id=8339]
    
    VM state:not at safepoint (normal execution)
    
    VM Mutex/Monitor currently owned by a thread: None
    
    Heap:
     PSYoungGen      total 18432K, used 5529K [0x00000000ebd80000, 0x00000000ed200000, 0x0000000100000000)
      eden space 15872K, 34% used [0x00000000ebd80000,0x00000000ec2e6418,0x00000000ecd00000)
      from space 2560K, 0% used [0x00000000ecf80000,0x00000000ecf80000,0x00000000ed200000)
      to   space 2560K, 0% used [0x00000000ecd00000,0x00000000ecd00000,0x00000000ecf80000)
     ParOldGen       total 42496K, used 0K [0x00000000c3800000, 0x00000000c6180000, 0x00000000ebd80000)
      object space 42496K, 0% used [0x00000000c3800000,0x00000000c3800000,0x00000000c6180000)
     Metaspace       used 5424K, capacity 5608K, committed 5888K, reserved 1056768K
      class space    used 602K, capacity 674K, committed 768K, reserved 1048576K
    
    Card table byte_map: [0x00007f4d44640000,0x00007f4d44825000] byte_map_base: 0x00007f4d44024000
    
    Marking Bits: (ParMarkBitMap*) 0x00007f4d5a47f220
     Begin Bits: [0x00007f4d424bb000, 0x00007f4d433db000)
     End Bits:   [0x00007f4d433db000, 0x00007f4d442fb000)
    
    Polling page: 0x00007f4d5b2d1000
    
    CodeCache: size=245760Kb used=1797Kb max_used=1801Kb free=243962Kb
     bounds [0x00007f4d44be5000, 0x00007f4d44e55000, 0x00007f4d53be5000]
     total_blobs=653 nmethods=363 adapters=206
     compilation: enabled
    
    Compilation events (10 events):
    Event: 2.111 Thread 0x00007f4d54132000 nmethod 359 0x00007f4d44da38d0 code [0x00007f4d44da3a20, 0x00007f4d44da3b50]
    Event: 2.111 Thread 0x00007f4d54132000  360  s    3       java.lang.StringBuffer::append (13 bytes)
    Event: 2.112 Thread 0x00007f4d54132000 nmethod 360 0x00007f4d44da7290 code [0x00007f4d44da7400, 0x00007f4d44da7728]
    Event: 2.112 Thread 0x00007f4d5412f000 nmethod 351 0x00007f4d44da7810 code [0x00007f4d44da7980, 0x00007f4d44da7d28]
    Event: 2.112 Thread 0x00007f4d5412f000  344       4       sun.misc.ProxyGenerator$ConstantPool$IndirectEntry::hashCode (15 bytes)
    Event: 2.113 Thread 0x00007f4d5412f000 nmethod 344 0x00007f4d44da5810 code [0x00007f4d44da5960, 0x00007f4d44da59d8]
    Event: 2.114 Thread 0x00007f4d54132000  361       3       java.lang.ClassLoader::loadClass (7 bytes)
    Event: 2.114 Thread 0x00007f4d54132000 nmethod 361 0x00007f4d44da6c90 code [0x00007f4d44da6e00, 0x00007f4d44da7008]
    Event: 2.114 Thread 0x00007f4d54132000  362       3       sun.misc.Launcher$AppClassLoader::loadClass (85 bytes)
    Event: 2.116 Thread 0x00007f4d54132000 nmethod 362 0x00007f4d44da2510 code [0x00007f4d44da2740, 0x00007f4d44da3448]
    
    GC Heap History (0 events):
    No events
    
    Deoptimization events (0 events):
    No events
    
    Internal exceptions (10 events):
    Event: 0.491 Thread 0x00007f4d5400a000 Exception <a 'java/lang/NoSuchMethodError': Method sun.misc.Unsafe.defineClass(Ljava/lang/String;[BII)Ljava/lang/Class; name or signature does not match> (0x00000000ebd87ca8) thrown at [/build/openjdk-8-YiEakL/openjdk-8-8u121-b13/src/hotspot/src/share/vm/
    Event: 0.491 Thread 0x00007f4d5400a000 Exception <a 'java/lang/NoSuchMethodError': Method sun.misc.Unsafe.prefetchRead(Ljava/lang/Object;J)V name or signature does not match> (0x00000000ebd87f90) thrown at [/build/openjdk-8-YiEakL/openjdk-8-8u121-b13/src/hotspot/src/share/vm/prims/jni.cpp, lin
    Event: 1.356 Thread 0x00007f4d5400a000 Exception <a 'java/security/PrivilegedActionException'> (0x00000000ebec8ae0) thrown at [/build/openjdk-8-YiEakL/openjdk-8-8u121-b13/src/hotspot/src/share/vm/prims/jvm.cpp, line 1390]
    Event: 1.356 Thread 0x00007f4d5400a000 Exception <a 'java/security/PrivilegedActionException'> (0x00000000ebec8cf0) thrown at [/build/openjdk-8-YiEakL/openjdk-8-8u121-b13/src/hotspot/src/share/vm/prims/jvm.cpp, line 1390]
    Event: 1.357 Thread 0x00007f4d5400a000 Exception <a 'java/security/PrivilegedActionException'> (0x00000000ebecaac8) thrown at [/build/openjdk-8-YiEakL/openjdk-8-8u121-b13/src/hotspot/src/share/vm/prims/jvm.cpp, line 1390]
    Event: 1.357 Thread 0x00007f4d5400a000 Exception <a 'java/security/PrivilegedActionException'> (0x00000000ebecacd8) thrown at [/build/openjdk-8-YiEakL/openjdk-8-8u121-b13/src/hotspot/src/share/vm/prims/jvm.cpp, line 1390]
    Event: 1.358 Thread 0x00007f4d5400a000 Exception <a 'java/security/PrivilegedActionException'> (0x00000000ebecb718) thrown at [/build/openjdk-8-YiEakL/openjdk-8-8u121-b13/src/hotspot/src/share/vm/prims/jvm.cpp, line 1390]
    Event: 1.358 Thread 0x00007f4d5400a000 Exception <a 'java/security/PrivilegedActionException'> (0x00000000ebecb928) thrown at [/build/openjdk-8-YiEakL/openjdk-8-8u121-b13/src/hotspot/src/share/vm/prims/jvm.cpp, line 1390]
    Event: 1.839 Thread 0x00007f4d5400a000 Exception <a 'java/lang/NoSuchFieldError': method resolution failed> (0x00000000ec097078) thrown at [/build/openjdk-8-YiEakL/openjdk-8-8u121-b13/src/hotspot/src/share/vm/prims/methodHandles.cpp, line 1146]
    Event: 1.844 Thread 0x00007f4d5400a000 Exception <a 'java/lang/NoSuchFieldError': method resolution failed> (0x00000000ec0a47c8) thrown at [/build/openjdk-8-YiEakL/openjdk-8-8u121-b13/src/hotspot/src/share/vm/prims/methodHandles.cpp, line 1146]
    
    Events (10 events):
    Event: 2.115 loading class java/lang/reflect/TypeVariable
    Event: 2.115 loading class java/lang/reflect/TypeVariable done
    Event: 2.115 loading class java/lang/reflect/AnnotatedType
    Event: 2.115 loading class java/lang/reflect/AnnotatedType done
    Event: 2.116 loading class com/sun/jna/Library$Handler$FunctionInfo
    Event: 2.116 loading class com/sun/jna/Library$Handler$FunctionInfo done
    Event: 2.117 loading class com/sun/jna/NativeMappedConverter
    Event: 2.117 loading class com/sun/jna/NativeMappedConverter done
    Event: 2.118 loading class com/sun/jna/TypeConverter
    Event: 2.118 loading class com/sun/jna/TypeConverter done
    
    
    Dynamic libraries:
    [deleted]
    
    VM Arguments:
    java_command: /usr/share/denkovi/DenkoviRelayCommandLineTool_27.jar DAE003dB 4 1 0
    java_class_path (initial): /usr/share/denkovi/DenkoviRelayCommandLineTool_27.jar
    Launcher Type: SUN_STANDARD
    
    Environment Variables:
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    
    Signal Handlers:
    SIGSEGV: [libjvm.so+0xa66fd0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
    SIGBUS: [libjvm.so+0xa66fd0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
    SIGFPE: [libjvm.so+0x8b0180], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
    SIGPIPE: [libjvm.so+0x8b0180], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
    SIGXFSZ: [libjvm.so+0x8b0180], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
    SIGILL: [libjvm.so+0x8b0180], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
    SIGUSR1: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
    SIGUSR2: [libjvm.so+0x8b0030], sa_mask[0]=00000000000000000000000000000000, sa_flags=SA_RESTART|SA_SIGINFO
    SIGHUP: [libjvm.so+0x8b0500], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
    SIGINT: [libjvm.so+0x8b0500], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
    SIGTERM: [libjvm.so+0x8b0500], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
    SIGQUIT: [libjvm.so+0x8b0500], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
    
    
    ---------------  S Y S T E M  ---------------
    
    OS:DISTRIB_ID=Ubuntu
    DISTRIB_RELEASE=16.04
    DISTRIB_CODENAME=xenial
    DISTRIB_DESCRIPTION="Ubuntu 16.04.2 LTS"
    
    uname:Linux 4.4.0-66-generic #87-Ubuntu SMP Fri Mar 3 15:29:05 UTC 2017 x86_64
    libc:glibc 2.23 NPTL 2.23 
    rlimit: STACK 8192k, CORE 0k, NPROC 15324, NOFILE 8192, AS infinity
    load average:0.76 1.10 1.04
    
    /proc/meminfo:
    MemTotal:        3964100 kB
    MemFree:          742020 kB
    MemAvailable:    2748812 kB
    Buffers:          926928 kB
    Cached:          1269652 kB
    SwapCached:        78016 kB
    Active:          1344092 kB
    Inactive:        1557900 kB
    Active(anon):     300336 kB
    Inactive(anon):   497576 kB
    Active(file):    1043756 kB
    Inactive(file):  1060324 kB
    Unevictable:          32 kB
    Mlocked:              32 kB
    SwapTotal:      39259128 kB
    SwapFree:       38134800 kB
    Dirty:             25688 kB
    Writeback:             0 kB
    AnonPages:        686368 kB
    Mapped:           161152 kB
    Shmem:             92352 kB
    Slab:             225640 kB
    SReclaimable:     189788 kB
    SUnreclaim:        35852 kB
    KernelStack:       12912 kB
    PageTables:        35564 kB
    NFS_Unstable:          0 kB
    Bounce:                0 kB
    WritebackTmp:          0 kB
    CommitLimit:    41241176 kB
    Committed_AS:    7787108 kB
    VmallocTotal:   34359738367 kB
    VmallocUsed:           0 kB
    VmallocChunk:          0 kB
    HardwareCorrupted:     0 kB
    AnonHugePages:     49152 kB
    CmaTotal:              0 kB
    CmaFree:               0 kB
    HugePages_Total:       0
    HugePages_Free:        0
    HugePages_Rsvd:        0
    HugePages_Surp:        0
    Hugepagesize:       2048 kB
    DirectMap4k:      200380 kB
    DirectMap2M:     3911680 kB
    
    
    CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 13, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, tsc
    
    /proc/cpuinfo:
    processor	: 0
    vendor_id	: GenuineIntel
    cpu family	: 6
    model		: 15
    model name	: Intel(R) Pentium(R) Dual  CPU  E2180  @ 2.00GHz
    stepping	: 13
    microcode	: 0xa3
    cpu MHz		: 1200.000
    cache size	: 1024 KB
    physical id	: 0
    siblings	: 2
    core id		: 0
    cpu cores	: 2
    apicid		: 0
    initial apicid	: 0
    fpu		: yes
    fpu_exception	: yes
    cpuid level	: 10
    wp		: yes
    flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm lahf_lm dtherm
    bugs		:
    bogomips	: 3990.06
    clflush size	: 64
    cache_alignment	: 64
    address sizes	: 36 bits physical, 48 bits virtual
    power management:
    
    processor	: 1
    vendor_id	: GenuineIntel
    cpu family	: 6
    model		: 15
    model name	: Intel(R) Pentium(R) Dual  CPU  E2180  @ 2.00GHz
    stepping	: 13
    microcode	: 0xa3
    cpu MHz		: 2000.000
    cache size	: 1024 KB
    physical id	: 0
    siblings	: 2
    core id		: 1
    cpu cores	: 2
    apicid		: 1
    initial apicid	: 1
    fpu		: yes
    fpu_exception	: yes
    cpuid level	: 10
    wp		: yes
    flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm lahf_lm dtherm
    bugs		:
    bogomips	: 3990.06
    clflush size	: 64
    cache_alignment	: 64
    address sizes	: 36 bits physical, 48 bits virtual
    power management:
    
    
    
    Memory: 4k page, physical 3964100k(742020k free), swap 39259128k(38134800k free)
    
    vm_info: OpenJDK 64-Bit Server VM (25.121-b13) for linux-amd64 JRE (1.8.0_121-8u121-b13-0ubuntu1.16.04.2-b13), built on Jan 23 2017 15:51:29 by "buildd" with gcc 5.4.0 20160609
    
    time: Sun Apr 16 10:34:25 2017
    elapsed time: 2 seconds (0d 0h 0m 2s)
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2014
    Location
    India
    Posts
    200
    Rep Power
    4
    Can you tell in a bit more detail what are you trying to accomplish? You're saying the .jar file runs fine if you run it with root privileges. Is it necessary to run it as root? Java-applications should never be run as root in my opinion.

    And you're also saying that when run from a CGI script it does not run:
    denkovi board, jar file runs fine if I sudo it from command line, but cant get it to run via cgi script, it fails and so Im assuming its a rights issue.
    What is this CGI script? Is it also being run with elevated privileges?

    I'm sorry but the details are vague at best at the moment. One cannot just look at a random debug log and tell the cause unless they knew what you were doing to begin with.

    If this is an end-user issue (i.e. you're trying to get a software to run) and you've done no modifications or anything else then you should contact the developers.
  4. #3
  5. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,475
    Rep Power
    1875
    So which actual product from Denkovi are you using?

    It's curious that it crashed in libusb_close, as that seems to imply that the corresponding libusb_open actually worked successfully (despite the lack of privileges).

    Have you already asked on Denkovi support channels for help?

    When you're running it from the CGI, what is the effective user ID? It shouldn't be root, or your normal login user, but something with a lot less privileges. You don't want to unnecessarily elevate any network facing code.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper

IMN logo majestic logo threadwatch logo seochat tools logo