User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

1 bug 1 flaw, no followup.

Wed Dec 19, 2018 7:17 am

I have found one bug and one flaw (seperate issues) with the Raspbian distro that should not have been able to come through.

The bug:
When using xkill to terminate an x client, if the client window belonging to the client to be killed is clicked within a short distance of a border (verified with top, left, right, and bottom) though clearly within then either the next client window back is killed or all X clients having a window other than the root window other than the intended are killed,

The flaw:
With swapp enabled and a significant amount of swap space being used, if swap is dissabled by swapoff -a less physical memory is used after dissabling swap, often even if more is being allocated by applications running. This defeats the purpose of swap.

The No Followup:
It should go with out saying that I have had the bug pop up multiple times on multiple installs of Raspbian Linux, and have observed the flaw repeatedly. Well after enough time of seeing these issues combined with the normal headaches of Linux in general I will not be going back over to Raspbian to get more detailed information on the issues, though the above should give enough to be able to reproduce the problems. I can understand something slipping past the distro team, though not being caught and allowed to slide is another story.

Note on the bug, I normally observe it when attempting to kill an x client in a smaller window away from the edges of the root window (screen), and always have to switch to another virtual consol afterwords and reboot.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23316
Joined: Sat Jul 30, 2011 7:41 pm

Re: 1 bug 1 flaw, no followup.

Wed Dec 19, 2018 10:25 am

Please file a bug on our github tracker.

Although I suspect this is an upstream issue rather than specific to Raspberry Pi. It's also very obscure, so hardly surprising its not been seen or detected.

As for the swap thing, that almost certainly a kernel issue and nothing to do with us.



If you don't like Linux, don't use it.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

jahboater
Posts: 4596
Joined: Wed Feb 04, 2015 6:38 pm

Re: 1 bug 1 flaw, no followup.

Wed Dec 19, 2018 10:45 am

DavidS wrote:
Wed Dec 19, 2018 7:17 am
With swapp enabled and a significant amount of swap space being used, if swap is dissabled by swapoff -a less physical memory is used after dissabling swap, often even if more is being allocated by applications running. This defeats the purpose of swap.
Its more complicated than you might think. Having swap available means the OS can page out infrequently used memory pages. That leaves more physical memory available for active tasks. If you had lots of tasks that were idle 99% of the time, you wouldn't want them taking up real memory would you? There are various parameters that are easily set to tune how its done.
Take a look in "/proc/sys/vm" - swappiness is a common setting.

Linux and UNIX dominate the server market and super computers, so I suspect things like virtual memory are pretty well sorted.

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: 1 bug 1 flaw, no followup.

Wed Dec 19, 2018 2:40 pm

jamesh wrote:
Wed Dec 19, 2018 10:25 am
Please file a bug on our github tracker.

Although I suspect this is an upstream issue rather than specific to Raspberry Pi. It's also very obscure, so hardly surprising its not been seen or detected.

As for the swap thing, that almost certainly a kernel issue and nothing to do with us.



If you don't like Linux, don't use it.
I do like and will continue to use Linux with GNU userland (or even the few Linux distros with BSD userland), just no more Raspbian. The bug is one that I have only seen in Raspbian, not in other distros.

The memory issue, which I am sure comes down to the way memory is being used on these desktop systems, is not an issue with the other distros I use. The other distros I use have no need of swap space at all, as they never reach the 256MB used mark even under the heaviest use cases, thus not an issue for the others that I use.

I attempted to stick with Raspbian as a primary for the two reasons of:
  • There are not many other distros that run on the BCM2835 based RPi's.
  • It is what people generally use on there RPi so if someone has a question I know the setup they are using.
As anyone that does much on Linux will find use of xkill from time to time (we all make mistakes when writing or porting software), that is a very significant issue. I think it may have something to do with the grab boarders being larger than just the one pixel of the edge, though not certain, as that is very much a Raspbian feature that came into play with the Pixel Desktop.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

User avatar
PeterO
Posts: 4940
Joined: Sun Jul 22, 2012 4:14 pm

Re: 1 bug 1 flaw, no followup.

Wed Dec 19, 2018 3:16 pm

DavidS wrote:
Wed Dec 19, 2018 2:40 pm
As anyone that does much on Linux will find use of xkill from time to time (we all make mistakes when writing or porting software), that is a very significant issue.
You have a very "ego centric" view of the world. I've been writing X code for > 30 years and didn't even know that Xkill existed until today.

If you write shoddy code then I guess it might just be useful occasionally, but I find your assertion that "anyone that does much on Linux will find use of xkill from time to time" to be highly questionable

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23316
Joined: Sat Jul 30, 2011 7:41 pm

Re: 1 bug 1 flaw, no followup.

Wed Dec 19, 2018 3:20 pm

Raspbian is almost always the best distro to use , it's the one we use for development and bug fixing, is always a recent kernel, and has a lot more 'eyes' on it that any other Pi distro so is likely more bug free that older less used kernels. It's updated more frequently, always works on all models, and is the one we require bug reporters to provide replication sequences for.

And you are going to stop using it because of some blindingly obscure bug that no one has ever seen before? That is madness.

Report the bug in github, and we will put it on the list of stuff to investigate. I suspect its a bounding box issue with windows in Raspbian Desktop, maybe due to something changed in the Pi specific customisations. Does it happen in standard LXDE?

AFAIK, we make no changes to the swap/memory system over standard Debian. So the swap issue is in all likelihood nothing to do with us, at worst it's the setup, but that's easy enough for the end user to change. Worth noting, that just because something doesn't work the way you want or expect, doesn't mean its actually a bug.

I also have never heard of xkill.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

n67
Posts: 938
Joined: Mon Oct 30, 2017 4:55 pm

Re: 1 bug 1 flaw, no followup.

Wed Dec 19, 2018 3:24 pm

jamesh wrote:
Wed Dec 19, 2018 3:20 pm
I also have never heard of xkill.
https://linux.die.net/man/1/xkill

HTH
"L'enfer, c'est les autres"

G fytc hsqr rum umpbq rm qyw rm rfc kmbq md rfgq dmpsk:

Epmu Sn!

J lnacjrw njbruh-carppnanm vxm rb mnuncrwp vh yxbcb!

User avatar
PeterO
Posts: 4940
Joined: Sun Jul 22, 2012 4:14 pm

Re: 1 bug 1 flaw, no followup.

Wed Dec 19, 2018 3:29 pm

n67 wrote:
Wed Dec 19, 2018 3:24 pm
jamesh wrote:
Wed Dec 19, 2018 3:20 pm
I also have never heard of xkill.
https://linux.die.net/man/1/xkill
HTH
No help at all. What distribution does that web page refer to ? Does it apply to Raspbian ?
You should always use man from the command line to get the pages installed on the local box to ensure they are appropriate.
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

jahboater
Posts: 4596
Joined: Wed Feb 04, 2015 6:38 pm

Re: 1 bug 1 flaw, no followup.

Wed Dec 19, 2018 3:31 pm

DavidS,
Here are some of the tuning parameters for the virtual memory. If you don't like the way it behaves, you can alter these just by "echo N >parameter", or "cat parameter" to see its current value.

Code: Select all

pi@pi0:/proc/sys/vm $ ls
admin_reserve_kbytes         drop_caches           oom_kill_allocating_task
block_dump                   extfrag_threshold     overcommit_kbytes
compact_memory               laptop_mode           overcommit_memory
compact_unevictable_allowed  legacy_va_layout      overcommit_ratio
dirty_background_bytes       lowmem_reserve_ratio  page-cluster
dirty_background_ratio       max_map_count         panic_on_oom
dirty_bytes                  min_free_kbytes       percpu_pagelist_fraction
dirty_expire_centisecs       mmap_min_addr         swappiness
dirty_ratio                  mmap_rnd_bits         user_reserve_kbytes
dirty_writeback_centisecs    nr_pdflush_threads    vfs_cache_pressure
dirtytime_expire_seconds     oom_dump_tasks        watermark_scale_factor
I have heard of xkill now.

User avatar
scruss
Posts: 2418
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: 1 bug 1 flaw, no followup.

Wed Dec 19, 2018 3:47 pm

DavidS wrote:
Wed Dec 19, 2018 2:40 pm
As anyone that does much on Linux will find use of xkill from time to time …
A few years back I might've used xkill now and again, but nowadays it's something I need with vanishing rarity. Most X window managers correctly close a program if you hit the close button. It may take a few seconds, it may prompt you, but it does close almost every time. Anything past that usually needs a logout or restart, as the WM itself is failing.

Now, if you accidentally xkill the terminal your windows were spawned from, then yes, a whole buncha windows can close.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23316
Joined: Sat Jul 30, 2011 7:41 pm

Re: 1 bug 1 flaw, no followup.

Wed Dec 19, 2018 4:03 pm

n67 wrote:
Wed Dec 19, 2018 3:24 pm
jamesh wrote:
Wed Dec 19, 2018 3:20 pm
I also have never heard of xkill.
https://linux.die.net/man/1/xkill

HTH
TBH, I am quite capable of looking it up, but that still doesn't negate the fact that I had never heard of it, although, clearly, I have now. I quote "This program is very dangerous, but is useful for aborting programs that have displayed undesired windows on a user's screen.". Sounds like a nuke from orbit it's the only way to be sure type of command, but useful to know it exists. I'm not surprised this issue has not been seen before, I suspect very few people use it.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

Return to “Raspbian”