Am 25.03.20 um 19:35 schrieb Michael Kress: > Hello Arne, > > Am Wed, 25 Mar 2020 12:50:34 +0100 > schrieb Arne Schwabe <a...@rfc2549.org>: >>> 1) Do you run automated tests of the OpenVPN code on any build >>> server? >>> >>> 2) If that is the case, is there any test with a version, where >>> -DVERIFY_ALIGNMENT is enabled? >>> >> >> I never heard of this option and Google does not want to spit >> something out for me for that. > > That's a #define in the OpenVPN code, for example in > src/openvpn/buffer.h line 943 ;-)
Ah those. Yeah. They are mainly for performance reasons and debugging I think. If I also remember correctly buffer.h is written in a way that these *not* actually trigger unaligned access on a CPU level. But for performance reason having the uint8_t array aligned to 4bytes will make everything faster. > RPI? You mean Raspberry PI? > Maybe on this machine the problem is not a problem. We also use OpenVPN > 2.4.7 on a ARMv7, and there is no obvious problem, just on the old > ARMv4. > > Finding all problematic places in the code will still be difficult. I just look at my RPI and it seems that it has the option you mentioned set by default: cat /proc/cpu/alignment User: 0 System: 0 ( (null)) Skipped: 0 Half: 0 Word: 0 DWord: 0 Multi: 0 User faults: 2 (fixup) But it seems that the CPU will not trap but instead allows unaligned memory access. But since your machine requires that and setting it to 3 (warn+fixup) actually fixes the problem you should get warning messages in your dmesg output about the points in the code that trigger this problem. And you could then either lookup with gdb what the IP addresse are pointing to in the the code or (probably easier) configure the kernel to send a SIGBUS, so you get a core image and can print a backtrace. If we know what code path actually trigger the unaligned access we can take a look and figure out what is wrong. Gert has done similar things with the sparc machines in the past. Arne
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel