sqUnixSocket.c - crashing the vm on android

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

sqUnixSocket.c - crashing the vm on android

Stefan Krecher
 
Hi,
i guess i have a general lack of understanding, regarding how the
socket-implementation in sqUnixSocket.c works, maybe someone can give
me some hints/ tipps?

Here's what i did: i compiled (with the android-ndk) the squeakvm (the
android-version) with Sockets. Sockets in general seem to work (e.g.
initializeNetwork, resolve a name etc works).
But: when i do the following in the android emulator:
| listener |
listener := Socket newTCP.
listener listenOn: 12345 backlogSize: 4.

and then try to connect to that socket via telnet - the vm crashes immediatly!

Made some debug-output in the sqUnixSocket.c, the initialization of
the listening socket seems to work correct.
The Problem is, that i have no clue what happens in the moment, when a
client tries to connect to that socket. I assumed that the program
flow might reach the "static void acceptHandler(int fd, void *data,
int flags)" - but it never get's there.
Have no idea where to debug or to put more debug-output to find out,
what causes the crash.
Maybe someone here to enlight me?

regards,
Stefan

P.S.: did i mention, that i'm completly new to vm-hacking?
Reply | Threaded
Open this post in threaded view
|

Re: sqUnixSocket.c - crashing the vm on android

Stefan Krecher

solved that crashing-problem:
aioInit() was never called, so the handler for SIGIO was not
installed. Listening on a server socket worked, but if the kernel sent
SIGIO to signal an incoming connection and available data for reading,
the vm crashed.
But VNC is still not working - need more debugging (which means:
putting more debug-output all over the code).
regards,
Stefan

2010/3/22 Stefan Krecher <[hidden email]>:

> Hi,
> i guess i have a general lack of understanding, regarding how the
> socket-implementation in sqUnixSocket.c works, maybe someone can give
> me some hints/ tipps?
>
> Here's what i did: i compiled (with the android-ndk) the squeakvm (the
> android-version) with Sockets. Sockets in general seem to work (e.g.
> initializeNetwork, resolve a name etc works).
> But: when i do the following in the android emulator:
> | listener |
> listener := Socket newTCP.
> listener listenOn: 12345 backlogSize: 4.
>
> and then try to connect to that socket via telnet - the vm crashes immediatly!
>
> Made some debug-output in the sqUnixSocket.c, the initialization of
> the listening socket seems to work correct.
> The Problem is, that i have no clue what happens in the moment, when a
> client tries to connect to that socket. I assumed that the program
> flow might reach the "static void acceptHandler(int fd, void *data,
> int flags)" - but it never get's there.
> Have no idea where to debug or to put more debug-output to find out,
> what causes the crash.
> Maybe someone here to enlight me?
>
> regards,
> Stefan
>
> P.S.: did i mention, that i'm completly new to vm-hacking?
>



--
Dipl.-Wirtsch.-Inf. Stefan Krecher
Neulander Str. 17, 27374 Visselhövede
Tel +49(0)4262 958848
mobil +49(0)172 3608616
http://krecher.com