[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] Question: Capturing command output (on-screen keyword co
From: |
Chet Ramey |
Subject: |
Re: [Help-bash] Question: Capturing command output (on-screen keyword colorizer/prettifier). |
Date: |
Thu, 6 Oct 2016 12:28:04 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 |
On 10/5/16 8:35 PM, Matthew Giassa wrote:
> I managed to get 99% of the way there. I used dup()/pipe()/dup2() and
> hooked fork() to redirect stdout for bash and child processes to a
> dedicated per-process pipe. I then spawn a dedicated (detached) worker
> thread after forking which reads in the pipe, and then sends it merrily
> along to the PTS/TTY (doesn't yet inject color codes).
>
> I've noticed the following undesired behavior though when I initially
> start BASh:
> Case 1:
> malloc: .././subst.c:8902: assertion botched
> free: start and end chunk sizes differ
> Aborting...
> malloc: unknown:0: assertion botched
> free: start and end chunk sizes differ
> Aborting...Aborted (core dumped)
As I recall, this happens when the functions in the LD_PRELOAD use a
different malloc (in this case, the libc malloc) than the malloc the
rest of the bash code uses (the builtin bash one). I believe this has
come up before.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU address@hidden http://cnswww.cns.cwru.edu/~chet/