zsh-workers
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <psprint@zdharma.org>
To: zsh-workers@zsh.org
Subject: Loading Eprog in other thread doesn't work
Date: Mon, 19 Jun 2017 16:37:49 +0200	[thread overview]
Message-ID: <etPan.5947e1be.54594545.63ea@zdharma.org> (raw)

Hello,
I do quite isolated thing:

    Eprog prog = pn->prog;
    execode(prog, 1, 0, "filecode");

pn (PrepareNode) is passed as (void*) to pthread_create. I use conditional variables to make "source_load" wait for background loading to finish.

But it looks like state of Zsh gets disrupted. Single run of source_prepare / source_load often works, the code is executed fine. However the longer I repeat this, the weirder things happen. Example backtraces at the end.

Does execode() expect some setup, and without it, it disrupts state? I've run Valgrind and get no memory errors. But the state can be disrupted logically? Is there alternative to run Eprog?

Full code:
https://github.com/zdharma/zplugin/blob/master/zmodules/Src/zdharma/zplugin.c

--  
Sebastian Gniazdowski
psprint /at/ zdharma.org



* thread #1: joinlists(first=0x000000010ecf0ef0, second=0x000000010ecf0e80) + 68 at linklist.c:366, stop reason = signal SIGSTOP
  * frame #0: joinlists(first=0x000000010ecf0ef0, second=0x000000010ecf0e80) + 68 at linklist.c:366
    frame #1: execcmd_exec(state=0x00007fff512539b0, eparams=0x00007fff51252b50, input=0, output=0, how=18, last1=2) + 4270 at exec.c:3028


* thread #1: libsystem_platform.dylib`_platform_strcmp + 19, stop reason = signal SIGSTOP
  * frame #0: libsystem_platform.dylib`_platform_strcmp + 19
    frame #1: execcmd_exec(state=0x00007fff5168f9b0, eparams=0x00007fff5168eb50, input=0, output=0, how=18, last1=2) + 6790 at exec.c:3189


* thread #1: countlinknodes(list=0x000000010e2b7f18) + 46 at linklist.c:309, stop reason = signal SIGSTOP
  * frame #0: countlinknodes(list=0x000000010e2b7f18) + 46 at linklist.c:309
    frame #1: execbuiltin(args=0x000000010e2b7f18, assigns=0x0000000000000000, bn=0x000000010e387220) + 239 at builtin.c:274



             reply	other threads:[~2017-06-19 14:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-19 14:37 Sebastian Gniazdowski [this message]
2017-06-19 20:12 ` Bart Schaefer
2017-06-20  4:37   ` Sebastian Gniazdowski
2017-06-20  6:02     ` Bart Schaefer
     [not found] ` <etPan.59483072.5b1b299a.63ea@AirmailxGenerated.am>
2017-06-20  2:42   ` Sebastian Gniazdowski
2017-06-20  5:59     ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=etPan.5947e1be.54594545.63ea@zdharma.org \
    --to=psprint@zdharma.org \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).