-
Notifications
You must be signed in to change notification settings - Fork 585
openbsd: ensure we link to the built libperl.a, not the system libperl.a #23265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: blead
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5739,6 +5739,52 @@ S_xs_version_bootcheck(pTHX_ SSize_t items, SSize_t ax, const char *xs_p, | |
} | ||
} | ||
|
||
/* | ||
=for apidoc api_version_assert | ||
|
||
Used by the PERL_API_VERSION_CHECK macro to compare the perl the | ||
object was built with and the perl that C<libperl> was built with. | ||
|
||
This can be used to ensure that these match and produces a more | ||
diagnosable than random crashes and mis-behaviour. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There seems to be a word or two missing after |
||
|
||
=cut | ||
*/ | ||
|
||
void | ||
Perl_api_version_assert(size_t interp_size, void *v_my_perl, | ||
const char *api_version) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not switch Since my TLDR understanding of v-strings and version string equality and comparison logical operations is, v-str and ver.pm So b/c there is so much soap drama with non-floating point version numbers, and PERL_API_VERSION, is a 3 '.' dots thing, which means is part of the standards war, I decided to keep the using So that was reason # 2 why I left it as a AFAIK the I don't believe ELF binaries compiled in the 1980s for i386 are copy+paste+double click executable on Ubuntu/Freebsd/Fedora in 2025. besides, the Linux kernel doesn't even know what an From Linux's viewpoint, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/binfmt_elf_fdpic.c#n92 https://docs.kernel.org/admin-guide/binfmt-misc.html So yeah, I have no clue if some Unix OS will add a dozen random tokens/identifiers/english lang words, to the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
15 minutes after I speak of the devil, and the devil himself appears in production perl code. See this ticket. Someone was NOT USING the cryptographically signed .git P5P's Perl code base, but their vendor's [ |
||
dTHX; | ||
|
||
PERL_ARGS_ASSERT_API_VERSION_ASSERT; | ||
|
||
if (interp_size != sizeof(PerlInterpreter)) { | ||
/* detects various types of configuration mismatches */ | ||
/* diag_listed_as: Mismatch between expected and libperl %s */ | ||
Perl_croak(aTHX_ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use a croak_nocontext(), this fn is max run 1x a process. the croak branches are 0 Kelvin code and will never execute w/o C dev user error, the performance of executing |
||
"Mismatch between expected and libperl interpreter structure size %zd vs %zd", | ||
interp_size, sizeof(PerlInterpreter)); | ||
} | ||
if ( | ||
#ifdef MULTIPLICITY | ||
v_my_perl != my_perl | ||
#else | ||
v_my_perl != NULL | ||
#endif | ||
) { | ||
/* detect threads vs non-threads mismatch */ | ||
/* diag_listed_as: Mismatch between expected and libperl %s */ | ||
Perl_croak(aTHX_ | ||
"Mismatch between expected and libperl interpreter pointer"); | ||
} | ||
if (strNE(api_version, PERL_API_VERSION_STRING)) { | ||
/* diag_listed_as: Mismatch between expected and libperl %s */ | ||
Perl_croak(aTHX_ | ||
"Mismatch between expected and libperl API versions %s vs %s", | ||
api_version, PERL_API_VERSION_STRING); | ||
} | ||
} | ||
|
||
PERL_STATIC_INLINE bool | ||
S_gv_has_usable_name(pTHX_ GV *gv) | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not move
PERL_API_VERSION_ASSERT;
to right belowmy_perl = perl_alloc();
. me knowing various permutatoins of crashing ancient modern perl5xx.dll permutations, this test code/demo code already segved or caused heap corruption before reaching thePERL_API_VERSION_ASSERT;
statement.PL_exit_flags |= PERL_EXIT_WARN;
What is grammar token/src code ascii string
PL_exit_flags
in machine code view?Is
PL_exit_flags
a Perl 5.6/5.8/5.10 symbian/win32/win16/cray styleextern "C" int * Perl_Isolation_PL_exit_flags(void);
is it?
extern "C" int * Perl_Isolation_PL_exit_flags(my_perl);
is it? IIRC below is AKA
dVAR;
macro,extern "C" int * Perl_Isolation_PL_exit_flags(my_env, my_perl);
is it?
extern "C" int PL_exit_flags;
is it?
extern int __@@C$PLUS$__PLUSSS$666@_QWERTY@_PL_exit_flags@__;
is it?
*(int*)( ((char*)my_perl) + 0x47c)
is it?
extern "C" int __$SONAME@PL_exit_flags$libperl.so.5.40.1.0083.6798;
What did the end user C dev really write (hex dump wise) with ascii string
PL_exit_flags |= PERL_EXIT_WARN;
?Lets do our best to print in english to STDERR before
LD_LAZY_LINK
insta-KILL the process and fills the users console with unreadable CPU GPR and FP register hex dumps and leaves a 30MB core dump file of gibberish on the end users machine.