[maemo-developers] [maemo-developers] osso_socket doesn't work under scratchbox

From: Vladislav Vasiliev vlad at gas.by
Date: Sun Aug 27 19:35:14 EEST 2006
I already posted message about this issue some time ago:
http://maemo.org/pipermail/maemo-developers/2006-July/004752.html
Unfortunately I didn't get any answers on that post.
This time I'm trying to provide more details:

My environment: Maemo 2.0 i386 rootstrap, af-sb-init.sh started.
I'm using /usr/share/doc/osso-ic-dev/examples/osso-socket.c example.
Compile it:
gcc osso-socket.c -o osso-socket `pkg-config --cflags --libs osso-ic
glib-2.0`   -DDBUS_API_SUBJECT_TO_CHANGE
and run:
run-standalone.sh ./osso-socket 192.168.1.1 80
So, this is the output I get:
socket error: No route to host
Tracking osso_socket(2=PF_INET, 1=SOCK_STREAM, 6=tcp) = 3

And it fails. Here is the strace output:
...
socket(PF_FILE, SOCK_STREAM, 0) = 4
connect(4, {sa_family=AF_FILE, path="/var/run/dbus/system_bus_socket"},
33) = 0
fcntl64(4, F_GETFL) = 0x2 (flags O_RDWR)
fcntl64(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0
fcntl64(4, F_GETFD) = 0
fcntl64(4, F_SETFD, FD_CLOEXEC) = 0
getuid32() = 1005
rt_sigaction(SIGPIPE, {SIG_IGN}, {SIG_DFL}, 8) = 0
poll([{fd=4, events=POLLOUT, revents=POLLOUT}], 1, 0) = 1
write(4, "\0", 1) = 1
write(4, "AUTH EXTERNAL 31303035\r\n", 24) = 24
poll([{fd=4, events=POLLIN, revents=POLLIN}], 1, -1) = 1
read(4, "OK 0c04cf4489534661909bda102f106"..., 2048) = 37
poll([{fd=4, events=POLLOUT, revents=POLLOUT}], 1, -1) = 1
write(4, "BEGIN\r\n", 7) = 7
poll([{fd=4, events=POLLIN|POLLOUT, revents=POLLOUT}], 1, -1) = 1
writev(4, [{"l\1\0\1\0\0\0\0\1\0\0\0n\0\0\0\1\1o\0\25\0\0\0/org/fre"...,
128}, {"", 0}], 2) = 128
gettimeofday({1154418264, 195942}, NULL) = 0
poll([{fd=4, events=POLLIN, revents=POLLIN}], 1, 25000) = 1
read(4, "l\2\1\1\t\0\0\0\1\0\0\0=\0\0\0\6\1s\0\4\0\0\0:1.6\0\0\0"...,
2048) = 258
read(4, 0x804ef40, 2048) = -1 EAGAIN (Resource temporarily unavailable)
writev(4, [{"l\1\1\1B\0\0\0\2\0\0\0\177\0\0\0\1\1o\0\25\0\0\0/org/f"...,
144}, {"=\0\0\0type=\'signal\',interface=\'com"..., 66}], 2) = 210
writev(4, [{"l\1\0\1\24\0\0\0\3\0\0\0a\0\0\0\1\1o\0\16\0\0\0/com/no"...,
120}, {"\5\0\0\0[ANY]\0\0\0\0\0\0\0u2\0\0", 20}], 2) = 140
gettimeofday({1154418264, 196731}, NULL) = 0
poll([{fd=4, events=POLLIN, revents=POLLIN}], 1, 180000) = 1
read(4, "l\2\1\1\0\0\0\0\3\0\0\0005\0\0\0\6\1s\0\4\0\0\0:1.6\0\0"...,
2048) = 72
read(4, 0x804ef40, 2048) = -1 EAGAIN (Resource temporarily unavailable)
gettimeofday({1154418264, 196990}, NULL) = 0
poll([{fd=4, events=POLLIN, revents=POLLIN}], 1, 180000) = 1
read(4, "l\3\1\1B\0\0\0\4\0\0\0u\0\0\0\6\1s\0\4\0\0\0:1.6\0\0\0"...,
2048) = 202
read(4, 0x804ef40, 2048) = -1 EAGAIN (Resource temporarily unavailable)
close(3) = 0
dup(2) = 3
fcntl64(3, F_GETFL) = 0x8002 (flags O_RDWR|O_LARGEFILE)
fstat64(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0xb7c9d000
_llseek(3, 0, 0xbfa91408, SEEK_CUR) = -1 ESPIPE (Illegal seek)
write(3, "socket error: No route to host\n", 31socket error: No route to
host
) = 31
close(3) = 0
munmap(0xb7c9d000, 4096) = 0
munmap(0xb7c9e000, 4096) = 0
exit_group(1) = ?

But it works without any problem on the device.

Does anybody experience similar issues?

I'm just wondering if it's possible at all to run/debug connectivity
applications under scratchbox.
If it isn't it should be mentioned somewhere in the maemo documentation,
I believe.

Vlad Vasiliev

More information about the maemo-developers mailing list