zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@sunsite.dk
Subject: Re: PATCH: functrace [was Re: funcstack and backtraces]
Date: Sun, 17 Sep 2006 19:20:31 -0700	[thread overview]
Message-ID: <060917192033.ZM786@torch.brasslantern.com> (raw)
In-Reply-To: <20060917233845.GA32023@scowler.net>

On Sep 17,  7:38pm, Clint Adams wrote:
} Subject: Re: PATCH: functrace [was Re: funcstack and backtraces]
}
} > Adding an extra level of function stack avoids the crash, but this
} > still doesn't look right to me:
} 
} What crash?

zsh-workers/22730

} > schaefer<506> (baz() { bar }; 
} >  bar() { foo } ;                                   
} >  foo() { print $functrace } ;      
} >  baz )
} > bar:0 baz:0 Src/zsh:bar:0
} 
} > What does that it mean that "bar" is at both ends of the stack?
} 
} I can't reproduce that.  I get
} bar:0 baz:0 Src/zsh:6
} (or Src/zsh:0 Src/zsh:0 Src/Zsh:12)

I suspect there's somewhere that you're calling dupstring() on a hunk
of memory that isn't really nul-terminated.

} > You're right about it being buggy when functionargzero is not set.
} > Even the examples above that don't crash when it is set, crash when
} > it is not set (with effectively the same backtrace).
} 
} I can't reproduce that either.

torch% unsetopt functionargzero
torch% (baz() { bar };         
bar() { foo } ;
foo() { print $functrace } ;
baz )
zsh: segmentation fault (core dumped)  (; baz () { ... }; bar () { ... }; foo
() { ... }; baz; )
torch% gdb Src/zsh core.771
(gdb) where
#0  0x001e3de6 in strcpy () from /lib/tls/libc.so.6
#1  0x080aa616 in dupstring (
    s=0xb7cdde40
    "Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:Src/zsh:"...)
        at ../../zsh-4.0/Src/string.c:40
[...]
(gdb) run -f
Starting program: /usr/local/src/zsh/Src/zsh -f
torch% baz() { bar };
torch% bar() { foo } ;
torch% foo() { print $functrace } ;
torch% baz
bar:0 baz:0 /usr/locbar:0
torch% unsetopt functionargzero
torch% baz

Program received signal SIGSEGV, Segmentation fault.
0x001e3de6 in strcpy () from /lib/tls/libc.so.6
(gdb) where
#0  0x001e3de6 in strcpy () from /lib/tls/libc.so.6
#1  0x080aa616 in dupstring (
    s=0xb7d76350
    "/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc/usr/loc"...)
        at ../../zsh-4.0/Src/string.c:40
[...]


-- 


      reply	other threads:[~2006-09-18  2:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-01 19:10 funcstack and backtraces Clint Adams
2006-09-04 21:26 ` Bart Schaefer
2006-09-04 23:15   ` Clint Adams
2006-09-17 19:14   ` PATCH: functrace [was Re: funcstack and backtraces] Clint Adams
2006-09-17 22:39     ` Bart Schaefer
2006-09-18  3:37       ` Clint Adams
2006-09-18  5:57         ` Bart Schaefer
2006-09-18 11:07           ` Clint Adams
2006-09-18 15:16             ` Bart Schaefer
2006-09-17 22:52     ` Bart Schaefer
2006-09-17 23:38       ` Clint Adams
2006-09-18  2:20         ` Bart Schaefer [this message]

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=060917192033.ZM786@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@sunsite.dk \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).