From owner-freebsd-ports-bugs@FreeBSD.ORG Sat Jun 7 13:32:57 2014 Return-Path: Delivered-To: freebsd-ports-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0F7AAB8 for ; Sat, 7 Jun 2014 13:32:56 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D80FF2E5C for ; Sat, 7 Jun 2014 13:32:56 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.8/8.14.8) with ESMTP id s57DWuQJ097252 for ; Sat, 7 Jun 2014 14:32:56 +0100 (BST) (envelope-from bz-noreply@freebsd.org) From: bz-noreply@freebsd.org To: freebsd-ports-bugs@FreeBSD.org Subject: [Bug 190751] New: [PATCH] devel/lua-alien: mark as SSP_UNSAFE Date: Sat, 07 Jun 2014 13:32:56 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports Tree X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: sjyj+wok@sharklasers.com X-Bugzilla-Status: Needs Triage X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-ports-bugs@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jun 2014 13:32:57 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=190751 Bug ID: 190751 Summary: [PATCH] devel/lua-alien: mark as SSP_UNSAFE Product: Ports Tree Version: Latest Hardware: Any OS: Any Status: Needs Triage Severity: Affects Only Me Priority: --- Component: Individual Port(s) Assignee: freebsd-ports-bugs@FreeBSD.org Reporter: sjyj+wok@sharklasers.com Created attachment 143489 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=143489&action=edit fix Lua interpreter aborts with exit code 1 shortly after the first foreign function if using alien built with Clang. The following snippet successfully calls sleep(3) but aborts shortly after: require 'alien' local libc = alien.default libc.sleep:types('int', 'int') print "foo" libc.sleep(3) print "bar" With clang -O0 a crash can be seen instead: (gdb) r Starting program: /usr/local/bin/lua52 test.lua [New LWP 101132] [New Thread 801c06400 (LWP 101132)] foo Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 801c06400 (LWP 101132)] 0x0000000000407421 in lua_pushnumber (L=0x800000000, n=0) at lapi.c:475 475 setnvalue(L->top, n); (gdb) bt #0 0x0000000000407421 in lua_pushnumber (L=0x800000000, n=0) at lapi.c:475 #1 0x00000008014e84aa in ?? () from /usr/local/lib/lua/5.2/alien_c.so #2 0x000000000040bf66 in luaD_precall (L=0x801c17300, func=0x801c8d570, nresults=0) at ldo.c:319 #3 0x000000000040c1d0 in luaD_precall (L=0x801c17300, func=0x801c8d570, nresults=0) at ldo.c:356 #4 0x000000000041f64f in luaV_execute (L=0x801c17300) at lvm.c:709 #5 0x000000000040c779 in luaD_call (L=0x801c17300, func=0x801c200d0, nResults=-1, allowyield=0) at ldo.c:402 #6 0x0000000000408bd4 in f_call (L=0x801c17300, ud=0x7fffffffe080) at lapi.c:923 #7 0x000000000040b78f in luaD_rawrunprotected (L=0x801c17300, f=0x408ba0 , ud=0x7fffffffe080) at ldo.c:131 #8 0x000000000040cf19 in luaD_pcall (L=0x801c17300, func=0x408ba0 , u=0x7fffffffe080, old_top=80, ef=64) at ldo.c:603 #9 0x0000000000408a90 in lua_pcallk (L=0x801c17300, nargs=0, nresults=-1, errfunc=3, ctx=0, k=0x0) at lapi.c:949 #10 0x0000000000405694 in docall (L=0x801c17300, narg=0, nres=-1) at lua.c:179 #11 0x00000000004053b5 in handle_script (L=0x801c17300, argv=0x7fffffffe4a0, n=1) at lua.c:337 #12 0x0000000000404a9c in pmain (L=0x801c17300) at lua.c:465 #13 0x000000000040bf66 in luaD_precall (L=0x801c17300, func=0x801c20090, nresults=1) at ldo.c:319 #14 0x000000000040c765 in luaD_call (L=0x801c17300, func=0x801c20090, nResults=1, allowyield=0) at ldo.c:401 #15 0x0000000000408bd4 in f_call (L=0x801c17300, ud=0x7fffffffe3d0) at lapi.c:923 #16 0x000000000040b78f in luaD_rawrunprotected (L=0x801c17300, f=0x408ba0 , ud=0x7fffffffe3d0) at ldo.c:131 #17 0x000000000040cf19 in luaD_pcall (L=0x801c17300, func=0x408ba0 , u=0x7fffffffe3d0, old_top=16, ef=0) at ldo.c:603 #18 0x0000000000408a90 in lua_pcallk (L=0x801c17300, nargs=2, nresults=1, errfunc=0, ctx=0, k=0x0) at lapi.c:949 #19 0x00000000004047a2 in main (argc=2, argv=0x7fffffffe4a0) at lua.c:491 The workaround is to build with GCC, otherwise use the attached patch. -- You are receiving this mail because: You are the assignee for the bug.