Re: Way to kill processes with unaligned access?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/18/22 15:11, John David Anglin wrote:
It's controlled by /proc/sys/kernel/unaligned-trap.

Yes, /proc/sys/kernel/unaligned-trap controls the system-wide setting.
But if you want to just debug some code, it's better to spawn a shell
with the prctl program, e.g:
 prctl --unaligned=signal
              starts  up  a  shell (as defined by the environment variable SHELL) and sets up any
              process running under this shell to be sent SIGBUS upon an unaligned memory access.

Sadly, glibc (I believe) still generates some:
dupload(8822): unaligned access to 0xf8b3630d at ip 0xf720c88b (iir 0xee8104d)
http(6292): unaligned access to 0xfab011cd at ip 0xf720c9c3 (iir 0xd481043)

why do you think it's from glibc?
couldn't it be from the program itself?

Helge

Dave

On 2022-12-18 6:41 a.m., Sam James wrote:

On 18 Dec 2022, at 11:25, Helge Deller <deller@xxxxxx> wrote:

https://manpages.ubuntu.com/manpages/focal/man1/prctl.1.html

Thanks, this looks perfect!

-------- Ursprüngliche Nachricht --------
Von: Helge Deller <deller@xxxxxx>
Datum: 18.12.22 12:23 (GMT+01:00)
An: Sam James <sam@xxxxxxxxxx>, linux-parisc@xxxxxxxxxxxxxxx
Betreff: RE: Way to kill processes with unaligned access?

See prctl manpage, PR_SET_UNALIGN.
-------- Ursprüngliche Nachricht --------
Von: Sam James <sam@xxxxxxxxxx>
Datum: 18.12.22 10:14 (GMT+01:00)
An: linux-parisc@xxxxxxxxxxxxxxx
Betreff: Way to kill processes with unaligned access?

Hi all,

I'm wondering if there's a way to configure the kernel such that
it kills processes when an unaligned access occurs.

I often get messages like:
```
[18531.277742] conftest(4066): unaligned access to 0xf7fa1715 at ip 0x426cb787 (iir 0xf801094)
[18531.487681] conftest(4066): unaligned access to 0xf7fa1716 at ip 0x426cb793 (iir 0xf80109c)
```

I know what they are, but it's a real pain to figure out *which* configure test in a given
case is causing the problem. If there's some way to make the kernel kill such naughty processes,
it'd make it way easier for me to locate.

(Sometimes when I've built hundreds of packages, I have a lot of these I want to go investigate
after a week or two, but it's hard to track it down afterwards because of this.)

Any ideas?

Thanks!






[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux