help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: trying to solve some missing symbols during linking (porting to Plan


From: Jens Staal
Subject: Re: trying to solve some missing symbols during linking (porting to Plan9)
Date: Mon, 14 Oct 2024 19:42:03 +0200

On Sun, Oct 13, 2024 at 02:42:52PM -0400, Chet Ramey wrote:
> On 10/12/24 11:00 PM, Jens Staal wrote:
> 
> > OK that is a bit discouraging. I had hoped that the crashing of the
> > "nojobs" build would be an indication that job control is not the issue.
> > (for mksh, the -DNOPROSPECTOFWORK which disabled job control made that
> > shell build)
> 
> Even the nojobs build depends on posix semantics for signals, processes,
> and process groups.
> 
> It would be interesting to see a stack traceback from the crash, but
> no guarantees, of course.
>

Thanks. I do not exactly know what you mean by stack traceback, but the
error message at the crash is:
(a minimal bash build without intl, readline, termcap, nojobs)

bash: 1329: suicide: sys: trap: fault read addr=0x0 pc=0x2b5698

I have never debugged in Plan9 before so a total novice and I am
manually transcribing the messages now from a VM window to this email so
typos might occur.

Plan9 has a debugger (acid) and running bash under there, I get the
following:

stack trace in acid:

acid: new()
1420: system        call _main  MOVQ     AX,_tos(SB)
1420: breakpoint    main+0x7    MOVL    BP,argc+0x0(FP)
acid: stk()
main(argc=0x0,argv=0x7fffffffefa0,env=0x532260) +0x7 (path)/bash/shell.c:370
_apemain(argc=0x1,argv=0x7ffffffefa0) +0x2d (path)/ap/plan9/callmain.c:39
_callmain +0x60 (path)/ap/plan9/callmain.c:31

I see in bash/shell.c:370 that there is an option NO_MAIN_ENV_ARG
and my naive interpretation of main vs _apemain above is that these guys are
not matching the number of arguments.

Trying to compile with NO_MAIN_ENV_ARG results in compiler complaints at
rows 432 and 466 in shell.c that env is not defined. Putting those
behind the option makes it compile, but then the new binary also
crashes, now with a reference to shell.c:365
(which is the line with the main function with 2 arguments)

So I guess I should start looking in the APE libc (libap), specifically
the callmain.c file there instead.

> -- 
> ``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/






reply via email to

[Prev in Thread] Current Thread [Next in Thread]