qdbus is Segmentation faulting - qdbus

I'm using KTimeTracker to monitor my time on different projects. I have a PHP script that periodically runs to give me an idea on how long I've worked in the day.
The PHP script used to connect to KtimeTracker using qdbus to save to file and then use qdbus to
export the CSV file.
For those that wonder why I'm bothering with this setup, I work from home and need to monitor my time to ensure I'm working the right number of hours.
The script worked perfectly well for quite a while but has recently started failing when using qdbus. The simplest call to qdbus is :
qdbus org.kde.ktimetracker /KTimeTracker saveAll
The result of this is
Segmentation fault (core dumped)
qdbus org.kde.ktimetracker /KTimeTracker
Segmentation fault (core dumped)
qdbus org.kde.ktimetracker
/KTimeTracker
/MainApplication
/ktimetracker
/ktimetracker/MainWindow_1
/ktimetracker/MainWindow_1/actions
/ktimetracker/MainWindow_1/actions/file_open
/ktimetracker/MainWindow_1/actions/file_save
/ktimetracker/MainWindow_1/actions/options_configure
/ktimetracker/MainWindow_1/actions/start_new_session
/ktimetracker/MainWindow_1/actions/edit_history
/ktimetracker/MainWindow_1/actions/reset_all_times
/ktimetracker/MainWindow_1/actions/start
/ktimetracker/MainWindow_1/actions/stop
/ktimetracker/MainWindow_1/actions/focusSearchBar
/ktimetracker/MainWindow_1/actions/stopAll
/ktimetracker/MainWindow_1/actions/focustracking
/ktimetracker/MainWindow_1/actions/new_task
/ktimetracker/MainWindow_1/actions/new_sub_task
/ktimetracker/MainWindow_1/actions/delete_task
/ktimetracker/MainWindow_1/actions/edit_task
/ktimetracker/MainWindow_1/actions/edit_task_time
/ktimetracker/MainWindow_1/actions/mark_as_complete
/ktimetracker/MainWindow_1/actions/mark_as_incomplete
/ktimetracker/MainWindow_1/actions/export_dialog
/ktimetracker/MainWindow_1/actions/import_planner
/ktimetracker/MainWindow_1/actions/searchbar
/ktimetracker/MainWindow_1/actions/file_quit
/ktimetracker/MainWindow_1/actions/options_configure_keybinding
/ktimetracker/MainWindow_1/actions/options_show_statusbar
/ktimetracker/MainWindow_1/actions/options_configure_toolbars
/org
/org/kde
/org/kde/ktimetracker
I'm sure that I'm missing something simple but just can't see it. I've spent a few hours already Googling but have come up with nothing.
I don't know if these are of any value
sudo zypper search --provides qdbus
Loading repository data...
Reading installed packages...
S | Name | Summary | Type
---+------------------------+--------------------------------------------------+--------
i+ | libqt5-qdbus | Command line client for communication over D-Bus | package
| libqt5-qdbus-debuginfo | Debug information for package libqt5-qdbus | package
i+ | libqt5-qttools | Qt 5 QtTools Module | package
cat /etc/os-release
NAME="openSUSE Tumbleweed"
# VERSION="20201114"
ID="opensuse-tumbleweed"
ID_LIKE="opensuse suse"
...
develop#bambam:~> bash --version
GNU bash, version 5.0.18(1)-release (x86_64-suse-linux-gnu)
...
Any help will be appreciated.
Cheers

replace qdbus command with qdbus-qt5

Related

Is there a way to see a list of stopped VM instances in IBM Cloud?

To clean up, I want to see what VM instances have been stopped but not terminated. I don't think there is any policy that will terminate them automatically, and I cannot find a way to see how long the instances have been stopped. I am just working from documentation, though, so anyone with practical experience might be able to offer some advice.
If you are looking for a CLI command, IBM Cloud CLI has an infrastructure-service plugin to help you see the instance information. The instructions to set up the plugin can be found in this solution tutorial
ibmcloud is instances
You can use grep with the command to see the instances that are stopped
ibmcloud is instances | grep `stopped`
To get the ID of the stopped VM, run the following command
ibmcloud is instances | grep 'stopped' | awk '{print $1}'

Segmentation Error: Local Machine Fails (16gb) but AWS EC2 works (1gb)

I understand this is a little vague but not sure where else to go to or things to debug. My python script was running fine yesterday. I made minor changes today and now it only runs successfully on my Amazon LightSail (ec2) machine. Everything I read about segmentation errors is that there is not enough memory, however my local machine has 16gb of ram while the cloud machine only has 1gb. Plus I am not working with big files? The files being imported/manipulated are typically under 2mb and there are like 7-10 files.
I feel it may be something related to my terminal/zsh rather than my codes.
The below is the error code I can not seem to manage to get around.
I've done enough research to find the python faulthandler module import faulthandler; faulthandler.enable() to give the debugging below:
Fatal Python error: Segmentation fault
Current thread 0x000000010c58edc0 (most recent call first):
File "/Users/garrett/opt/anaconda3/lib/python3.7/site-packages/pandas/core/groupby/generic.py", line 1795 in <genexpr>
File "/Users/garrett/opt/anaconda3/lib/python3.7/site-packages/pandas/core/groupby/generic.py", line 1797 in <listcomp>
File "/Users/garrett/opt/anaconda3/lib/python3.7/site-packages/pandas/core/groupby/generic.py", line 1797 in count
File "GmailDownloader.py", line 215 in <module>
zsh: segmentation fault python *.py
The code seems to regularly break on line 215 while trying to compute a gorupby in pandas but it is very similar to other groupbys in the code that were successful before it.
I am on a Mac Catlina using the pre-baked zsh for my terminal handling but even when I switch to good ol' bash using chsh -s /bin/bash in my terminal and then running the code I still get a zsh segmentation error.
I have recently tried out PyCharm today and it asked for permissions to store something in a bin folder to which I just said yes. I'm not sure if that is correlated at all or not.
The full code repository: https://github.com/GarrettMarkScott/AutomotiveCRMPuller
Ongoing list of other things I have tried:
Trashing the Terminal preferences (~/Library/Preferences/com.apple.Terminal.plist)
I almost threw in the towel but tried to reinstall my pandas since it was mentioned in my bug error and what do you know it worked after running pip install --upgrade pandas
Would of been impossible without the FaultHandler! Hopefully this helps someone out there!

Undefined symbol error in Centos compile

I have run into an interesting problem. I am compiling my application code and was using ace library(version 6_1_1) on my centos 6 machine. Everything worked fine. When i look at the symbols of the ace library compiled on centos 6 machine, it looks like this:
bash-4.1$ nm ace/libACE.so.6.1.1 | grep handle_sig 000f9430 T
_ZN15ACE_Sig_Adapter13handle_signalEiP7siginfoP8ucontext 000b84d0 T _ZN17ACE_Event_Handler13handle_signalEiP7siginfoP8ucontext 00079f10 T _ZN18ACE_Service_Config13handle_signalEiP7siginfoP8ucontext 000f26d0 T _ZN19ACE_Process_Manager13handle_signalEiP7siginfoP8ucontext 0007ee70 T _ZN19ACE_Service_Manager13handle_signalEiP7siginfoP8ucontext
000cf920 T
_ZN20ACE_MMAP_Memory_Pool13handle_signalEiP7siginfoP8ucontext 000f8b80 T _ZN22ACE_Shared_Memory_Pool13handle_signalEiP7siginfoP8ucontext
bash-4.1$
But when i compile the same project on centos 7 machine, the symbols change:
bash# nm ace/6_1_1/ace/libACE.so.6.1.1 | grep handle_sig 000fa090 T
_ZN15ACE_Sig_Adapter13handle_signalEiP9siginfo_tP8ucontext 000b9570 T
_ZN17ACE_Event_Handler13handle_signalEiP9siginfo_tP8ucontext 0007e070 T
_ZN18ACE_Service_Config13handle_signalEiP9siginfo_tP8ucontext 000f3500 T
_ZN19ACE_Process_Manager13handle_signalEiP9siginfo_tP8ucontext 00081cb0 T
_ZN19ACE_Service_Manager13handle_signalEiP9siginfo_tP8ucontext 000d1990 T
_ZN20ACE_MMAP_Memory_Pool13handle_signalEiP9siginfo_tP8ucontext 000f93d0 T
_ZN22ACE_Shared_Memory_Pool13handle_signalEiP9siginfo_tP8ucontext bash#
Notice that there is an extra _t in siginfo. So, my application which links this library fails to launch during run time giving me that error:
symbol "_ZN17ACE_Event_Handler13handle_signalEiP9siginfo_tP8ucontext"
not found
Another interesting point to note is that if i copy the compiled ace library from my centos 6 box into centos 7 box, my application works fine.
I am lost on how to fix this issue. Any help in this regards will be appreciated!
But when i compile the same project on centos 7 machine, the symbols change:
Probably Glibc on Centos 7 has changed one of the types in public headers which caused mangler to emit different symbols:
$ echo _ZN15ACE_Sig_Adapter13handle_signalEiP7siginfoP8ucontext | c++filt
ACE_Sig_Adapter::handle_signal(int, siginfo*, ucontext*)
$ echo _ZN15ACE_Sig_Adapter13handle_signalEiP9siginfo_tP8ucontext | c++filt
ACE_Sig_Adapter::handle_signal(int, siginfo_t*, ucontext*)
Notice that new method now uses siginfo_t rather than siginfo (you'll see hundreds of complaints if you google for "siginfo_t vs siginfo").
Another interesting point to note is that if i copy the compiled ace
library from my centos 6 box into centos 7 box, my application works fine.
That's backward compatibility - you can (usually) run apps linked on older version of distro on it's newer versions.
On the contrary, forward compatibility (in your case - linking old application against new library) is not guaranteed.
I am lost on how to fix this issue.
If you are only interested in new CentOS - rebuild all your code. If you want to run on older versions - build on the oldest and distribute that.

Foreman start script

I'm facing an issue with my Foreman script. I've installed it following the installation path from Descartes article in GitHub (https://github.com/obfuscurity/descartes). The scripts functions great but I have two things going on.
1- How can I run it in background mode?
2- After a while the service will fall without any apparent reason.
$ cd /descartes_folder/
$ foreman start
13:12:43 web.1 | started with pid 3011
13:12:46 web.1 | >> Thin web server (v1.5.1 codename Straight Razor)
13:12:46 web.1 | >> Maximum connections set to 1024
13:12:46 web.1 | >> Listening on 0.0.0.0:5000, CTRL+C to stop
I tried to send its output to a log file, but the only I got was:
19:30:11 system | sending SIGTERM to all processes
19:30:11 web.1 | exited with code 0
Like if there was a CTRL+C.
Any ideas? anything would be really appreciated!
Thanks!
I just gave up on Foreman. No answer from any of the portals, forums, google groups..even I tried to contact the guy who wrote it directly, still nothing. Finally got another web console for my Graphite metrics (dashboard) and discarded Descartes (the one requiring Foreman).
Thanks anyway!

xwd/java.awt.Robot captures black windows (everything except unity2d shell is black)

Today, I ran into weird issue: java.awt.Robot captures black areas, instead of image content. I'm using Ubuntu 12.04 and OpenJDK6/7.
java.awt.Robot on Unix is supported by the sun.awt.X11.XRobotPeer,
which, following the corresponding OpenJDK sources, uses image grabbing functions similar to those, used by xwd utililty (lines 92-162).
So, I ran the following command:
xwd -root -out test.screen.root.xwd
and then opened this file with gimp. Here's what I get:
Then I tried:
xwd -root | xwdtopnm | pnmtopng > Screenshot.root.png
And I got the following result:
Console output:
xwdtopnm: writing PPM file
libpng warning: Invalid sBIT depth specified
And the image itself:
What can cause this? How can I fix it?
Seems like the only way to fix this is to use your own native implementation of screen shotting.
Here's the detailed description of the problem at the launchpad from unity devs: launchpad conversation.
The problem is in the way unity-2d draws itself and in the use of XShaping.
I had the same error message. Apparently, it is linked to xwdtopnm not handling well the color depth of your screen - causing the resulting png file to be corrupted.
An alternative solution is to use the import command from the imagemagick package to take the screenshot.
So you can just replace:
xwd -root | xwdtopnm | pnmtopng > Screenshot.root.png
with:
import -window root Screenshot.root.png
NB: if it is not installed, you can get imagemagick on Ubuntu with the following command:
sudo apt install imagemagick