Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bus error when building on armhf #705

Closed
cbiedl opened this issue Feb 6, 2022 · 2 comments
Closed

Bus error when building on armhf #705

cbiedl opened this issue Feb 6, 2022 · 2 comments
Assignees
Labels

Comments

@cbiedl
Copy link

cbiedl commented Feb 6, 2022

The Debian buildd daemons report "Bus error" in the test suite when building on armhf https://buildd.debian.org/status/fetch.php?pkg=tcpreplay&arch=armhf&ver=4.4.0-1&stamp=1644098099&raw=0:

[tcpprep] Auto/Router mode test: /bin/bash: line 1: 2371998 Bus error               ../src/tcpprep --no-arg-comment --dbug=1 -i ./test.pcap -o test.auto_router1 -a router >> test.log 2>&1
make[2]: *** [Makefile:690: auto_router] Error 135

On my local boxes, I can confirm this behaviour.

Bisect led to

af0d523122ebdfb459eec9b9e1dd7dfedddc82cb is the first bad commit
commit af0d523122ebdfb459eec9b9e1dd7dfedddc82cb
Author: Fred Klassen <[email protected]>
Date:   Thu Jan 27 14:26:32 2022 -0800

    Bug #695 remove FORCE_ALIGN

Backtrace, command was:

gdb --args ../src/tcpprep --no-arg-comment --dbug=1 -i ./test.pcap -o test.auto_router1 -a router
Program received signal SIGBUS, Bus error.
0x004050a8 in check_ip6_tree (mode=0, addr=0x448c76) at tree.c:296
296         finder->u.ip6 = *addr;
(gdb) bt
#0  0x004050a8 in check_ip6_tree (mode=0, addr=0x448c76) at tree.c:296
#1  0x0040375c in process_raw_packets (pcap=0x447f10) at tcpprep.c:497
#2  0x004029da in main (argc=9, argv=0xfffef4e4) at tcpprep.c:144

So I'd ask you to re-visit this issue and find a better solution for it.

Reverting that commit doesn't look like a good idea, and also introduces another issue, I haven't checked further:

I: [tcprewrite] L7 fuzzing test: make[2]: *** [Makefile:1062: rewrite_l7fuzzing] Error 1
@fklassen fklassen self-assigned this Feb 9, 2022
@fklassen fklassen added the bug label Feb 9, 2022
@fklassen
Copy link
Member

fklassen commented Feb 9, 2022

@cbiedl I had tested on armhf QEMU image but maybe my setup is different. I am running wheezy with libpcap 0.9.8. Can you help me understand your setup so I can reproduce?

The issue with reverting this commit, tests will fail on Apple M1.

root@debian-armhf:/home/user/tcpreplay-4.4.0# uname -a
Linux debian-armhf 3.2.0-4-vexpress #1 SMP Debian 3.2.51-1 armv7l GNU/Linux
root@debian-armhf:/home/user/tcpreplay-4.4.0# make test
echo Making test in ./test
Making test in ./test
cd ./test && make test
make[1]: Entering directory `/home/user/tcpreplay-4.4.0/test'
NOTICE: Tests must be run as root
Sending traffic on 'eth0' and 'eth0'
[tcpprep] Auto/Router mode test: 		OK
[tcpprep] Auto/Bridge mode test: 		OK
[tcpprep] Auto/Client mode test: 		OK
[tcpprep] Auto/Server mode test: 		OK
[tcpprep] Auto/First mode test: 		OK
[tcpprep] CIDR mode test: 			OK
[tcpprep] Regex mode test: 			OK
[tcpprep] Port mode test: 			OK
[tcpprep] MAC mode test: 			OK
[tcpprep] Comment mode test: 			OK
[tcpprep] Print info mode test: 		OK
[tcpprep] Print comment mode test: 		OK
[tcpprep] Config mode test: 			OK
[tcpprep] MAC reverse mode test: 		OK
[tcpprep] CIDR reverse mode test: 		OK
[tcpprep] Regex reverse mode test: 		OK
[tcpprep] exclude packets test: 		OK
[tcpprep] include packets test: 		OK
[tcpprep] include source test: 			OK
[tcpprep] include destination test: 		OK
[tcpreplay] Basic test: 			OK
[tcpreplay] Cache test: 			OK
[tcpreplay] Packets/sec test: 			OK
[tcpreplay] Mbps test: 				OK
[tcpreplay] Topspeed test: 			OK
[tcpreplay] Config file/VLAN add test: 		OK
[tcpreplay] Multiplier test: 			OK
[tcpreplay] Packets/sec Multiplier test: 	OK
[tcpreplay] Precache test: 			OK
[tcpreplay] Statistics test: 			OK
[tcpreplay] Dual file test: 			OK
[tcpreplay] Maximum sleep test: 		OK
[tcprewrite] Portmap test: 			OK
[tcprewrite] Portmap range test: 		OK
[tcprewrite] Endpoint test: 			OK
[tcprewrite] Pseudo NAT test: 			OK
[tcprewrite] Truncate test: 			OK
[tcprewrite] Pad test: 				OK
[tcprewrite] Seed IP test: 			OK
[tcprewrite] Src/Dst MAC test: 			OK
[tcprewrite] Layer2 test: 			OK
[tcprewrite] Config/VLAN Add test: 		OK
[tcprewrite] Skip bcast test: 			OK
[tcprewrite] DLT User test: 			OK
[tcprewrite] DLT Cisco HDLC test: 		OK
[tcprewrite] VLAN 802.1ad test: 		OK
[tcprewrite] VLAN Delete test: 			OK
[tcprewrite] Remove EFCS: 			OK
[tcprewrite] Force TTL: 			OK
[tcprewrite] Increase TTL: 			OK
[tcprewrite] Reduce TTL: 			OK
[tcprewrite] TOS test: 				OK
[tcprewrite] MTU Truncate test: 		OK
[tcprewrite] Substitute Src/Dst MAC test: 	OK
[tcprewrite] Seeded MAC test: 			OK
[tcprewrite] Seeded Keep MAC test: 		OK
[tcprewrite] L7 fuzzing test: 			OK
[tcprewrite] TCP sequence test: 		OK
[tcprewrite] Fix checksum test: 		OK
[tcprewrite] Fix length and pad test: 		OK
[tcprewrite] Fix length and truncate test: 	OK
[tcprewrite] Fix length and delete test: 	OK
make[1]: Leaving directory `/home/user/tcpreplay-4.4.0/test'

@fklassen
Copy link
Member

Although I could not reproduce this on my armhf, I believe this will fix the issue on all Linux ARM devices

Main fix is to revert FORCE_ALIGN code, and improve the test for whether or not it is required. Also made some fixes around FORCED_ALIGN.

Don't do test for Apple devices - not required. Also do the test for other ARM devices.

Fixed in PR #707

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants