[Gluster-devel] swapcontest usage in syncio.c

Emmanuel Dreyfus manu at netbsd.org
Tue Aug 7 12:44:02 UTC 2012

On Tue, Aug 07, 2012 at 03:01:56AM -0700, Anand Avati wrote:
> I cannot find a code path where synctask_get() happens without a
> synctask_set() happening in the same thread. Did you manage to find one?

Here is the kind of trace I can get in rebalance.log, after the first
synctask_new invocation (self is pthread_self() return value).

[syncop.c:216:synctask_new] 0-: self = 0xb8000000, newtask = 0xb7f02400
[syncop.c:291:synctask_switchto] 0-: self = 0xb9e00000, synctask_set(0xb7f02400)
[syncop.c:120:synctask_wrap] 0-: self = 0xb8000000, synctask_get() = 0x0, old_task = 0xb7f02400

And here of course it crashe, the reason is obvious. I can work it around 
by using old_task for the tésk in :synctask_wrap(), but I get other nasty
crashes around swapcontext(), which suggests the work around does not fix
the root cause.

By the way, why use swapcontext()? There was no simplier way of doing it?

Emmanuel Dreyfus
manu at netbsd.org

More information about the Gluster-devel mailing list