-
-
Notifications
You must be signed in to change notification settings - Fork 602
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
Glibc passes argv and stuff to DSO init funcions, we don't #795
Comments
benoit-canet
pushed a commit
to benoit-canet/osv
that referenced
this issue
Nov 15, 2016
As explained nicely in golang/go#13492, since 1996 glibc's dlopen() passes argv and a bunch of other stuff to the initialization functions of shared objects, while we don't pass any argument (see object::run_init_funcs()). Golang code (ref cloudius-systems#522), in particular, assumes it gets argv, auxv, etc., this way. Fixes: cloudius-systems#795 Signed-off-by: Benoît Canet <[email protected]>
benoit-canet
pushed a commit
to benoit-canet/osv
that referenced
this issue
Jan 13, 2017
As explained nicely in golang/go#13492, since 1996 glibc's dlopen() passes argv and a bunch of other stuff to the initialization functions of shared objects, while we don't pass any argument (see object::run_init_funcs()). Golang code (ref cloudius-systems#522), in particular, assumes it gets argv, auxv, etc., this way. Fixes: cloudius-systems#795 Signed-off-by: Benoît Canet <[email protected]>
benoit-canet
pushed a commit
to benoit-canet/osv
that referenced
this issue
Feb 8, 2017
As explained nicely in golang/go#13492, since 1996 glibc's dlopen() passes argv and a bunch of other stuff to the initialization functions of shared objects, while we don't pass any argument (see object::run_init_funcs()). Golang code (ref cloudius-systems#522), in particular, assumes it gets argv, auxv, etc., this way. Fixes: cloudius-systems#795 Signed-off-by: Benoît Canet <[email protected]>
benoit-canet
pushed a commit
to benoit-canet/osv
that referenced
this issue
Feb 8, 2017
As explained nicely in golang/go#13492, since 1996 glibc's dlopen() passes argv and a bunch of other stuff to the initialization functions of shared objects, while we don't pass any argument (see object::run_init_funcs()). Golang code (ref cloudius-systems#522), in particular, assumes it gets argv, auxv, etc., this way. Fixes: cloudius-systems#795 Signed-off-by: Benoît Canet <[email protected]>
benoit-canet
pushed a commit
to benoit-canet/osv
that referenced
this issue
Feb 9, 2017
As explained nicely in golang/go#13492, since 1996 glibc's dlopen() passes argv and a bunch of other stuff to the initialization functions of shared objects, while we don't pass any argument (see object::run_init_funcs()). Golang code (ref cloudius-systems#522), in particular, assumes it gets argv, auxv, etc., this way. Fixes: cloudius-systems#795 Signed-off-by: Benoît Canet <[email protected]>
Hello @nyh, Based on @benoit-canet patches, argc and argv are been passed Kind Regards, |
The patch was not yet committed. @wkozaczuk recently sent a new version of @benoit-canet 's patch, and when this patch is committed this issue will be automatically closed. Until it is committed, we shouldn't close the issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As explained nicely in golang/go#13492, since 1996 glibc's dlopen() passes argv and a bunch of other stuff to the initialization functions of shared objects, while we don't pass any argument (see object::run_init_funcs()). Golang code (ref #522), in particular, assumes it gets argv, auxv, etc., this way.
Passing argv et al. to init functions doesn't make any sense, not to mention it isn't clear which argv we're supposed to pass (or what happens if the executable modified these things before or during the dlopen call). So according to research in the above link, NONE of the other glibc clones passes these things to DSO initialization functions. But sadly, glibc does - since the following unexplained commit in 1996:
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=dcf0671d905200c449f92ead6cf43c184637a0d5
So probably we need to do this too :-(
The above doesn't mention auxv, so probably look at newer code to see what glibc really passes these days.
By the way, looking at that commit, I discovered that glibc exposes also
extern int __libc_argc;
extern char *___libc_argv;
extern char *___libc_envp;
So probably we should have those too (even if golang doesn't use them, somebody is bound to use them someday).
The text was updated successfully, but these errors were encountered: