Porting to Maemo

24 views
Skip to first unread message

philip

unread,
May 5, 2009, 5:46:50 AM5/5/09
to WvStreams Mailing List, cb...@astri.org
Hi,

I am currently trying to port wvstreams and wvdial to Maemo Linux
operating system.

I got this run time error when running it with a 3G modem. It occurs
before launching PPP daemon to connect with 3G server. Can anyone tell
me the purpose of WvTaskMan class and getcontext function?

wvdial: utils/wvtask.cc:199 WvTaskMan::WvTaskMan(): Assertion
`getcontext(&get_stack_return) == 0' failed.

Thanks in advance.

Regards,
Phi

Joe Mason

unread,
May 5, 2009, 10:09:53 AM5/5/09
to wvstrea...@googlegroups.com, cb...@astri.org

WvTask is a cooperative threading system, which uses getcontext and
setcontext to save and restore the state of each thread when switching
tasks. getcontext is a standard library function - "man getcontext"
should explain how it works.

Try running wvstreams through "strace" so you can see the actual error
code returned by getcontext.

Joe

philip

unread,
May 6, 2009, 12:20:17 AM5/6/09
to WvStreams Mailing List
Hi all, is there any workaround for getcontext on ARM platform?

Hi Joe Mason,

Thanks. I have followed your suggestion to use strace. If I got the
following output from strace, do you find any hints which will create
the run-time error I mentioned?

>> wvdial: utils/wvtask.cc:199 WvTaskMan::WvTaskMan(): Assertion `getcontext(&get_stack_return) == 0' failed.

And do you think the problem line is the following line? I am making
such a guess because makedev might be needed to create a new thread?

fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0

Regards,
Philip


On May 5, 10:09 pm, Joe Mason <j...@notcharles.ca> wrote:

Avery Pennarun

unread,
May 6, 2009, 12:39:18 PM5/6/09
to wvstrea...@googlegroups.com
Hi Philip,

> Hi all, is there any workaround for getcontext on ARM platform?

I didn't think we would *need* to workaround it on the ARM. There's
no reason (that I know of) that getcontext wouldn't "just work."

If we send you a patch, can you try applying it and see what happens?

Can you try using the 'revert-wvtask' branch of wvstreams from
git://github.com/apenwarr/wvstreams.git and see if that works any
better?

> And do you think the problem line is the following line? I am making
> such a guess because makedev might be needed to create a new thread?
>
> fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0

The "= 0" at the end means the fstat was successful. And makedev() in
this case just means "the device object make from major=136, minor=0".

Unfortunately getcontext is not a kernel system call so the advice to
run strace won't actually help much. But please try my above-linked
git version of wvstreams and let me know if that helps.

Thanks,

Avery

philip

unread,
May 12, 2009, 10:25:22 PM5/12/09
to WvStreams Mailing List
Thanks Avery and Joe. I solved this problem by applying Avery's patch.
The link is purposely re-cap below for complete information for
everyone.

http://groups.google.com/group/wvstreams-devel/browse_thread/thread/b9e2ace1997ddc84?fwc=1#

Regards,
Philip

Avery Pennarun

unread,
May 13, 2009, 2:46:31 PM5/13/09
to wvstrea...@googlegroups.com
On Tue, May 12, 2009 at 10:25 PM, philip <phili...@gmail.com> wrote:
> Thanks Avery and Joe. I solved this problem by applying Avery's patch.
> The link is purposely re-cap below for complete information for
> everyone.
>
> http://groups.google.com/group/wvstreams-devel/browse_thread/thread/b9e2ace1997ddc84?fwc=1#

Hi Philip,

Thanks for confirming back. That's a really long thread, and I
*think* the important changes discussed there were included in the
revert-wvtask branch in git. Did you try out that branch to see if it
works without any changes?

Even if you don't use git, you can download a tarball of that version
by clicking the 'download' button at this link:
http://github.com/apenwarr/wvstreams/commits/revert-wvtask

Please let me know if that branch works for you.

Have fun,

Avery

Reply all
Reply to author
Forward
0 new messages