# [tor] naruszenie ochrony pamięci

## Mr Adam

Witam! Otóż mój demon tor nie chce startować, towarzyszy temu błąd:

```
 * Service tor starting

/etc/init.d/tor: line 14: 13927 Naruszenie ochrony pamięci   /usr/bin/tor --verify-config -f ${CONFFILE} >&/dev/null

 * Tor configuration (/etc/tor/torrc) not valid.

Nov 10 19:03:55.692 [notice] Tor v0.1.2.17. This is experimental software. Do not rely on it for strong anonymity.

Nov 10 19:03:55.693 [notice] Detected state file from old version 'Tor 0.1.2.16'. Choosing new entry guards for you.

/etc/init.d/tor: line 14: 13929 Naruszenie ochrony pamięci   /usr/bin/tor --verify-config -f ${CONFFILE}

 * ERROR:  tor failed to start

```

Czy to Tor v0.1.2.17 czy Tor v0.1.2.16 błąd i tak występuje.

Plik konfiguracyjny tora:

```
## Configuration file for a typical Tor user

## Last updated 8 October 2006 for Tor 0.1.2.3-alpha.

## (May or may not work for older or newer versions of Tor.)

##

## Lines that begin with "## " try to explain what's going on. Lines

## that begin with just "#" are disabled commands: you can enable them

## by removing the "#" symbol.

##

## See the man page, or http://tor.eff.org/tor-manual-cvs.html, for more

## options you can use in this file.

##

## On Unix, Tor will look for this file in someplace like "~/.tor/torrc" or

## "/etc/torrc"

##

## On Windows, Tor will look for the configuration file in someplace like

## "Application Data\tor\torrc" or "Application Data\<username>\tor\torrc"

##

## With the default Mac OS X installer, Tor will look in ~/.tor/torrc or

## /Library/Tor/torrc

## Default username and group the server will run as

User adam

Group users

PIDFile /var/run/tor/tor.pid

## Replace this with "SocksPort 0" if you plan to run Tor only as a

## server, and not make any local application connections yourself.

SocksPort 9050 # what port to open for local application connections

SocksListenAddress 127.0.0.1 # accept connections only from localhost

#SocksListenAddress 192.168.0.1:9100 # listen on this IP:port also

## Entry policies to allow/deny SOCKS requests based on IP address.

## First entry that matches wins. If no SocksPolicy is set, we accept

## all (and only) requests from SocksListenAddress.

#SocksPolicy accept 192.168.0.0/16

#SocksPolicy reject *

## Logs go to stdout at level "notice" unless redirected by something

## else, like one of the below lines. You can have as many Log lines as

## you want.

##

## We advise using "notice" in most cases, since anything more verbose

## may provide sensitive information to an attacker who obtains the logs.

##

## Send all messages of level 'notice' or higher to /var/lib/log/tor/notices.log

#Log notice file /var/lib/log/tor/notices.log

## Send every possible message to /var/lib/log/tor/debug.log

#Log debug file /var/lib/log/tor/debug.log

## Use the system log instead of Tor's logfiles

#Log notice syslog

## To send all messages to stderr:

#Log debug stderr

Log notice file /var/log/tor/tor.log

## Uncomment this to start the process in the background... or use

## --runasdaemon 1 on the command line. This is ignored on Windows;

## see the FAQ entry if you want Tor to run as an NT service.

RunAsDaemon 1

## The directory for keeping all the keys/etc. By default, we store

## things in $HOME/.tor on Unix, and in Application Data\tor on Windows.

#DataDirectory /var/lib/lib/tor

DataDirectory   /var/lib/tor/data

## The port on which Tor will listen for local connections from Tor

## controller applications, as documented in control-spec.txt.

#ControlPort 9051

############### This section is just for location-hidden services ###

## Once you have configured a hidden service, you can look at the

## contents of the file ".../hidden_service/hostname" for the address

## to tell people.

##

## HiddenServicePort x y:z says to redirect requests on port x to the

## address y:z.

#HiddenServiceDir /var/lib/lib/tor/hidden_service/

#HiddenServicePort 80 127.0.0.1:80

#HiddenServiceDir /var/lib/lib/tor/other_hidden_service/

#HiddenServicePort 80 127.0.0.1:80

#HiddenServicePort 22 127.0.0.1:22

################ This section is just for servers #####################

## NOTE: If you enable these, you should consider mailing the contents

## of the "fingerprint" file to the tor-ops, so nobody else can pick

## your nickname and use a different key. See

## http://tor.eff.org/docs/tor-doc-server.html for details.

## Required: A unique handle for your server.

#Nickname ididnteditheconfig

## The IP or FQDN for your server. Leave commented out and Tor will guess.

#Address noname.example.com

## Define these to limit your bandwidth usage. Note that BandwidthRate

## must be at least 20 KB.

#BandwidthRate 100 KB      # Throttle traffic to 100KB/s (800Kbps)

#BandwidthBurst 200 KB     # But allow bursts up to 200KB/s (1600Kbps)

## Contact info to be published in the directory, so we can contact you

## if your server is misconfigured or something else goes wrong.

#ContactInfo Random Person <nobody AT example dot com>

## You might also include your PGP or GPG fingerprint if you have one:

#ContactInfo 1234D/FFFFFFFF Random Person <nobody AT example dot com>

## Required: what port to advertise for Tor connections.

#ORPort 9001

## If you want to listen on a port other than the one advertised

## in ORPort (e.g. to advertise 443 but bind to 9090), uncomment the

## line below too. You'll need to do ipchains or other port forwarding

## yourself to make this work.

#ORListenAddress 0.0.0.0:9090

## Uncomment this to mirror the directory for others. Please do

## if you have enough bandwidth: see the bottom of

## http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#LimitBandwidth

#DirPort 9030 # what port to advertise for directory connections

## If you want to listen on a port other than the one advertised

## in DirPort (e.g. to advertise 80 but bind to 9091), uncomment the line

## below too. You'll need to do ipchains or other port forwarding yourself

## to make this work.

#DirListenAddress 0.0.0.0:9091

## Uncomment this if you run more than one Tor server, and add the

## nickname of each Tor server you control, even if they're on different

## networks. You declare it here so Tor clients can avoid using more than

## one of your servers in a single circuit.

#MyFamily nickname1,nickname2,...

## A comma-separated list of exit policies. They're considered first

## to last, and the first match wins. If you want to _replace_

## the default exit policy, end this with either a reject *:* or an

## accept *:*. Otherwise, you're _augmenting_ (prepending to) the

## default exit policy. Leave commented to just use the default, which is

## available in the man page or at http://tor.eff.org/documentation.html

##

## Look at http://tor.eff.org/faq-abuse.html#TypicalAbuses

## for issues you might encounter if you use the default exit policy.

##

## If certain IPs and ports are blocked externally, e.g. by your firewall,

## you should update your exit policy to reflect this -- otherwise Tor

## users will be told that those destinations are down.

##

#ExitPolicy accept *:6660-6667,reject *:* # allow irc ports but no more

#ExitPolicy accept *:119 # accept nntp as well as default exit policy

#ExitPolicy reject *:* # no exits allowed

```

Emerge --info:

```
92-252 adam # emerge --info

Portage 2.1.3.16 (default-linux/x86/2006.1, gcc-4.1.2, glibc-2.6.1-r0, 2.6.22-gentoo-r9 i686)

=================================================================

System uname: 2.6.22-gentoo-r9 i686 AMD Athlon(tm) XP 2600+

Timestamp of tree: Thu, 08 Nov 2007 06:30:01 +0000

ccache version 2.4 [enabled]

app-shells/bash:     3.2_p17

dev-java/java-config: 1.3.7, 2.0.33-r1

dev-lang/python:     2.4.4-r6

dev-python/pycrypto: 2.0.1-r6

dev-util/ccache:     2.4-r7

sys-apps/baselayout: 1.12.9-r2

sys-apps/sandbox:    1.2.18.1-r2

sys-devel/autoconf:  2.13, 2.61-r1

sys-devel/automake:  1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10

sys-devel/binutils:  2.18-r1

sys-devel/gcc-config: 1.3.16

sys-devel/libtool:   1.5.24

virtual/os-headers:  2.6.22-r2

ACCEPT_KEYWORDS="x86"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-march=athlon-xp -Os -pipe -fomit-frame-pointer -ftracer -ftree-vectorize"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"

CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/php/apache2-php4/ext-active/ /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php4/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php4/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/udev/rules.d"

CXXFLAGS="-march=athlon-xp -Os -pipe -fvisibility-inlines-hidden"

DISTDIR="/usr/portage/distfiles"

FEATURES="ccache distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch"

GENTOO_MIRRORS="http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ http://src.gentoo.pl http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ http://gentoo.zie.pg.gda.pl"

LANG="pl_PL"

LINGUAS="pl de fr ja en"

PKGDIR="/usr/portage/packages"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/portage/local/layman/xeffects"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="3dnow 3dnowext X a52 aac aalib accessibility acpi aiglx alsa anthy apache2 avahi avi berkdb beryl bitmap-fonts bzip2 cdparanoia cdr cjk cli clucene compiz cracklib crypt ctype cups dbus divx divx4linux dri dv dvd dvdr dvdread emerald enca encode evo fat fbcon ffmpeg firefox flac foomaticdb fortran ftp gadu gd gdbm gif gimp gimpprint glitz gmedia gnome gnutls gphoto2 gpm gpq gstreamer gtk gtk+ gtkhtml hal hardended hardened hddtemp hfs i8x0 iconv idea immqt ipv6 isdnlog jabber jack java jfs jpeg kqemu lame ldap live lm_sensors mad matroska mdnsresponder-compat midi mjpeg mmx mmxext mng mono moznopango moznoxft mozsvg mp3 mpeg mplayer mudflap mysql ncurses nls nptl nptlonly nptlony nsplugin ntfs ogg oggvorbis opengl openmp pam pcntl pcre pdf perl php png posix ppds pppd python quicktime readline real reflection reiser4 reiserfs samba sasl scanner sdk sdl session slang sndfile sockets spell spl sse ssl svg tcpd theora threadsafe tiff truetype truetype-fonts type1-fonts unicode usb v412 v4l vcd vidix vorbis win32codecs wmf wmp x264 x86 xcb xfs xft xine xml xorg xosd xv xvid zlib" ALSA_CARDS="emu10k1" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="mouse keyboard" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="pl de fr ja en" USERLAND="GNU" VIDEO_CARDS="radeon"

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LDFLAGS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

```

Czy powodem całego błędu mogą być flagi kompilacji?

----------

## SlashBeast

Może, sprawdz bez fvisibility-inlines-hidden.

----------

## Mr Adam

 *SlashBeast wrote:*   

> Może, sprawdz bez fvisibility-inlines-hidden.

 

niestety nic to nie dało, występuje identyczny błąd

----------

## Eeeyeore

i jeszcze bez -ftracer -ftree-vectorize , to szkodzi przy gcc-4.x.x

----------

## SlashBeast

Ja ostatnio robiłem emerge -e world z -ftracer i wszystko działa. Gcc 4.2.2.

----------

## Mr Adam

usunąłem wszystkie flagi i zostawiłem tylko te z -march i tor niby dalej nie działa ale problem wydaje się tkwić w czym innym.

```
gentoo log # /etc/init.d/tor start

 * Service tor starting

 * Tor configuration (/etc/tor/torrc) is valid.

 * Starting Tor ...                                                       [ !! ]

 * ERROR:  tor failed to start

```

w pliku /var/log/tor/tor.log jest tylko zapis sprzed miesiąca kiedy to jeszcze działał.. nie wiem gdzie znajduje się błąd..

----------

