Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 01 Mar 2016 08:05:05 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 207589] dns/fastresolve broken, builds but does not run (segfaults)
Message-ID:  <bug-207589-13-SlJfhJ8OEe@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-207589-13@https.bugs.freebsd.org/bugzilla/>
References:  <bug-207589-13@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D207589

Dan Lukes <dan@obluda.cz> changed:

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

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

Note the ud2a instruction on the end of disassembly of _ZN10BoolStringaSERK=
S_
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 sh=
ould
generate warning only at compile time.

The function _ZN10BoolStringaSERKS_ come from following source code functio=
n:

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

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

Lets patch the code to be correct:

 ----------------------
  BoolString &operator=3D(const BoolString &other) {
    str =3D other.str;
    flag =3D 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=20
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=3D\"fastresolve\" -DVERSION=3D\"2.10\" -DHAVE_FGETLN=3D1 -DHA=
VE_LIBZ=3D1
-DHAVE_LIBADNS=3D1  -I. -I. -g -O0 -pipe -fstack-protector -fno-strict-alia=
sing=20
-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/inclu=
de
-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

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-207589-13-SlJfhJ8OEe>