Page MenuHomeFreeBSD

New port: security/py-angr: multi-architecture binary analysis toolkit
ClosedPublic

Authored by 0mp on Mar 3 2020, 12:35 AM.

Details

Summary

The port builds just fine. There is only one part I am not sure about: I had to reimplement thread id retrieving (FreeBSD does not have __NR_gettid) and I am not sure if I did it correctly. I'd be grateful I someone could review it.

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=244562

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Update the __NR_gettid reimplementation

kaktus added inline comments.
security/py-angr/files/patch-native_log.c
19 ↗(On Diff #69098)

There is no reason to zero errno here.

22 ↗(On Diff #69098)
if (thr_self(&tid) <0 )…

or maybe just (if it links with pthreads)

dprintf(log_fd, "[%s][%s][%d] %s():%d ", timestr, logLevels[ll].descr, pthread_getthreadid_np(), fn, ln);
23 ↗(On Diff #69098)

tid is already of type pid_t, no reason to cast it to pid_t again.

  • Simplify __NR_gettid implementation as suggested by kevans & kaktus.
  • Add a test targett

Tests are completely broken at the moment. The port is not ready to be shipped.

  • Do not cast tid to pid_t
0mp planned changes to this revision.Mar 3 2020, 1:42 AM
0mp marked 2 inline comments as done and an inline comment as not done.
0mp added inline comments.
security/py-angr/files/patch-native_log.c
17 ↗(On Diff #69097)

This is the part which I am not sure about.

22 ↗(On Diff #69098)

I'll try it out soon.

linimon retitled this revision from New port: security/py-angr to New port: security/py-angr: multi-architecture binary analysis toolkit.Mar 8 2020, 2:24 AM
0mp marked an inline comment as done.Mar 10 2020, 6:04 PM
0mp added inline comments.
security/py-angr/files/patch-native_log.c
22 ↗(On Diff #69098)

Yeah, seems to compile.

This revision was not accepted when it landed; it landed in state Changes Planned.Mar 12 2020, 9:14 AM
Closed by commit rP528280: New port: security/py-angr (authored by 0mp). · Explain Why
This revision was automatically updated to reflect the committed changes.