Error when running print dialog from GTK 3.0 - c

I have a small GTK 3.0 project that throws an error when displaying the print dialog. The offending statement is the following:
gint res = gtk_print_operation_run(operation, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, GTK_WINDOW(data_passer->application_window), &error);
The error is
** (deposit_slip:16703): WARNING **: 18:16:42.872: failed to get find a colord device: The name org.freedesktop.ColorManager was not provided by any .service files
I'm running the program on the Xfce desktop.
What causes this error?

Related

C - GTK 4 - Able to remove row from liststore but unable to append row to liststore

I am trying to make a program in C with GTK 4.0 on and for Linux and I am trying to update all of the rows in a liststore and add some rows to the liststore. I can use gtk_list_store_remove but when I try to use gtk_list_store_append the program crashes with this:
Gtk:ERROR:../gtk/gtk/gtktreerbtree.c:475:gtk_tree_rbtree_insert_after: assertion failed: (gtk_tree_rbtree_is_nil (tree->root))
Bail out! Gtk:ERROR:../gtk/gtk/gtktreerbtree.c:475:gtk_tree_rbtree_insert_after: assertion failed: (gtk_tree_rbtree_is_nil (tree->root))
The last part is different on Arch Linux and Ubuntu.
Arch Linux:
[1] [PID] IOT instruction (core dumped) [executable]
Ubuntu:
Aborted (core dumped)
I have tried using gtk_list_store_insert to make a new row but it produces the same result. A snippet of my code around where the crash occurs is below. All of the code is available on GitHub. The code is now slightly different on GitHub but still has the same problem.
gboolean valid;
GtkTreeIter iter;
GtkTreeIter curr_iter;
GtkListStore *store = GTK_LIST_STORE(model);
valid = gtk_tree_model_get_iter_first(model, &iter);
// Add or Remove rows so that the total number of rows is equal to rowsWanted
while (valid){
valid = gtk_tree_model_iter_next(model, &iter);
if (valid == false && rowsWanted > gtk_tree_model_iter_n_children(model, NULL)){
// The error occurs here
gtk_list_store_append(store, &iter);
gtk_tree_model_row_inserted(model, gtk_tree_model_get_path(model, &iter), &iter);
//valid = gtk_tree_model_iter_next(model, &iter);
valid = true;
}
else if (valid == true && rowsWanted < gtk_tree_model_iter_n_children(model, NULL)){
gtk_list_store_remove(store, &iter);
gtk_tree_model_row_deleted(model, gtk_tree_model_get_path(model, &iter));
}
}
Does anyone know why this is happening? Thanks.
Edit:
After running the executable through the terminal and not through my IDE, I am seeing "IOT instruction (core dumped)". I am running Arch Linux x86_64.
Edit 2:
On an Ubuntu 21.10 VM, I do not get the IOT instruction but instead I get "Aborted (core dumped)" (makes more sense because assertion is failing). The GTK errors are still the same.
While I could not reproduce this (in an flatpak environment), calling gtk_tree_model_row_inserted() and gtk_tree_model_row_deleted() seems very suspicious to me.
To my knowledge, GtkTreeView uses that internal RBTree implementation, and it uses those signals to know when to update. gtk_list_store_append() and gtk_list_store_remove() already call these signals, so signaling row-inserted twice for the same element would be just wrong.
On my end when I insert your code in GitHub manually I get messages such as:
(taskmonitor:19172): Gtk-CRITICAL **: 00:00:00.000: ../gtk/gtktreeview.c:4960 (gtk_tree_view_bin_snapshot): assertion `has_next' failed.
There is a disparity between the internal view of the GtkTreeView,
and the GtkTreeModel. This generally means that the model has changed
without letting the view know. Any display from now on is likely to
be incorrect.
So try removing those two lines calling gtk_tree_model_row_inserted() and gtk_tree_model_row_deleted() each.

"package or namespace load failed" error in loading R package "litteR"

i am getting the following error whenever i try to load the package "litteR". I have updated all my packages and dont have this problem with any other ones
library(litteR)
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Error: package or namespace load failed for ‘litteR’:
.onLoad failed in loadNamespace() for 'tcltk', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/tcltk/libs/tcltk.so':
dlopen(/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/tcltk/libs/tcltk.so, 0x000A): Library not loaded: /opt/X11/lib/libX11.6.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/tcltk/libs/tcltk.so
Reason: tried: '/opt/X11/lib/libX11.6.dylib' (no such file), '/usr/lib/libX11.6.dylib' (no such file)
In addition: Warning message:
In system2("/usr/bin/otool", c("-L", shQuote(DSO)), stdout = TRUE) :
running command ''/usr/bin/otool' -L '/Library/Frameworks/R.framework/Resources/library/tcltk/libs//tcltk.so'' had status 1
im not sure why this is happening, i have a macbook pro, not sure if this makes a difference
You need to install the commando line tools. Open the Terminal.app and run the following line xcode-select --install

Failing to open audio device (/dev/dsp)

I am using pocketsphinx to adapt my acoustic model which i have trained.
So to use the model in pocketsphinx, i ran the following command:
pocketsphinx_continuous -inmic yes -lm "/home/ridwan/sphinx/other/output/other.lm.DMP" -dict "/home/ridwan/sphinx/other/output/other.dic" -hmm "/home/ridwan/sphinx/other/output/other.ci_cont"
But however, I am getting this error:
ad_oss.c(115): Failed to open audio device(/dev/dsp): Input/output error
FATAL: "continuous.c", line 245: Failed to open audio device
I tried this solution. (installing pulseaudio, libpulse-dev, osspd)
I also tried export LD_PRELOAD=libpulsedsp.so
But I keep getting the same error message.

OpenCV Haar Classifier XML Generation Error

I am going through with the Haar Classifier in OpenCV. I am going through with this link which is
http://note.sonots.com/SciSoftware/haartraining.html#n43ec47f
I am facing problem in ./mergevec executable, error is
OpenCV Error: Assertion failed (elements_read == 1) in icvGetHaarTraininDataFromVecCallback, file cvhaartraining.cpp, line 1859
terminate called after throwing an instance of 'cv::Exception'
what(): cvhaartraining.cpp:1859: error: (-215) elements_read == 1 in function icvGetHaarTraininDataFromVecCallback
I had the same problem on various sized instances and was not thrilled with recompiling each time so I ended up going with randomcastle's mergevec python replacement. https://github.com/wulfebw/mergevec

libVLC failes to create video output

When I compile the example from http://wiki.videolan.org/LibVLC_Tutorial on OS 10.8 with
gcc -I /Applications/VLC.app/Contents/MacOS/include/ -L /Applications/VLC.app/Contents/MacOS/lib/ -lvlc vlc.c
it all works fine but when I try to execute it I get the following error message:
[0x7ff389e094e0] main window error: corrupt module: /Applications/VLC.app/Contents/MacOS/plugins/libmacosx_plugin.dylib
[0x7ff38d002af0] main video output error: video output creation failed
[0x7ff38b0010f0] main decoder error: failed to create video output
It fails to create a video output but manages to create audio output.
Is this specific to the OSX build of VLC or what is the reason for this behavior?

Resources