Opened 14 years ago

Last modified 7 years ago

#126 closed defect (Fixed)

MacOS X 10.4 incompatibility Tor v0.1.0.4-rc

Reported by: jamespark Owned by:
Priority: Low Milestone:
Component: Core Tor/Tor Version:
Severity: Keywords:
Cc: jamespark, jtamboli, timbrophy Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Tried v0.1.0.3-rc and then v0.1.0.4-rc when it was released.

Apr 25 10:11:11.711 [notice] tor_init(): Tor v0.1.0.4-rc. This is experimental software. Do not rely on it for strong anonymity.
Apr 25 10:11:11.719 [notice] options_act(): Initialized libevent version 1.0d using method kqueue
Apr 25 10:11:33.988 [warn] Warning from libevent: kevent: Bad file descriptor
Apr 25 10:11:33.991 [err] do_main_loop(): libevent poll with kqueue failed: Bad file descriptor [9]

Sometimes it looks like it starts to work and then breaks when I try to visit a page like http://www.yahoo.com/.

Apr 25 10:17:13.519 [notice] tor_init(): Tor v0.1.0.4-rc. This is experimental software. Do not rely on it for strong anonymity.
Apr 25 10:17:13.528 [notice] options_act(): Initialized libevent version 1.0d using method kqueue
Apr 25 10:17:27.481 [notice] circuit_send_next_onion_skin(): Tor has successfully opened a circuit. Looks like it's working.
Apr 25 10:18:44.327 [warn] Warning from libevent: kevent: Bad file descriptor
Apr 25 10:18:44.329 [err] do_main_loop(): libevent poll with kqueue failed: Bad file descriptor [9]

[Automatically added by flyspray2trac: Operating System: OSX 10.4 Tiger]

Child Tickets

Change History (14)

comment:1 Changed 14 years ago by nickm

This could be a weird bug or a nasty bug. (These are *very* technical terms, I know. :) )

Anyway, could you try to compile and run this code, and see what it says? (I'm interested to
see if Tiger treats this case differently from Panther.
<pre>

#include &lt;stdio.h&gt;
#include &lt;sys/queue.h&gt;
#include &lt;sys/event.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;errno.h&gt;
#include &lt;time.h&gt;
int main(int c, char v) {

int kq = kqueue();
struct kevent changes[10];
struct kevent events[10];
struct timespec timeout;
int r;
memset(&timeout, 0, sizeof(timeout));
memset(changes, 0, sizeof(changes));
memset(events, 0, sizeof(events));
changes[0].ident=100;
changes[0].filter = EVFILT_READ;
changes[0].flags = EV_ADD;
errno = 0;
r = kevent(kq, changes, 1, events, 10, &timeout);
printf("%d [%d]\n",r,errno);
return 0;

}

</pre>

If it says "-1 [9]", something is wrong with Tor.

If it says "1 [0]", something is wrong with libevent, or with the way we're using libevent.

comment:2 Changed 14 years ago by nickm

BTW, does anybody know whether this happens on 10.3.x too?

Does Tor work for anybody on 10.4?

comment:3 Changed 14 years ago by jamespark

After adding a #include <string.h>, I was able to compile and run the script...

[09:57 AM] :~/tortest% ./a.out
-1 [9]n[09:57 AM] :~/tortest%

on 10.3.9 tor v0.1.0.3-rc worked fine for me.

comment:4 Changed 14 years ago by jtamboli

On 10.4, I get "-1 [9]"

comment:5 Changed 14 years ago by nickm

BTW, as a temporary workaround, set EVENT_NOKQUEUE to 1 before starting Tor.

comment:6 Changed 14 years ago by timbrophy

I am unable to use TOR on 10.4 either. I do not understand the temporary workaround. Please excuse my ignorance.

comment:7 Changed 14 years ago by sschaubach

what he means is, type: export EVENT_NOKQUEUE=yes

then run tor

hope that helps

Best,

Stephen

comment:8 Changed 14 years ago by timbrophy

Compiling the code gives

cc testtor.c -o testtor
testtor.c:1: error: parse error before '<' token
In file included from testtor.c:3:
/usr/include/sys/event.h:68: error: parse error before "flags"
/usr/include/sys/event.h:69: error: parse error before "fflags"
/usr/include/sys/event.h:70: error: parse error before "data"
/usr/include/sys/event.h:72: error: parse error before '}' token
testtor.c: In function `main':
testtor.c:9: error: storage size of `changes' isn't known
testtor.c:10: error: storage size of `events' isn't known
make: * [testtor] Error 1

comment:9 Changed 14 years ago by timbrophy

Sorry, As you can see I am not used to this. Here is the message I got after I compiled the code properly (I hope!)
cc tortest.c -o tortest

comment:10 Changed 14 years ago by timbrophy

When I try yje workaround and try to launch Tor the following message appears:

[G4:~] tim% /Library/Tor/tor; exit
May 09 20:25:26.569 [notice] tor_init(): Tor v0.1.0.5-rc. This is experimental software. Do not rely on it for strong anonymity.
May 09 20:25:26.594 [notice] options_act(): Initialized libevent version 1.0e using method kqueue
May 09 20:25:26.602 [warn] connection_create_listener(): Could not bind to port 9050: Address already in use
May 09 20:25:26.603 [err] options_act(): Failed to bind one of the listener ports.
May 09 20:25:26.603 [err] init_from_config(): Acting on config options left us in a broken state. Dying.
logout
[Process completed]

comment:11 Changed 14 years ago by jtamboli

Tim: that error looks like Tor is already running. Are you sure you didn't already launch it once with the workaround?

Generally: perhaps a better implementation of the workaround is to edit /Library/StartupItems/Tor/Tor and place "export EVENT_NOKQUEUE=1" just before the setting of TORLOC.

comment:12 Changed 14 years ago by timbrophy

Thanks, Jay. That worked perfectly. My Browser is now fine but I cannot get Acquisition to work with Tor. Any ideas?

comment:13 Changed 14 years ago by arma

flyspray2trac: bug closed.
Yes, this is a bug in OS X 10.4.0. Tor 0.1.0.6-rc will include a fix that disables kqueue if it's broken like this. (Actually, libevent 1.0f will have this fix, and our Tor OS X package will include it.)

comment:14 Changed 7 years ago by nickm

Component: Tor ClientTor
Note: See TracTickets for help on using tickets.