From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16905 invoked by alias); 19 Jun 2017 14:38:00 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 41320 Received: (qmail 11729 invoked from network); 19 Jun 2017 14:38:00 -0000 X-Qmail-Scanner-Diagnostics: from aok120.rev.netart.pl by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(85.128.245.120):SA:0(0.0/5.0):. Processed in 1.584509 secs); 19 Jun 2017 14:38:00 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: psprint@zdharma.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at zdharma.org does not designate permitted sender hosts) X-Virus-Scanned: by amavisd-new using ClamAV (10) Date: Mon, 19 Jun 2017 16:37:49 +0200 From: Sebastian Gniazdowski To: zsh-workers@zsh.org Message-ID: Subject: Loading Eprog in other thread doesn't work X-Mailer: Airmail (442) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hello, I do quite isolated thing: =C2=A0 =C2=A0 Eprog prog =3D pn->prog; =C2=A0 =C2=A0 execode(prog, 1, 0, =22filecode=22); pn (PrepareNode) is passed as (void*) to pthread=5Fcreate. I use conditio= nal variables to make =22source=5Fload=22 wait for background loading to = finish. But it looks like state of Zsh gets disrupted. Single run of source=5Fpre= pare / source=5Fload often works, the code is executed fine. However the = longer I repeat this, the weirder things happen. Example backtraces at th= e end. Does execode() expect some setup, and without it, it disrupts state=3F I'= ve run Valgrind and get no memory errors. But the state can be disrupted = logically=3F Is there alternative to run Eprog=3F =46ull code: https://github.com/zdharma/zplugin/blob/master/zmodules/Src/zdharma/zplug= in.c -- =20 Sebastian Gniazdowski psprint /at/ zdharma.org * thread =231: joinlists(first=3D0x000000010ecf0ef0, second=3D0x000000010= ecf0e80) + 68 at linklist.c:366, stop reason =3D signal SIGSTOP =C2=A0 * frame =230: joinlists(first=3D0x000000010ecf0ef0, second=3D0x000= 000010ecf0e80) + 68 at linklist.c:366 =C2=A0 =C2=A0 frame =231: execcmd=5Fexec(state=3D0x00007fff512539b0, epar= ams=3D0x00007fff51252b50, input=3D0, output=3D0, how=3D18, last1=3D2) + 4= 270 at exec.c:3028 * thread =231: libsystem=5Fplatform.dylib=60=5Fplatform=5Fstrcmp + 19, st= op reason =3D signal SIGSTOP =C2=A0 * frame =230: libsystem=5Fplatform.dylib=60=5Fplatform=5Fstrcmp + = 19 =C2=A0 =C2=A0 frame =231: execcmd=5Fexec(state=3D0x00007fff5168f9b0, epar= ams=3D0x00007fff5168eb50, input=3D0, output=3D0, how=3D18, last1=3D2) + 6= 790 at exec.c:3189 * thread =231: countlinknodes(list=3D0x000000010e2b7f18) + 46 at linklist= .c:309, stop reason =3D signal SIGSTOP =C2=A0 * frame =230: countlinknodes(list=3D0x000000010e2b7f18) + 46 at li= nklist.c:309 =C2=A0 =C2=A0 frame =231: execbuiltin(args=3D0x000000010e2b7f18, assigns=3D= 0x0000000000000000, bn=3D0x000000010e387220) + 239 at builtin.c:274