Hello,
since some time LuaTeX os.execute() crashes with segmentation fault:
% luatex -ini
\catcode`\{=1
\catcode`\}=2
\directlua{os.execute()}
\csname @@end\endcsname\end
Results of beta-0.66.0 (rev 4141):
Program received signal SIGSEGV, Segmentation fault.
0x400ce243 in strlen () from /lib/i686/libc.so.6
#0 0x400ce243 in strlen () from /lib/i686/libc.so.6
#1 0x0809059b in shell_cmd_is_allowed (cmd=0xbfffed70, safecmd=0xbfffed74,
cmdname=0xbfffed78) at ../../../source/texk/web2c/luatexdir/luatex.c:224
#2 0x080f0a1a in os_execute (L=0x876c0a0)
at ../../../source/texk/web2c/luatexdir/lua/loslibext.c:986
#3 0x082194e1 in luaD_precall (L=0x876c0a0, func=0x0, nresults=0)
at ../../../source/texk/web2c/luatexdir/lua51/ldo.c:319
#4 0x0822758f in luaV_execute (L=0x876c0a0, nexeccalls=1)
at ../../../source/texk/web2c/luatexdir/lua51/lvm.c:587
#5 0x08219780 in luaD_call (L=0x876c0a0, func=0x87a09d4, nResults=0)
at ../../../source/texk/web2c/luatexdir/lua51/ldo.c:377
#6 0x082137e9 in f_call (L=0x876c0a0, ud=0x0)
at ../../../source/texk/web2c/luatexdir/lua51/lapi.c:795
#7 0x08218d5f in luaD_rawrunprotected (L=0x876c0a0, f=0x82137d0
On 14-4-2011 7:30, Heiko Oberdiek wrote:
Hello,
since some time LuaTeX os.execute() crashes with segmentation fault:
% luatex -ini \catcode`\{=1 \catcode`\}=2 \directlua{os.execute()} \csname @@end\endcsname\end
Results of beta-0.66.0 (rev 4141):
Program received signal SIGSEGV, Segmentation fault. 0x400ce243 in strlen () from /lib/i686/libc.so.6
#0 0x400ce243 in strlen () from /lib/i686/libc.so.6 #1 0x0809059b in shell_cmd_is_allowed (cmd=0xbfffed70, safecmd=0xbfffed74, cmdname=0xbfffed78) at ../../../source/texk/web2c/luatexdir/luatex.c:224 #2 0x080f0a1a in os_execute (L=0x876c0a0) at ../../../source/texk/web2c/luatexdir/lua/loslibext.c:986 #3 0x082194e1 in luaD_precall (L=0x876c0a0, func=0x0, nresults=0) at ../../../source/texk/web2c/luatexdir/lua51/ldo.c:319 #4 0x0822758f in luaV_execute (L=0x876c0a0, nexeccalls=1) at ../../../source/texk/web2c/luatexdir/lua51/lvm.c:587 #5 0x08219780 in luaD_call (L=0x876c0a0, func=0x87a09d4, nResults=0) at ../../../source/texk/web2c/luatexdir/lua51/ldo.c:377 #6 0x082137e9 in f_call (L=0x876c0a0, ud=0x0) at ../../../source/texk/web2c/luatexdir/lua51/lapi.c:795 #7 0x08218d5f in luaD_rawrunprotected (L=0x876c0a0, f=0x82137d0
, ud=0xbffff010) at ../../../source/texk/web2c/luatexdir/lua51/ldo.c:121 #8 0x08219a2c in luaD_pcall (L=0x876c0a0, func=0x82137d0 , u=0xbffff010, old_top=142000288, ef=0) at ../../../source/texk/web2c/luatexdir/lua51/ldo.c:457 #9 0x08213838 in lua_pcall (L=0x876c0a0, nargs=0, nresults=0, errfunc=0) at ../../../source/texk/web2c/luatexdir/lua51/lapi.c:816 #10 0x08099dea in luatokencall (p=8, nameptr=24) at luastuff.w:457 #11 0x080d1301 in conv_toks () at textoken.w:1899 #12 0x080a67f5 in expand () at expand.w:230 #13 0x080a6e25 in get_x_token () at expand.w:391 #14 0x08132d35 in main_control () at maincontrol.w:892 #15 0x080c310f in main_body () at mainbody.w:469 #16 0x080908dc in main (ac=3, av=0xbffff1a4) at ../../../source/texk/web2c/luatexdir/luatex.c:461 0.60.2 (rev 3736) (TL 2010): segmentation fault
0.40.6 works.
Can you check 0.66 ? ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hi Hans, On Thu, Apr 14, 2011 at 09:17:08PM +0200, Hans Hagen wrote:
On 14-4-2011 7:30, Heiko Oberdiek wrote:
since some time LuaTeX os.execute() crashes with segmentation fault:
% luatex -ini \catcode`\{=1 \catcode`\}=2 \directlua{os.execute()} \csname @@end\endcsname\end
Results of beta-0.66.0 (rev 4141):
Program received signal SIGSEGV, Segmentation fault. 0x400ce243 in strlen () from /lib/i686/libc.so.6
[...]
0.60.2 (rev 3736) (TL 2010): segmentation fault
0.40.6 works.
Can you check 0.66 ?
See above: 0.66.0, rev 4141. System: i386-linux Also the report was triggered by a user bug-report: | I am using OSX 10.6.7. The crash occurs for me with lualatex 0.65/0.66 Yours sincerely Heiko Oberdiek
On 14-4-2011 9:59, Heiko Oberdiek wrote:
0.60.2 (rev 3736) (TL 2010): segmentation fault
0.40.6 works.
Can you check 0.66 ?
See above: 0.66.0, rev 4141. System: i386-linux
Also the report was triggered by a user bug-report: | I am using OSX 10.6.7. The crash occurs for me with lualatex 0.65/0.66
ah, ok, i see. i assume that it's the lack of an argument to os.execute then? fyi: on windows rev 4155 does not crash Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
2011/4/14 Hans Hagen
ah, ok, i see. i assume that it's the lack of an argument to os.execute then? fyi: on windows rev 4155 does not crash
Quite possible. ----------- (./ms_pdftools-abstract.aux) (/opt/tex/texlive/2010/texmf-dist/tex/context/base/supp-pdf.mkii [Loading MPS to PDF converter (version 2006.09.02).] ) Program received signal SIGSEGV, Segmentation fault. 0x00007ffff769f6a2 in strlen () from /lib64/libc.so.6 (gdb) bt #0 0x00007ffff769f6a2 in strlen () from /lib64/libc.so.6 #1 0x000000000046140b in shell_cmd_is_allowed (cmd=0x7fffffffd778, safecmd=0x7fffffffd788, cmdname=0x7fffffffd780) at ../../../source/texk/web2c/luatexdir/luatex.c:224 ----------- Best Martin
On Thu, Apr 14, 2011 at 10:11:59PM +0200, Hans Hagen wrote:
On 14-4-2011 9:59, Heiko Oberdiek wrote:
0.60.2 (rev 3736) (TL 2010): segmentation fault
0.40.6 works.
Can you check 0.66 ?
See above: 0.66.0, rev 4141. System: i386-linux
Also the report was triggered by a user bug-report: | I am using OSX 10.6.7. The crash occurs for me with lualatex 0.65/0.66
ah, ok, i see. i assume that it's the lack of an argument to os.execute then? fyi: on windows rev 4155 does not crash
No crash for -shell-escape. Restricted and no shell escape crash.
From the Lua manual 5.1:
| os.execute ([command]) | | This function is equivalent to the C function system. It passes | command to be executed by an operating system shell. It returns | a status code, which is system-dependent. If command is absent, | then it returns nonzero if a shell is available and zero otherwise. An empty string does not crash. But it does not help, because I want to use the variant without argument. Yours sincerely Heiko Oberdiek
On 04/14/2011 07:30 PM, Heiko Oberdiek wrote:
Hello,
since some time LuaTeX os.execute() crashes with segmentation fault:
% luatex -ini \catcode`\{=1 \catcode`\}=2 \directlua{os.execute()} \csname @@end\endcsname\end
Results of beta-0.66.0 (rev 4141):
Program received signal SIGSEGV, Segmentation fault.
Fixed in branches/0.70.x (for the 0.70.x release && texlive 2011). Best wishes, Taco
On Sat, Apr 16, 2011 at 11:34:28AM +0200, Taco Hoekwater wrote:
On 04/14/2011 07:30 PM, Heiko Oberdiek wrote:
Hello,
since some time LuaTeX os.execute() crashes with segmentation fault:
% luatex -ini \catcode`\{=1 \catcode`\}=2 \directlua{os.execute()} \csname @@end\endcsname\end
Results of beta-0.66.0 (rev 4141):
Program received signal SIGSEGV, Segmentation fault.
Fixed in branches/0.70.x (for the 0.70.x release && texlive 2011).
Many thanks. Looking at the diff: 977 if (cmd == NULL) { /* pretend we are \.{\\pdfshellescape} */ 978 if (shellenabledp <= 0) { 979 lua_pushinteger(L, 0); 980 } else if (restrictedshell == 0) { 981 lua_pushinteger(L, 1); 982 } else { 983 lua_pushinteger(L, 2); 984 } 985 return 1; 986 } Even better that the difference between restricted and unrestricted is available. Thus, is the following logic (pseudocode) is correct for getting the value of \pdfshellescape? if luatexversion >= 70 if os.execute return os.execute() else return 0 fi else if luatexversion > 40 % do you know accidently the correct value? pehaps_warn(Update luatex) return 0 else if os.execute if os.execute() > 0 return 1 else return 0 fi else return 0 fi fi fi Yours sincerely Heiko Oberdiek
On 16-4-2011 11:53, Heiko Oberdiek wrote:
if luatexversion>= 70 if os.execute return os.execute() else return 0 fi
to me using the result of os.execute() i.e. with empty argument for a test looks like a hack and is rather undefined as test Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Sat, Apr 16, 2011 at 11:55:49AM +0200, Hans Hagen wrote:
On 16-4-2011 11:53, Heiko Oberdiek wrote:
if luatexversion>= 70 if os.execute return os.execute() else return 0 fi
to me using the result of os.execute() i.e. with empty argument for a test looks like a hack and is rather undefined as test
I would appreciate a better solution, of course. The manual tells something about "texconfig" and "texconfig.shell_escape" and that a startup script could fill it. But it's not done by "luatex -ini" or "lualatex", thus it's an empty table. Yours sincerely Heiko Oberdiek
On 04/16/2011 11:53 AM, Heiko Oberdiek wrote:
Thus, is the following logic (pseudocode) is correct for getting the value of \pdfshellescape?
Yes
if luatexversion> 40 % do you know accidently the correct value?
No idea, really. From the source tree, it looks like 0.40.6 should have crashed as well. Best wishes, Taco
participants (4)
-
Hans Hagen
-
Heiko Oberdiek
-
Martin Schröder
-
Taco Hoekwater