From owner-freebsd-tcltk@FreeBSD.ORG Wed Jun 25 08:30:55 2014 Return-Path: Delivered-To: tcltk@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 AB29E802 for ; Wed, 25 Jun 2014 08:30:55 +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 936822985 for ; Wed, 25 Jun 2014 08:30:55 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.8/8.14.8) with ESMTP id s5P8UtPm060397 for ; Wed, 25 Jun 2014 09:30:55 +0100 (BST) (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: tcltk@FreeBSD.org Subject: [Bug 191285] lang/expect segfault in exp_spawnv Date: Wed, 25 Jun 2014 08:30:55 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed 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: gahr@FreeBSD.org X-Bugzilla-Status: Needs Triage X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: tcltk@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: 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-tcltk@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: FreeBSD-specific Tcl/Tk discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jun 2014 08:30:55 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191285 Pietro Cerutti changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |gahr@FreeBSD.org --- Comment #2 from Pietro Cerutti --- I don't think it's related to ckalloc / ckfree. The problem is the definition of Tcl_ErrnoMsg: #define Tcl_ErrnoMsg (tclStubsPtr->tcl_ErrnoMsg) I fear you don't have a properly setup interp. Please try this sample program: #include #include #include #include #include int main(void) { Tcl_Interp * interp = Tcl_CreateInterp(); Expect_Init(interp); char * date = "/bin/date"; char * args[] = {date, NULL}; int fd = exp_spawnv(date, args); char buf[64]; read(fd, buf, sizeof(buf)); puts(buf); close(fd); return (0); } Compile with something like this: cc -o test-spawn test-spawn.c -I/usr/local/include/tcl8.6 -I/usr/local/include -L/usr/local/lib -lexpect -ltcl86 It works as expected here. However, if you remove the assignment to interp and just leave the variable uninitialized or NULL-initialized, it will segfault exactly as you described. -- You are receiving this mail because: You are the assignee for the bug.