zsh-workers
 help / color / mirror / code / Atom feed
* Loading Eprog in other thread doesn't work
@ 2017-06-19 14:37 Sebastian Gniazdowski
  2017-06-19 20:12 ` Bart Schaefer
       [not found] ` <etPan.59483072.5b1b299a.63ea@AirmailxGenerated.am>
  0 siblings, 2 replies; 6+ messages in thread
From: Sebastian Gniazdowski @ 2017-06-19 14:37 UTC (permalink / raw)
  To: zsh-workers

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



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-06-20  6:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-19 14:37 Loading Eprog in other thread doesn't work Sebastian Gniazdowski
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

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).