[Bug 207589] dns/fastresolve broken, builds but does not run (segfaults)

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Mar 1 08:05:05 UTC 2016


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

Dan Lukes <dan at obluda.cz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dan at obluda.cz

--- Comment #6 from Dan Lukes <dan at obluda.cz> ---
Well, lets allow me to publish results of this night research.

Note the ud2a instruction on the end of disassembly of _ZN10BoolStringaSERKS_
function. The ud2a is instruction guaranteed by Intel to be invalid.

Some compilers use it to fire intentional "Illegal instruction" abort at
runtime in the case they can't compile c++ code correctly, but the cause should
generate warning only at compile time.

The function _ZN10BoolStringaSERKS_ come from following source code function:

 ----------------------
  BoolString &operator=(const BoolString &other) {
    str = other.str;
    flag = other.flag;
  }
 ----------------------

The compilation of such code produce
1. ./BoolString.h:59:3: warning: control reaches end of non-void function 
2. ud2a instruction in the code

Lets patch the code to be correct:

 ----------------------
  BoolString &operator=(const BoolString &other) {
    str = other.str;
    flag = other.flag;
    return *this;
  }
 ----------------------

Compiler no longer produce a warning - and no longer emit ud2a into code.

I consider it solution of the reported bug.

 ............

Note that there are other warnings during compilation as well, so there may be
severe issues with the resulting code.

warning: conversion from string literal to 'char *' is deprecated
is fired at
dns-terror.cc:346:34
dns-terror.cc:373:11
dns-terror.cc:431:27
dns-terror.cc:581

and 
format specifies type 'int' but the argument has type 'size_type' (aka
'unsigned long')
is fired at
dns-terror.cc:706:33

I didn't analyzed them. They may be "warnings safe to be ignored" or may be
warnings fatal for proper function of resulting code.

 ..............

Some additional data. Analyzed on:

 -------------
OS: 10.2-RELEASE-p12 amd64

c++ -v
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
Target: x86_64-unknown-freebsd10.2
Thread model: posix
Selected GCC installation:

Command to compile:
c++ -DPACKAGE=\"fastresolve\" -DVERSION=\"2.10\" -DHAVE_FGETLN=1 -DHAVE_LIBZ=1
-DHAVE_LIBADNS=1  -I. -I. -g -O0 -pipe -fstack-protector -fno-strict-aliasing 
-I/usr/local/include -I/usr/local/include/db6 -c dns-terror.cc

Command to link:
c++ -g -O0 -pipe -fstack-protector -fno-strict-aliasing  -I/usr/local/include
-I/usr/local/include/db6 -L/usr/local/lib -L/usr/local/lib/db6
-fstack-protector -o dns-terror  dns-terror.o getline.o fgetln.o
DatedStringDb.o  -ladns -lz  -ldb_cxx-6.1

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list