SDL_Init(SDL_INIT_VIDEO) generating excpetion dbus[3856] about dbus library - 32bit-64bit

I developed a C++ application that among others use SDL2.
It compiles and run on Ubuntu 18.04 (64 bit machine) and on OSX.
When I try to compile the application on a computer on chip running Ubuntu Mate 18.04 in a 32 bits machine with the libraries compiled by me, it returns an exception.
The exception is happening inside the line SDL_Init( SDL_INIT_VIDEO ) and the message is the following:
dbus[3856]: arguments to dbus_message_new_method_call were incorrect, assertion "path != NULL" failed in file ../../../dbus/dbus-message.c ine 1362.
This is normally a bug in some application using D-Bus library.
D-Bus not built with -rdynamic so unable to print backtrace.
Aborted
It seems a problem happening on Ubuntu running on a 32 bit machine. Have anyone had the same problem?
How can I solve this problem? Or does anyone know what is generating it?
NOTE 1
Running in gdb and using backtrace as suggested:
#0 0xb613d206 in __libc_do_syscall () at ../sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:47
#1 0xb614ab32 in __libc_signal_restore_set (set=0xbeffe3a4) at ../sysdeps/unix/sysv/linux/nptl-signals.h:80
#2 0xb614ab32 in __GI_raise (sig=sig#entry=6) at ../sysdeps/unix/sysv/linux/raise.c:48
#3 0xb614b82e in __GI_abort () at abort.c:79
#4 0xb2adddf0 in _dbus_abort () at /lib/arm-linux-gnueabihf/libdbus-1.so.3
#5 0xb2ad7c5a in _dbus_warn_check_failed () at /lib/arm-linux-gnueabihf/libdbus-1.so.3
#6 0xb2ad8104 in _dbus_warn_return_if_fail () at /lib/arm-linux-gnueabihf/libdbus-1.so.3
#7 0xb2acce80 in dbus_message_new_method_call () at /lib/arm-linux-gnueabihf/libdbus-1.so.3
#8 0xb68acdba in () at /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0
NOTE 2
The same happens if I install SDL from the repository instead of building it.

I found a partial solution so anybody with a better one would be welcome.
As #Keltar suggested in the comment I debugged it with gdb and backtrace as already said in the question. The last line of backtrace got me suspicious:
#8 0xb68acdba in () at /usr/lib/arm-linux-gnueabihf/libSDL2-2.0.so.0
which suggested it is not taking the library built by me but the one installed with apt. I checked all the paths in Makefile and everything was pointing to my custom built. So I checked the dynamic library files *.so and I found the situation was the following:
drwxr-xr-x 3 odroid odroid 4096 Oct 15 12:21 cmake
lrwxrwxrwx 1 odroid odroid 17 Oct 15 12:21 libSDL2-2.0d.so -> libSDL2-2.0d.so.0
lrwxrwxrwx 1 odroid odroid 21 Oct 15 12:21 libSDL2-2.0d.so.0 -> libSDL2-2.0d.so.0.8.0
-rw-r--r-- 1 odroid odroid 4317020 Oct 15 12:21 libSDL2-2.0d.so.0.8.0
lrwxrwxrwx 1 odroid odroid 15 Oct 15 12:40 libSDL2-2.0.so -> libSDL2-2.0d.so
-rw-r--r-- 1 odroid odroid 7593354 Oct 15 12:21 libSDL2d.a
-rw-r--r-- 1 odroid odroid 4754 Oct 15 12:19 libSDL2maind.a
lrwxrwxrwx 1 odroid odroid 14 Oct 15 13:38 libSDL2.so -> libSDL2-2.0.so
drwxr-xr-x 2 odroid odroid 4096 Oct 15 12:21 pkgconfig
Note that for the symbolic link file libSDL2.so -> libSDL2-2.0.so, the linked file libSDL2-2.0.so was not created.
My solution was to rebuild the library in Release mode instead of Debug using cmake -DCMAKE_BUILD_TYPE=Release: in that way all the files library are correct. Another solution might be to symlink the file(s) manually but is is easy to mess up something.
So it seems a bug in how SDL cmake write the instructions for the Debug build type because in release mode my program run.
If anyone has a better solution or find any error that I could not find please let me know.

Related

How to build static libgpiod-tools executables for arm64?

Is there a way to build the static version of libgpiod-tools executables for arm64?
I need the static-linked version, because I need to pack them into a ramdisk for an embedded system (for debug purpose).
I can find a static version of the tools from a yocto/openbmc build result, but they are for 32-bit machines, and it seems that they can not run on arm64.
[cmic#sr223 libgpio-tools.32bit]$ ls -la
total 84
drwxr-xr-x. 2 cmic cmic 101 Apr 21 22:12 .
drwxrwxr-x. 5 cmic cmic 106 Apr 21 22:13 ..
-rwxr-xr-x. 1 cmic cmic 9652 Apr 21 22:10 gpiodetect
-rwxr-xr-x. 1 cmic cmic 9652 Apr 21 22:10 gpiofind
-rwxr-xr-x. 1 cmic cmic 9648 Apr 21 22:10 gpioget
-rwxr-xr-x. 1 cmic cmic 13748 Apr 21 22:10 gpioinfo
-rwxr-xr-x. 1 cmic cmic 13744 Apr 21 22:10 gpiomon
-rwxr-xr-x. 1 cmic cmic 13744 Apr 21 22:10 gpioset
[cmic#sr223 libgpio-tools.32bit]$ file gpiodetect
gpiodetect: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, BuildID[sha1]=61afc5cfee96d4a155876775f148eb9009ada03b, for GNU/Linux 3.2.0, stripped
[cmic#sr223 libgpio-tools.32bit]$ ldd gpiodetect
not a dynamic executable
[cmic#sr223 libgpio-tools.32bit]$ ./gpiodetect
-bash: ./gpiodetect: cannot execute binary file: Exec format error
Or I can download such executables from somewhere?
I would recommend you build this package from source, using the build system openbmc uses. This is the most reliable, and fastest way to add software to an image.
There is already a recipe for libgpiod-tool. Is is supported in meta-openbedded (which openbmc is based on) Here is the recipe in openbmc.
You will need to add the recipe to a openbmc machine. Try adding
IMAGE_INSTALL:append = " libgpiod-tools"
to the conf/local.conf for the machine you want to build use this on.
Then you can either build the full image or only the libgpiod pacakge
$ bitbake libgpiod
or
$ bitbake obmc-phosphor-image
Then the executable that match the aritture of the machine should be in build/tmp/work/armv7a-openbmc-linux-gnueabi/libgpiod/1.6.3-r0/packages-split/libgpiod-tools/usr/bin
You can move you new binaries over, or install a new image, to run your libgpiod-tool.
Also feel free to ask any questions you have on the openbmc discord
found here https://discord.gg/69Km47zH98, or the openbmc mailing list here https://lists.ozlabs.org/listinfo/openbmc.

dotnet error : Unable to obtain lock file access on '/tmp/NuGetScratch/lock/

Steps to reproduce
dotnet build or dotnet run
Expected behavior
Run or Build app
Actual Behavior
Getting ready...
The template "ASP.NET Core with Angular" was created successfully.
Processing post-creation actions...
Running 'dotnet restore' on /home/limup/Documents/Projetos/Limup/salao/salao.csproj...
/usr/share/dotnet/sdk/3.1.101/NuGet.targets(123,5): error : Unable to obtain lock file access on '/tmp/NuGetScratch/lock/b19d3901039706ea82571abad7c98ec690508d4b' for operations on '/home/limup/Documents/Projetos/Limup/salao/obj/salao.csproj.nuget.cache'. This may mean that a different user or administator is holding this lock and that this process does not have permission to access it. If no other process is currently performing an operation on this file it may mean that an earlier NuGet process crashed and left an inaccessible lock file, in this case removing the file '/tmp/NuGetScratch/lock/b19d3901039706ea82571abad7c98ec690508d4b' will allow NuGet to continue. [/home/limup/Documents/Projetos/Limup/salao/salao.csproj]
Restore failed.
Post action failed.
Description: Restore NuGet packages required by this project.
Manual instructions: Run 'dotnet restore'
Environment Data
dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.1.101
Commit: b377529961
Runtime Environment:
OS Name: fedora
OS Version: 31
OS Platform: Linux
RID: fedora.31-x64
Base Path: /usr/share/dotnet/sdk/3.1.101/
Host (useful for support):
Version: 3.1.1
Commit: a1388f194c
.NET Core SDKs installed:
3.1.101 [/usr/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Obs
Tried Fixes put in dotnet restore, but I received the same error.
Did not have this problem with dotnet sdk 2.0.
In my case, the problem was caused by ownership of the "lock file" (in Linux).
I was running dotnet build under my user (without sudo) but my project was created using sudo.
Option A)
Use sudo again
sudo dotnet build
Option B)
Change /tmp/NuGetScratch/lock/ ownership:
sudo chown -R <user>:<user> /tmp/NuGetScratch/
Then, the user can run dotnet build without sudo.
I fixed that bug with commands below:
export TMPDIR=/tmp/NuGetScratch/
mkdir -p ${TMPDIR}
but, I've been receive the other error and I opened other question post: Post
I was getting the same error in my Visual Studio 2022 when I was trying to build my new console project.
Severity Code Description Project File Line Suppression State
Error Error occurred while restoring NuGet packages: Unable to obtain
lock file access on for operations on 'NuGet.Config'. This may mean
that a different user or administrator is holding this lock and that
this process does not have permission to access it. If no other
process is currently performing an operation on this file it may mean
that an earlier NuGet process crashed and left an inaccessible lock
file, in this case removing the file will allow NuGet to continue.
The very easy fix you can do is to open your Visual Studio as an administrator and build your project.
#Omair Majid, see:
[limup#localhost tmp]$ ll -a
total 12
drwxrwxrwt. 22 root root 480 Jan 15 16:59 .
dr-xr-xr-x. 18 root root 4096 Jan 10 18:51 ..
drwx------. 2 limup limup 60 Jan 15 16:54 .esd-1000
drwxrwxrwt. 2 root root 40 Jan 15 16:49 .font-unix
drwxrwxrwt. 2 root root 60 Jan 15 16:54 .ICE-unix
drwx------. 3 root root 60 Jan 15 16:49 systemd-private-5f8b1b99edb949b1864fa2e580380675-adb.service-WzMSag
drwx------. 3 root root 60 Jan 15 16:49 systemd-private-5f8b1b99edb949b1864fa2e580380675-chronyd.service-Rw6V8i
drwx------. 3 root root 60 Jan 15 16:50 systemd-private-5f8b1b99edb949b1864fa2e580380675-colord.service-9QFuBh
drwx------. 3 root root 60 Jan 15 16:49 systemd-private-5f8b1b99edb949b1864fa2e580380675-dbus-broker.service-DqpFAf
drwx------. 3 root root 60 Jan 15 16:54 systemd-private-5f8b1b99edb949b1864fa2e580380675-fwupd.service-eBNBLh
drwx------. 3 root root 60 Jan 15 16:54 systemd-private-5f8b1b99edb949b1864fa2e580380675-geoclue.service-O6YLYg
drwx------. 3 root root 60 Jan 15 16:49 systemd-private-5f8b1b99edb949b1864fa2e580380675-ModemManager.service-hHCfHf
drwx------. 3 root root 60 Jan 15 16:49 systemd-private-5f8b1b99edb949b1864fa2e580380675-rtkit-daemon.service-3A8e9f
drwx------. 3 root root 60 Jan 15 16:49 systemd-private-5f8b1b99edb949b1864fa2e580380675-switcheroo-control.service-zSjrXg
drwx------. 3 root root 60 Jan 15 16:49 systemd-private-5f8b1b99edb949b1864fa2e580380675-systemd-logind.service-ohP23f
drwx------. 3 root root 60 Jan 15 16:50 systemd-private-5f8b1b99edb949b1864fa2e580380675-upower.service-kMAiIg
drwx------. 2 limup limup 40 Jan 15 16:58 Temp-31248c7a-04ad-429c-ab49-4c2ed74a1986
drwx------. 2 limup limup 40 Jan 15 16:58 Temp-8fa994cb-0334-4cf9-886d-103347596108
drwxrwxrwt. 2 root root 40 Jan 15 16:49 .Test-unix
drwx------. 2 limup limup 40 Jan 15 17:00 tracker-extract-files.1000
-r--r--r--. 1 limup limup 11 Jan 15 16:54 .X0-lock
-r--------. 1 gdm gdm 11 Jan 15 16:50 .X1024-lock
drwxrwxrwt. 2 root root 80 Jan 15 16:54 .X11-unix
drwxrwxrwt. 2 root root 40 Jan 15 16:49 .XIM-unix

Groovy install on Unix OS

I want to install groovy on a unix server and test functionality. I used manual instructions from the following link:
https://itekblog.com/centos-groovy-installation-tutorial-newbs-centos-6-x/
I think the java jdk is installed, but im not certain since I didnt do it myself. I base my opinion on the following commands(i edited output with xxxs to obfuscate info):
[root#xxx groovy]# which java
/opt/xxx/xxx/bin/java
and
[root#xxx bin]# ll
total 48
lrwxrwxrwx. 1 root jdk8 29 Aug 10 2017 jar ->
/opt/xxx/jdk8/current/bin/jar
lrwxrwxrwx. 1 root jdk8 30 Aug 10 2017 java ->
/opt/xxx/jdk8/current/bin/java
lrwxrwxrwx. 1 root jdk8 29 Aug 10 2017 jps ->
/opt/xxx/jdk8/current/bin/jps
lrwxrwxrwx. 1 root jdk8 32 Aug 10 2017 jstack ->
/opt/xxx/jdk8/current/bin/jstack
lrwxrwxrwx. 1 root jdk8 31 Aug 10 2017 jstat ->
/opt/xxx/jdk8/current/bin/jstat
lrwxrwxrwx. 1 root jdk8 33 Aug 10 2017 keytool ->
/opt/xxx/jdk8/current/bin/keytool
Here is my bash_profile:
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
export GROOVY_HOME=/usr/groovy/groovy-2.5.1
PATH=$PATH:$HOME/bin:$GROOVY_HOME/bin
export PATH
I "reloaded" my profile:
source ~/.bash_profile
Here is what happens when I try to "run" groovy:
[root#lhost-cl2 groovy]# groovy -e 'println("Hello, World!")'
Exception in thread "main" java.lang.ClassFormatError:
org.codehaus.groovy.tools.GroovyStarter (unrecognized class file version)
at java.lang.VMClassLoader.defineClass(libgcj.so.10)
at java.lang.ClassLoader.defineClass(libgcj.so.10)
at java.security.SecureClassLoader.defineClass(libgcj.so.10)
at java.net.URLClassLoader.findClass(libgcj.so.10)
at java.lang.ClassLoader.loadClass(libgcj.so.10)
at java.lang.ClassLoader.loadClass(libgcj.so.10)
at gnu.java.lang.MainThread.run(libgcj.so.10)
Suggestions?
There were two versions of java installed on the server. The older version, not compatible with groovy, was being referenced. I updated the path and its happy now.

Error trying to start Notification Server

I was trying to start Phabricator's Notification Server, but experienced the following error:
/phabricator/phabricator/bin/aphlict start
[2015-11-16 18:41:08] EXCEPTION: (FilesystemException) Requested path '/var/tmp/aphlict/pid' is not writable. at [<phutil>/src/filesystem/Filesystem.php:1081]
arcanist(head=master, ref.master=9dd6eafb5254), phabricator(head=master, ref.master=50d158a8c4d9), phutil(head=master, ref.master=e9ed72483a14)
#0 Filesystem::assertWritable(string) called at [<phutil>/src/filesystem/Filesystem.php:73]
#1 Filesystem::assertWritableFile(string) called at [<phutil>/src/filesystem/Filesystem.php:89]
#2 Filesystem::writeFile(string, string) called at [<phabricator>/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php:140]
#3 PhabricatorAphlictManagementWorkflow::willLaunch() called at [<phabricator>/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php:249]
#4 PhabricatorAphlictManagementWorkflow::executeStartCommand() called at [<phabricator>/src/applications/aphlict/management/PhabricatorAphlictManagementStartWorkflow.php:15]
#5 PhabricatorAphlictManagementStartWorkflow::execute(PhutilArgumentParser) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:406]
#6 PhutilArgumentParser::parseWorkflowsFull(array) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:301]
#7 PhutilArgumentParser::parseWorkflows(array) called at [<phabricator>/support/aphlict/server/aphlict_launcher.php:23]
The directory in question seems to be writable:
ls -l /var/tmp/aphlict
total 4
drwxr-xr-x 2 root root 4096 Nov 16 13:40 pid
If it matters, I'm running all operations as non-'root' on Ubuntu 14.04 LTS system.
I have just figured out this. As I said in the recent update, I was trying to start notification server as non-'root'. Looking again at permissions of the /var/tmp/aphlict/pid folder, the problem suddenly became crystal clear and trivial.
ls -l /var/tmp/aphlict
total 4
drwxr-xr-x 2 root root 4096 Nov 16 13:40 pid
Therefore, all that needed to be done to fix the problem is to make the directory writable for everyone (I hope that this approach does not create a potential security issue):
chmod go+w /var/tmp/aphlict/pid
su MY_NON_ROOT_USER_NAME -c './bin/aphlict start'
Aphlict Server started.
Problem solved. By the way, for the Notification Server to work properly, do I need to open port 22281, in addition to already opened 22280? (Please answer in comments. Thank you!)

AIX not able to run applications in specific directory

This might be simple problem. But I am stuck with this for weeks now.
We have an AIX server in which we are facing this issue. I am not able to run programs inside a specific directory and its sub directories.
I am getting proper outputs for commands java and scp2 in /opt/FileNet directory. But when I am in /opt/FileNet/RM directory these commands stops working. Outputs are as below.
Java - JVMXM008: Error occured while initialising System ClassException in thread "main" Could not create the Java virtual machine.
SCP2 - Failed to parse installation path.
I have no idea why this is happening. Your thoughts please.
drwxr-xr-x 24 root system 4096 Feb 21 2012 opt
drwxr-xr-x 17 jxadmin wasadmin 4096 Aug 14 08:40 FileNet
drwxrwxr-x 17 jxadmin wasadmin 4096 Aug 14 08:45 RM
drwxrwxr-x 37 jxadmin wasadmin 4096 Feb 13 2012 AE (/opt/FileNet/AE, This directory is working as expected)
Couldn't find any ACLs.

Resources