AndroidStudio Crash on Ubuntu Linux - linux

I am using Android Studio on Ubuntu 16.04 and it just keep crashing, sometimes it doesn't even starts completely and it crashes!
I ran the studio.sh file in the terminal and here is the info dump on the terminal, the last part is around the time when the Android Studio crashed.
Terminal Dump:
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0
WARN: Connection refused
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at java.net.Socket.<init>(Socket.java:434)
at java.net.Socket.<init>(Socket.java:244)
at com.intellij.idea.SocketLock.tryActivate(SocketLock.java:184)
at com.intellij.idea.SocketLock.access$300(SocketLock.java:50)
at com.intellij.idea.SocketLock$2.call(SocketLock.java:124)
at com.intellij.idea.SocketLock$2.call(SocketLock.java:113)
at com.intellij.idea.SocketLock.underLocks(SocketLock.java:157)
at com.intellij.idea.SocketLock.lock(SocketLock.java:113)
at com.intellij.idea.StartupUtil.lockSystemFolders(StartupUtil.java:263)
at com.intellij.idea.StartupUtil.prepareAndStart(StartupUtil.java:101)
at com.intellij.idea.MainImpl.start(MainImpl.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.ide.plugins.PluginManager$2.run(PluginManager.java:91)
at java.lang.Thread.run(Thread.java:745)
log4j:WARN No appenders could be found for logger (io.netty.util.internal.logging.InternalLoggerFactory).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Looking in classpath from com.intellij.util.lang.UrlClassLoader#7a4f0f29 for /com/sun/jna/linux-x86-64/libjnidispatch.so
Found library resource at jar:file:/media/mohit/776b997b-f9a1-46c2-92a0-7f438c7b78e3/mohit/AndroidStudio/android-studio/lib/jna.jar!/com/sun/jna/linux-x86-64/libjnidispatch.so
Trying /home/mohit/.AndroidStudio2.1/system/tmp/jna-104073905/jna3415113200453289594.tmp
Found jnidispatch at /home/mohit/.AndroidStudio2.1/system/tmp/jna-104073905/jna3415113200453289594.tmp
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007fe367a2f587, pid=19294, tid=140614291318528
#
# JRE version: Java(TM) SE Runtime Environment (8.0_91-b14) (build 1.8.0_91-b14)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.91-b14 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V [libjvm.so+0xa27587] SymbolTable::unlink(int*, int*)+0x87
#
# 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/mohit/java_error_in_STUDIO_19294.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#
This just keeps happening a lot and I am completely unable to code anything.

I think you need to install these dependencies:
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
mentioned here.
Try to take a look the permissions of files in the directory that you are installed Android Studio. Maybe you have a problem related with permissions.
SIGSEGV signal/error is a very generic error and it seems like a missing C library dependency.
On POSIX-compliant platforms, SIGSEGV is the signal sent to a process
when it makes an invalid memory reference, or segmentation fault.

Related

Cannot start Karel the Robot on Fedora

So as stated in the title I want to start Karel the Robot on Fedora, I installed the openjdk package and tried everything I found without any success. I'm sadly a total beginner on Linux in general so please walk me through here if you know what to do.
Error is:
#fedora Downloads]$ java -jar karel.jar
Exception in thread "main" java.lang.UnsatisfiedLinkError: Can&apos;t load library: /usr/lib/jvm/java-11-openjdk-11.0.11.0.9-4.fc34.x86_64/lib/libawt_xawt.so
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2630)
at java.base/java.lang.Runtime.load0(Runtime.java:768)
at java.base/java.lang.System.load(System.java:1837)
at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2648)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830)
at java.base/java.lang.System.loadLibrary(System.java:1873)
at java.desktop/java.awt.Toolkit$3.run(Toolkit.java:1399)
at java.desktop/java.awt.Toolkit$3.run(Toolkit.java:1397)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.desktop/java.awt.Toolkit.loadLibraries(Toolkit.java:1396)
at java.desktop/java.awt.Toolkit.<clinit>(Toolkit.java:1429)
at java.desktop/java.awt.Font.<clinit>(Font.java:260)
at b.y.<clinit>(Unknown Source)
at MainKt.main(Unknown Source)
This fedora forum post seems to explain how to fix your issue
Fedora 34 example, with a contemporary version of karel, https://github.com/f7g/karel-release
$ git clone https://github.com/f7g/karel-release.git
$ cd karel-release/
$ java -jar karel.jar ## The karel GUI opens
No issues with the available jdk versions, openjdk version "1.8.0_292" or openjdk version "11.0.11+9" or openjdk version "16.0.1+9"

org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]

I am trying to use eclipse MAT tool on Linux (ubuntu 18.04) and getting the below error:
root#xxx/var/lib/jenkins/workspace/Heap_Analysis/mat# ./MemoryAnalyzer
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
MemoryAnalyzer: Cannot open display:
MemoryAnalyzer:
An error has occurred. See the log file
/var/lib/jenkins/workspace/Heap_Analysis/mat/configuration/1614805252582.log.
root#xxxx:/var/lib/jenkins/workspace/Heap_Analysis/mat# cat /var/lib/jenkins/workspace/Heap_Analysis/mat/configuration/1614805252582.log
!SESSION 2021-03-03 21:00:52.492 -----------------------------------------------
eclipse.buildId=unknown
java.version=11.0.10
java.vendor=Ubuntu
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en
Command-line arguments: -os linux -ws gtk -arch x86_64
!ENTRY org.eclipse.osgi 4 0 2021-03-03 21:00:53.259
!MESSAGE Application error
!STACK 1
org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]
at org.eclipse.swt.SWT.error(SWT.java:4749)
at org.eclipse.swt.widgets.Display.createDisplay(Display.java:1130)
at org.eclipse.swt.widgets.Display.create(Display.java:1070)
at org.eclipse.swt.graphics.Device.<init>(Device.java:175)
at org.eclipse.swt.widgets.Display.<init>(Display.java:636)
at org.eclipse.swt.widgets.Display.<init>(Display.java:627)
If you guys know of any way to fix the issue, would appreciate it.
Have already gone through all the similar issues on stackoverflow and also the below link:
https://unix.stackexchange.com/questions/94497/org-eclipse-swt-swterror-no-more-handles-gtk-init-check-failed-while-runnin
But nothing helped.
I haven't seen this problem myself, but:
Check that you have libwebkit2gtk-4.0 installed
Check that DISPLAY is set correctly
Check that you can get other X applications to work
Try the latest Memory Analyzer, version 1.12 as that is based on a more recent version of Eclipse, 2021-06
I can run MAT under Docker on Windows with an Ubuntu 18.04 based image, so Ubuntu 18.04 can work: Running MAT under Docker

How to properly setup native ARPACK for Spark 2.2.0

I am getting the following Warning when I run the PySpark job:
17/10/06 18:27:16 WARN ARPACK: Failed to load implementation
from: com.github.fommil.netlib.NativeSystemARPACK
17/10/06 18:27:16
WARN ARPACK: Failed to load implementation from:
com.github.fommil.netlib.NativeRefARPACK
My Code is
mat = RowMatrix(tf_rdd_vec.cache())
svd = mat.computeSVD(num_topics, computeU=False)
I am using Ubuntu 16.04 EC2 instance. And I have installed all following libraries into my system.
sudo apt install libarpack2 Arpack++ libatlas-base-dev liblapacke-dev libblas-dev gfortran libblas-dev liblapack-dev libnetlib-java libgfortran3 libatlas3-base libopenblas-base
I have adjusted LD_LIBRARY_PATH to point to shared lib path as following.
export LD_LIBRARY_PATH=/usr/lib/
Now when I list $LD_LIBRARY_PATH directory it shown me the following .so files
ubuntu:~$ ls $LD_LIBRARY_PATH/*.so | grep "pack\|blas"
/usr/lib/libarpack.so
/usr/lib/libblas.so
/usr/lib/libcblas.so
/usr/lib/libf77blas.so
/usr/lib/liblapack_atlas.so
/usr/lib/liblapacke.so
/usr/lib/liblapack.so
/usr/lib/libopenblasp-r0.2.18.so
/usr/lib/libopenblas.so
/usr/lib/libparpack.so
But Still I am not able to use the Native ARPACK implementation. Also I am Caching the RDD passing to matrix But it still throws Cache WARNING Any suggestion how to solve these 3 Warnings ?
I have downloaded compiled version of spark-2.2.0 from the spark download page.
After exploring I am able to remove these warnings and using native ARPACK by the following way.
The solution was to rebuild spark with -Pnetlib-lgpl argument.
Build Spark for Native Support
So following are my steps on Ubuntu 16.04
# Make sure you use the correct download link, from spark download section
wget https://d3kbcqa49mib13.cloudfront.net/spark-2.2.0.tgz
tar -xpf spark-2.2.0.tgz
cd spark-2.2.0/
./dev/make-distribution.sh --name custom-spark --pip --tgz -Psparkr -Phadoop-2.7 -Pnetlib-lgpl
When i started the first time it failed by throwing the following error
Cannot find 'R_HOME'. Please specify 'R_HOME' or make sure R is
properly installed. [ERROR] Command execution failed.
[TRUNCATED]
[INFO] BUILD FAILURE [INFO]
[INFO] Total time: 02:38 min (Wall Clock) [INFO] Finished at:
2017-10-13T21:04:11+00:00 [INFO] Final Memory: 59M/843M
[ERROR] Failed to execute goal
org.codehaus.mojo:exec-maven-plugin:1.5.0:exec (sparkr-pkg) on project
spark-core_2.11: Command execution failed. Process exited with an
error: 1 (Exit value: 1) -> [Help 1] [ERROR]
So i installed the R language
sudo apt install r-base-core
Then i re-ran the above build command and it successfully installed.
Following are related versions when i build this release
$ java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-2ubuntu1.16.04.3-b11)
OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)
$ python --version
Python 2.7.12
$ R --version
R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
$ make --version
GNU Make 4.1
Built for x86_64-pc-linux-gnu

Installing XCTU To Raspbian Jessie with Exagear Desktop

I'm trying to run Linux x86 XCTU (software for XBee controllers) off the guest image generated by Exagear (to execute x86 on Raspberry Pi 2). It fails with the error log file seen below. I tried installing the SWT library (downloaded from Eclipse) in /home/pi. However, it shows the same error message again. What am I doing wrong? What could I do differently ? Is there an easier way to do this? Any suggestions and leads would be much appreciated.
!SESSION 2016-05-01 20:40:42.658 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.7.0_21
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Framework arguments: -clearPersistedState
Command-line arguments: -os linux -ws gtk -arch x86 -clearPersistedState
!ENTRY org.eclipse.osgi 4 0 2016-05-01 20:41:03.414
!MESSAGE Application error
!STACK 1
java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
/opt/Digi/XCTU-NG/configuration/org.eclipse.osgi/bundles/146/1/.cp/libswt-pi-gtk-4236.so: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory
no swt-pi-gtk in java.library.path
/home/pi/.swt/lib/linux/x86/libswt-pi-gtk-4236.so: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory
Can't load library: /home/pi/.swt/lib/linux/x86/libswt-pi-gtk.so
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:331)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:240)
at org.eclipse.swt.internal.gtk.OS.<clinit>(OS.java:22)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:63)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:54)
at org.eclipse.swt.widgets.Display.<clinit>(Display.java:133)
at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:653)
at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:161)
at com.digi.xctung.application.XctungApplication.start(Unknown Source)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
It seems your system missing libgtk-x11-2. You can install it by following command
sudo apt-get install libgtk2.0-0

Can't install sbt and scala correctly on Linux Mint

I tried to install sbt and scala accord to it documentation Setup sbt for Unix:
I created ~/bin
Make sbt file with contents:
#!/bin/bash
SBT_OPTS="-Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M"
java $SBT_OPTS -jar `dirname $0`/sbt-launch.jar "$#"
Make the script executable:
$ chmod u+x ~/bin/sbt
But when I run I caught next message:
nazar_art#nazar-art-System-Product-Name ~/bin $ sbt
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000088000000, 536870912, 0) failed; error='Cannot allocate memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 536870912 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /tmp/hs_err_pid2832.log
I couldn't figure out if I did smt wrong, coz sbt -h - works ok (it shows info message).
How to solve this trouble?

Resources