From: Ken Brown <kbrown@cornell.edu>
To: cygwin@cygwin.com
Subject: Re: texlive-install: core dumped
Date: Sun, 30 Jun 2013 15:36:00 -0000 [thread overview]
Message-ID: <51D04278.5010907@cornell.edu> (raw)
In-Reply-To: <op.wzhpt5zyofd6j1@nebbiolo.upc.de>
On 6/30/2013 7:50 AM, Helmut Karlowski wrote:
> Ken Brown, 30.06.2013 04:34:00:
>> If you want to try debugging this with gdb, the texlive-debuginfo
>> package contains the files you need.
>
> Thanks! Found the bug:
>
> In
>
> texk/web2c/luatexdir/lua/loslibext.c:649
>
> In
>
> 632 static void find_env(lua_State * L)
> 633 {
> 634 char *envitem, *envitem_orig;
> (gdb)
> 635 char *envkey;
> 636 char **envpointer;
> 637 envpointer = environ;
> 638 lua_getglobal(L, "os");
> 639 if (envpointer != NULL && lua_istable(L, -1)) {
> 640 luaL_checkstack(L, 2, "out of stack space");
> 641 lua_pushstring(L, "env");
> 642 lua_newtable(L);
> 643 while (*envpointer) {
> 644 /* TODO: perhaps a memory leak here */
> (gdb)
> 645 luaL_checkstack(L, 2, "out of stack space");
> 646 envitem = xstrdup(*envpointer);
> 647 envitem_orig = envitem;
> 648 envkey = envitem;
> 649 while (*envitem != '=') {
> 650 envitem++;
> 651 }
> 652 *envitem = 0;
> 653 envitem++;
> 654 lua_pushstring(L, envkey);
> (gdb)
> 655 lua_pushstring(L, envitem);
> 656 lua_rawset(L, -3);
> 657 envpointer++;
> 658 free(envitem_orig);
> 659 }
> 660 lua_rawset(L, -3);
> 661 }
> 662 lua_pop(L, 1);
> 663 }
>
>
> It crashes in line 649, because my shell put an item without '=' in the
> environment, and there is no 0-check in find_env(), which appears to be
> a good thing. Fixed.
I'm glad you found it. Does the malformed environment string also
explain the other strange errors you were seeing?
Ken
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
next prev parent reply other threads:[~2013-06-30 14:36 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-29 11:43 Helmut Karlowski
2013-06-29 12:26 ` Ken Brown
2013-06-29 12:36 ` Helmut Karlowski
2013-06-29 15:20 ` Ken Brown
2013-06-29 18:37 ` Helmut Karlowski
2013-06-29 19:38 ` Ken Brown
2013-06-29 22:00 ` Helmut Karlowski
2013-06-29 23:37 ` Ken Brown
2013-06-30 2:34 ` Helmut Karlowski
2013-06-30 5:59 ` Ken Brown
2013-06-30 14:36 ` Helmut Karlowski
2013-06-30 15:36 ` Ken Brown [this message]
2013-06-30 16:31 ` Helmut Karlowski
2013-06-30 17:44 ` Ken Brown
2014-04-04 10:59 ` Václav Zeman
2014-04-04 13:14 ` Ken Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51D04278.5010907@cornell.edu \
--to=kbrown@cornell.edu \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).