Opened 8 years ago

Closed 8 years ago

#5075 closed defect (fixed)

obfsproxy is too gentle during assertion failures

Reported by: asn Owned by: asn
Priority: Medium Milestone:
Component: Archived/Obfsproxy Version:
Severity: Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


This is part of #3613 that never got fixed:

/** Assertion checking.  We don't ever compile assertions out, and we
    want precise control over the error messages, so we use our own
    assertion macros. */
#define obfs_assert(expr)                               \
  do {                                                  \
    if (!(expr))                                        \
      log_error("assertion failure at %s:%d: %s",       \
                __FILE__, __LINE__, #expr);             \
  } while (0)

#define obfs_abort()                                    \
  do {                                                  \
    log_error("aborted at %s:%d", __FILE__, __LINE__);  \
  } while (0)

and log_error() is:

/** Public function for logging an error and then exiting. */
log_error(const char *format, ...)
  va_list ap;

  logv(LOG_SEV_ERR, format, ap);


This won't dump cores or backtraces back to the user.

Child Tickets

Change History (3)

comment:2 Changed 8 years ago by asn

Status: newneeds_review

Please see branch bug5075 in

It simply turns the exit(1) in log_error() to abort().

comment:3 Changed 8 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Actually, we don't want every log_error to abort necessarily: some of them are not bugs.

Committing a variant that adds a separate log_error_abort().

Note: See TracTickets for help on using tickets.