Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#14875 closed defect (fixed)

undefined behaviour abort during unit tests

Reported by: Sebastian Owned by:
Priority: Medium Milestone: Tor: 0.2.6.x-final
Component: Core Tor/Tor Version:
Severity: Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


When compiling with -fsanitize=undefined, there's this issue on OSX:

address/get_if_addrs_ioctl: [forking] src/common/address.c:1393:37: runtime error: member access within misaligned address 0x62100001b924 for type 'struct ifreq', which requires 8 byte alignment

I'm working on a fix. While working on this, I noticed that we also provide a buffer to ioctl, and if it is too small, well, we don't do anything about it. This was introduced during #12376

Child Tickets

Change History (4)

comment:1 Changed 6 years ago by Sebastian

(This should be checked on FreeBSD and if possible another BSD after it gets fixed, too)

comment:2 Changed 6 years ago by Sebastian

Status: newneeds_review

ok, finally. Branch bug14875 in my repo

comment:3 Changed 6 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

ok; merged. Thanks!

comment:4 Changed 5 years ago by teor

Thanks for this, Sebastian - I'd found the error, but was struggling to diagnose and fix it, as I was using settings that crashed immediately when -fsanitize=undefined found undefined behaviour.

Note: See TracTickets for help on using tickets.