[Bug ld/32580] [2.44 regression] Non-bash shell breaks many default linker scripts

2025-03-24 Thread stefanbidi at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32580

Stefan Bidigaray  changed:

   What|Removed |Added

 CC||stefanbidi at gmail dot com

--- Comment #18 from Stefan Bidigaray  ---
I ran into this issue last month, as well. I was able to track down the problem
to ksh93 itself. A bug report was filed with the maintained version of ksh93
(https://github.com/ksh93/ksh/issues/823) and the issue resolved.

Unfortunately, the bug is somewhere deep inside ksh93 with how here-documents
are processed. The only way to resolve it is by patching ksh93 code. It really
has nothing to do with Binutils as was evident from the fact the other shells
didn't run into this problem.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/32580] [2.44 regression] Non-bash shell breaks many default linker scripts

2025-03-25 Thread stefanbidi at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32580

--- Comment #20 from Stefan Bidigaray  ---
(In reply to Rainer Orth from comment #19)
> 
> Thanks for the detective work.  However, it seems the Solaris issue is a
> different one: your testcase in the ksh93 issue doesn't SEGV on Solaris,
> but works just fine with a self-compiled unmodified ksh93 1.0.10.  That
> same ksh93 produces the same ldscripts output as does bash.

It's likely that this is still the same issue in ksh93. The simple testcase I
created consistently crashed on my custom musl-libc system. However, when
Martijn Dekker tested on his systems it crashed on Apline Linux but not Void
Linux (both use musl-libc based distributions) or Debian. I was also able to
run the testcase without a crash on my openSUSE system.

> Unfortunately, the ksh93 bundled with Solaris 11.4 is an older one
> 
>   version sh (AT&T Research) 93u+ 2012-08-01
>
> heavily patched (as can be seen on
> https://github.com/oracle/solaris-userland/tree/master/components/ksh93/
> patches)
> and upgrading Solaris /bin/sh (which *is* ksh93) certainly isn't a small
> feat to be done lightly.

That's what https://github.com/ksh93/ksh/ is, as well. It's the 2012 AT&T dump
+ patches.

I agree with you that patching the system sh should not be done on your own. I
was just pointing out that the problem we both ran into is an old memory
corruption bug in ksh93. Who knows, might've been present since the original
realize of ksh, but never triggered until now.

> The unfortunate fact is that the workaround for this bug that went into
> binutils 2.44 (unlike my original hack) only works on Solaris/SPARC;
> Solaris/x86 is still broken.

Since it's a memory corruption bug, it's extremely difficult to track down and
the patch created was a hack. Based on the link you provided, Solaris is using
the AT&T AST dump (https://github.com/att/ast) and applying patches to that.

-- 
You are receiving this mail because:
You are on the CC list for the bug.