Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #16124
| Path | csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail |
|---|---|
| From | gentoo_eshoes@tutanota.com |
| Newsgroups | gnu.bash.bug |
| Subject | Re: [PATCH] Add active mark, face support; activate mark on paste |
| Date | Sun, 12 Apr 2020 07:04:05 +0200 (CEST) |
| Lines | 197 |
| Approved | bug-bash@gnu.org |
| Message-ID | <mailman.54.1586667852.3066.bug-bash@gnu.org> (permalink) |
| References | <M4dFweU--3-2@tutanota.com> <875c423e-0420-78d2-af4b-dfb168432e2d@case.edu> <M4dz8wC--3-2@tutanota.com> <902c38ef-7534-8f6d-51b7-daa0843b8440@case.edu> <M4glUEn--3-2@tutanota.com> |
| NNTP-Posting-Host | lists.gnu.org |
| Mime-Version | 1.0 |
| Content-Type | multipart/mixed; boundary="----=_Part_154860_1656829858.1586667845294" |
| X-Trace | usenet.stanford.edu 1586667853 22517 209.51.188.17 (12 Apr 2020 05:04:13 GMT) |
| X-Complaints-To | action@cs.stanford.edu |
| Cc | chet.ramey@case.edu, bug-bash@gnu.org |
| To | Chet Ramey <chet.ramey@case.edu> |
| Envelope-to | bug-bash@gnu.org |
| DKIM-Signature | v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1586667845; s=s1; d=tutanota.com; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:In-Reply-To:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:References:Sender; bh=6RDARTzwK7D4a2HCS0Xf6t+mJDQKP1zvlObyiR1lXcI=; b=ktKf2gGAbkAAj+V9A2ttLYqIAOhQHKYLK213jPiBeevY8kVLqhCpsbBtj1GCSw21 Ao0L0SrBWnz9x10ou4ifXUbCD+nuLDljHK7kZ795Ts0L3ULMFkTZUVQD7ZtzqM9MK5Z Bl0gVP7FPHgzPapsbNiRSvNCzDC7p6/zHyivv4t7OjVGlucR4O9EY+me1vx9Cbyp3M8 xml3m6lzUSxo3+TSap4fS3SEbCz1hSrcA+bg66uTUZTLUld21IyQyqkpHBUwmqs1xw+ U/XMTGWooMiqN3+LLny2EJEtazXOdmGokoBeIgjHOx+eUi8fjrM/4LB+YpgcrP5CV12 nD28QOMheQ== |
| In-Reply-To | <902c38ef-7534-8f6d-51b7-daa0843b8440@case.edu> |
| X-detected-operating-system | by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] |
| X-Received-From | 81.3.6.162 |
| X-BeenThere | bug-bash@gnu.org |
| X-Mailman-Version | 2.1.23 |
| Precedence | list |
| List-Id | Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org> |
| List-Unsubscribe | <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe> |
| List-Archive | <https://lists.gnu.org/archive/html/bug-bash> |
| List-Post | <mailto:bug-bash@gnu.org> |
| List-Help | <mailto:bug-bash-request@gnu.org?subject=help> |
| List-Subscribe | <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe> |
| X-Mailman-Original-Message-ID | <M4glUEn--3-2@tutanota.com> |
| X-Mailman-Original-References | <M4dFweU--3-2@tutanota.com> <875c423e-0420-78d2-af4b-dfb168432e2d@case.edu> <M4dz8wC--3-2@tutanota.com> <902c38ef-7534-8f6d-51b7-daa0843b8440@case.edu> |
| Xref | csiph.com gnu.bash.bug:16124 |
Show key headers only | View raw
[Multipart message — attachments visible in raw view] - view raw
Apr 11, 2020, 23:11 by chet.ramey@case.edu:
> On 4/11/20 12:04 PM, gentoo_eshoes@tutanota.com wrote:
>
>>>
>>> What's your $PS1?
>>>
>> $ echo $PS1
>> \ -----------\n\ \[\a\]\ \[\e[1;37m\e[42m\]\u@\H\[\e[0m\] \ \[\033[1;30m\]$(date "+%Y/%m/%d %H:%M:%S")\[\033[0m\] \ \[\e[0;37m\]\s\V t:\l j:\j \ d:${SHLVL} pp:${PPID} p:$$ ut`cat /proc/uptime | cut -f1 -d.`\[\e[0m\]\n\ \[\e[0;37m\]!\!\[\e[0m\] \ \[\033[0;36m\]\#\[\033[0m\] \ $(evalexitcode "${__earlyec[@]}" ) \ \[\e[0m\]$(uname -r) $(uname -v) $(ps_lepath "\w")\[ \033];\w\a\] \[\e[1;32m\]\$\[\e[0m\] \
>>
>
> I have to hand it to you; that's one of the most complicated prompt strings
> I've ever seen.
>
> In any event, that didn't help me reproduce the seg fault, but I was able
> to use the stack traceback you sent to find a problem. I've attached a
> patch.
>
This is amazing, that patch completely fixed the issue, thank you!
I was wondering, in this line:
memmove (old_face+newbytes, old_face+oldbytes, strlen (old+oldbytes) + 1);is the strlen correct or should it be strlen (old_face+oldbytes) ? ie. old gets changed to old_face
in this context:
memmove (old+newbytes, old+oldbytes, strlen (old+oldbytes) + 1);
memmove (old_face+newbytes, old_face+oldbytes, strlen (old+oldbytes) + 1);
in file lib/readline/display.c
It's probably already correct even though I don't understand why(because I don't know what all those variables do), but still I wanted to ask just to be sure.
I've tested that it works with either variant... but that's likely because that 'if (oldbytes != newbytes)' isn't entered in my tests. Oh, if I remove the 'if' I see that both strlen variants return the same value, so I guess it's correct either way. Nevermind then.
>>> You should just have to run `ulimit -c unlimited'.
>>>
>> Thank you for your reply. It was already 'unlimited'. But when firefox segfaults it works (that is, `coredumpctl -r` does list it), yet it doesn't happen for bash and I thought it's because bash is somehow catching it and handling it internally,
>>
>
> Bash does catch SIGSEGV and does some cleanup, to the extent that it can do
> anything, and kills itself with the same signal (that's why you see 139 as
> the exit status). That should still result in a core dump.
>
Oh that's good to know. I've tracked down the issue to an exit that happens before bash gets the chance to re-issue the coredump/kill self with SEGV, by using the attached patch to simulate a segmentation fault inside bash, I get this:
$ ./bash
TERM='xterm-256color'
/usr/bin/blugon
2069.22 7138.70
-----------
user@Z575 2020/04/12 07:00:36 bash5.0.16 t:6 j:0 d:4 pp:16407 p:155787 ut2069
!76112 1 0 5.6.3-gf9fb85751506 #90 SMP PREEMPT Thu Apr 9 19:22:52 CEST 2020
/home/user/build/1packages/4used/bash-devel-git/makepkg_pacman/bash/src/bash
$ !1!
!2!
!3!
!4!
that "!4!" is in sig.c here:
if (dollar_dollar_pid != 1) {
fprintf (stderr, "!4!\n");fflush (stderr);
exit (128+sig); /* just in case the kill fails? */
}
(the attached patch shows exact context)
Is there anything you could do to fix it?
Thanks in advance.
> Chet
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
> ``Ars longa, vita brevis'' - Hippocrates
> Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/
>
Back to gnu.bash.bug | Previous | Next | Find similar
Re: [PATCH] Add active mark, face support; activate mark on paste gentoo_eshoes@tutanota.com - 2020-04-12 07:04 +0200
csiph-web