Qt-based Face Recognition Application - linux

Im trying to compile a Qt project based on the example given here.
I managed to compile without errors, but during execution there are errors. I'm getting these errors in pop up windows:
-open /dev/dsp error
-init failed
-start capture failed
-get frame failed
Moreover, the output displays:
sh: line 0: .:setqt4env:file not found
Trying open file
Could not open File! Error code: 5
/home/QFaceRec/QTFaceRecForPC exited with code 0
SIGSEGV Error when debugging with Qt Creator.
I have googled, answers are due to the application tries to access memory illegally.
Therefore, I try to execute in su - / root, but the run time error remain unsolved.
Im trying to compile and run the code in fedora with qt creator without the GPIO and serial port setting.
Anyone got any ideas to my problem? or knows how to compile the qt code in the link above

Answers are due to the application tries to access memory illegally. Therefore, I try to execute in su - / root
Do not do that! The illegal memory access is not a matter of permissions, it's a matter of the software having bugs. By running it as root, there's a possibility that those bugs will wreck your system.

Related

Python script import error `failed to map segment from shared object: Permission denied` with hplip

I have been installing locally the latest hplip 3.6.11 (HP Linux Imaging and Printing) for two computers that run on Ubuntu 14.04 LTS. The general installation procedure is described here. The whole procedure finished seamlessly for one machine but not for another one. I would like to pinpoint the cause of this failure and complete the installation.
Incident description
The step where one computer fails is when using hp-setup to configure the printer. hp-setup is a symbolic link to a Python script. On both machines, this file has the same attributes:
ll -Z $(realpath `which hp-setup`)
-rwxr-xr-x 1 root root ? 38026 Mar 1 08:10 /usr/share/hplip/setup.py*
In the failing computer, launching hp-setup throws an import error
Please make sure your printer is connected and powered on at this time.
Do you want to setup printer in GUI mode? (u=GUI mode*, i=Interactive mode) : i
Running 'hp-setup -i' command....
Traceback (most recent call last):
File "/usr/bin/hp-setup", line 48, in <module> from base import device, utils, tui, models, module, services, os_utils
File "/usr/share/hplip/base/device.py", line 42, in <module> from . import status
File "/usr/share/hplip/base/status.py", line 33, in <module> import cupsext
ImportError: libgpg-error.so.0: failed to map segment from shared object: Permission denied
error: hp-setup failed. Please run hp-setup manually.
Concerning cupsext (in the most recent call), in both computers the build directory of hplip contains ./hplip-3.16.11/prnt/cupsext/ that contains cupsext.h and cupsext.o. Conditions are equal here.
The requisite shared object lives in the same location /lib/x86_64-linux-gnu/libgpg-error.so.0.10.0 in both computers. The ll -Z shows same attributes and permissions, again.
Concerning the suggestion to run the script manually, it does not matter whether hp-setup is run by a script or manually. Actually, I get the same error if I launch one other script hp-plugin.
Also, the fact that installation script went this far means that all dependency and conflict issues have been ironed out.
This error is repeatable. If I remove the build/object directory manually and re-install from scratch, it occurs again. Note that the installation script itself has a rule to clean existing versions of hplip, including the one I had just installed with the same script.
With this evidence I searched possible causes of this error around the internet.
HPLIP diagnostics and troubleshooting tips
hp-check cannot only find what hp-setup has not accomplished, which is consistent. Then, the troubleshoot documentation does not seem to cover this error.
SELinux permission, security contexts and the like
This cause is suggested, for example, here and here.
I do acknowledge that SELinux issues are far beyond my experience and expertise.
However, the ll -Z command above shows that the SELinux tag ? is the same for same files in both computers. So the SELinux spoor does not quite isolate the issue.
Question
What can be the reason for a Python script
to throw an import error
to fail to map a segment from a so file
to encounter a permission denied
at the same time?
Disclaimer I has already lodged a question on this error in the past https://askubuntu.com/questions/743164/hplip-update-cannot-install-plugin, but I cannot quite recall which workaround or heavenly twist worked then. The description of this one incident is much more thorough since it isolates the problem within a scripting and library issue, which is independent of Ubuntu.

Adding path to CUDA libraries without sudo access

I used a library (the library is called cublas) in my CUDA code which I 'm writing in linux, I can compile my code successfully using nvcc but when I run the code I get this error:
error while loading shared libraries: libcublas.so.7.5: cannot open shared object file: No such file or directory
I found This link as a solution which suggests to run some commands in order to solve the issue. one solution based on this link is running the following command:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib
The system which gpu locates in it and I am using to run my code on it is shared between me and other people, I am not a sudo user in that system. I am wondering if running this command is safe and does not affect other settings of the system
Can anyone please help me to know that>
Thank you so much
I am wondering if running this command is safe and does not affect other settings of the system
Yes, you'll be fine.
This command:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib
only affects the process you execute it in.
It will not affect any other user's process, or any other process of yours.
Furthermore, if you log out and log in again, you will have to execute that command again. It is not "sticky"

Permission denied when trying to run .bin on Linux webserver

I am trying to run a compiled C++ program on my webserver (Debian), but the terminal is outputting the following error message:
-bash: ./program.bin: Permission denied
The rights on program.bin are set to -rwxr-xr-x, which means that it should have the permission to be executed. I already tried running /bin/bash program.bin, but this is giving me this error:
ovInterface.bin: ovInterface.bin: cannot execute binary file
The hosting provider of the webserver probably has forbidden this, since there are a lot of websites/accounts hosted on my webserver. If that's the case, is it possible to bypass this restriction? I was able to run .php files in the background of the webserver, which had an infinite for loop and handled socket connections etc.
Any help would be appreciated!
EDIT:
I found out that the cannot execute binary file error from /bin/bash program.bin means that the compiled program is not built for the system architecture. program.bin was compiled on another machine (however both are 64-bit).
If it is possible to run the .bin file using /bin/bash: How do I compile C++ code to executables without access to gcc, g++, make and apt-get? Can I upload a compiler executable to my webserver and compile the C++ source then?

Dandelion List Listener Fails

I am trying to use lisp in linux but I can not get the listener to work.
Using Eclipse's menu, in help -> install new software, I installed the dandelion plugin but every time I try to run lisp code, like (+ 1 2), something simple, I get the following errors:
Error in background evaluation
java.net.ConnectException: Connection refused
Error initialising connection
java.net.ConnectException: Connection refused
Starting eval server failed
Cannot run program "/home/michael/.eclipse/org.eclipse.platform_3.8_155965261/plugins/de.defmacro.dandelion.env.clisp.linux.x86_2.49.2/binary/environment_clisp_2.49.2": error=13, Permission denied
I have tried running the command
sudo chmod + /home/michael/.eclipse/org.eclipse.platform_3.8_155965261/plugins/de.defmacro.dandelion.env.clisp.linux.x86_2.49.2/binary/environment_clisp_2.49.2
Yet I see no output, the terminal just goes to the next new line. I am running a 64bit ubuntu version 14. I am pretty new to all this but I would like to use linux as my main OS as it is quite convenient for school. If anyone has ideas please let me know!
This answer will get the SBCL listener working in eclipse in linux using the Dandelion plugin.
What I had to do was tell my computer to show hidden files and folders. Manually navigate to
/home/michael/.eclipse/org.eclipse.platform_3.8_155965261/plugins/de.defmacro.dandelion.env.sbcl.linux.x86_1.1.10/binary
Right click on the executable and edit the permissions to allow me all read and write access. I did the same for
/home/michael/.eclipse/org.eclipse.platform_3.8_155965261/plugins/de.defmacro.dandelion.env.clisp.linux.x86_2.49.2
I restarted eclipse, ran the SBCL[1.1.10] listener and tested (+ 1 2) I got the answer 3. I can not get the CLISP 2.49.2 listener working but just being able to develop in linux in lisp makes me quite happy and I hope this helps someone else down the line.

OpenCL: permission (capability) needed to run `clinfo` as non-root

I'm trying to move away from running an application using OpenCL (on an Intel GPU, using beignet) as root all the time. I seem to have run into some permission issue though. clinfo seems to show the same permission issue. Is there some easy way of finding out what permissions/capabilities are needed?
When I run clinfo from the Linux console as an ordinary user I get the following:
drm_intel_gem_bo_context_exec() failed: Invalid argument
/dev/dri/card0 not authenticated
Device open failed, aborting...
error in /home/magnus/lcam-deb/libbeignet-lcam/src/cl_api.c line 298
Invalid device
As root it works fine.
If I start X as the same user and then run clinfo in an xterminal it works just fine too.
For me the solution was passing drm.rnodes=1 to the kernel at boot. I found that information hidden in the How to run section on the beignet wiki.

Resources