Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Loading Eprog in other thread doesn't work



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




Messages sorted by: Reverse Date, Date, Thread, Author