[SOLVED] Slackware-current artifact when running dialog
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
$ cd dialog-1.3-20181022/ # build directory
$ ./dialog --msgbox hello 30 40 # this binary is being built myself and is causing segfault
I still have original version installed as usally '/usr/bin/dialog'. This original (!) version is causing artifact. Probably it is issue of intel frame buffer driver. I will test this without frame buffer, VGA-only. I suppose it will be OK.
I've compiled the latest dialog here and see the same artifact on the console (using a Radeon card here), so a newer dialog won't fix it. However, I noticed that if I set TERM=screen rather than the default TERM=linux that the artifact goes away. So I suspect it's a problem with the linux console terminfo entry. I'm not sure how to go about adjusting that (or if that's even the right approach here)... any help appreciated.
Couldn't this be actually a ncurses issue? I remember iptraf-ng was affected by artifacts for a long period after a ncurses update on -current (can't really remember exactly when - I guess it was last year) It got fixed recently by another ncurses update.
Some other feedback on ncurses: https://github.com/dpayne/cli-visualizer/issues/62
@igadoter
Code:
/usr/bin/toe | grep linux
linux linux console
...
linux-m1 Linux Minitel 1 "like" Couleurs
You can also check the terminals in /usr/lib/terminfo/
The problem seems to be triggered by the BCE feature. If you recompile the 'linux' terminfo definition without it then you don't see the screen corruption. Having said that, BCE is a really nice feature that one really doesn't want to throw out if it's available: without it any background has to be rendered by drawing a space with the appropriate colour attributes in each and every cell of the screen.
I knocked up a quick test case to try and see if ncurses was doing the right thing, and it seems to render correctly in both BCE and non-BCE environments. My initial suspicions lean towards dialog itself being at fault, but it could still be something weird going on in ncurses. Without digging into the source code and debugging there's no way to know for sure.
Code:
/* testing.c
* Investigate ncurses and background colour erase (BCE)
* Fills the screen with a blue background and then
* renders a black window with white text.
*
* compile:
* cc -lncursesw testing.c
*/
#define _XOPEN_SOURCE 700
#include <curses.h>
#include <locale.h>
int main( int argc, char **argv)
{
cchar_t bg_cchar;
wchar_t bg_wch = L' ';
wint_t k;
WINDOW *my_win ;
setlocale( LC_ALL, "");
initscr();
my_win = newwin( 10,40,5,20);
start_color();
init_pair(1, COLOR_WHITE, COLOR_BLUE);
setcchar( &bg_cchar, &bg_wch, (attr_t) 0, 1, NULL);
bkgrnd(&bg_cchar);
clear();
refresh();
mvwprintw(my_win, 0, 1, "Hello");
wrefresh(my_win);
get_wch(&k);
endwin();
return 0;
}
Slackware 14.2 Kernel 4.19 did this for me, going back 4.18.x did not have the issue. Try downgrading your kernel in current and see if it still does it.
Yes, apologies to dialog and ncurses. It appears that the \033[nK "erase line" sequences in the linux terminal emulator are buggy! Specifically, they don't seem to honor the BCE colour when erasing, yet if you switch away from the virtual console with ctrl-alt-fn and then back again, the missing background colour magically reappears. If it worked previously then it smells like a kernel regression.
I'm only running Slack -current on ARM (Raspberry Pi) and using the official kernel from Raspberry. Due to the kernel USB bug, later on - broken firmware (still) and messed up kernel sources sync (need them to patch a driver) I'm stuck with the kernel 4.4.50-v7+ from March/April 2017.
My report from #6 about the iptraf-ng artifacts (totally messed up table borders) after the ncurses updates (late 2017 or beginning of 2018), and the subsequent fix, again by updating ncurses, was about these ARM systems always running the kernel 4.4.50-v7+.
ncurses changed (several updates) and maybe some other components that are related to the terminals, however, the kernel was the same all the time.
Removed. My mistake. It is still unsolved. Even with recent update terminfo database. But at it was pointed by @Pixxt downgrade of the kernel removes appearance of artifact.
Last edited by igadoter; 10-31-2018 at 09:56 AM.
Reason: Total mess
I noticed that artifact disappears for large in width windows. On my console '150' in width is critical. With this width artifact is just small black strip on the left.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.