Details
Diff Detail
Event Timeline
lib/sanitizer_common/sanitizer_linux.cc | ||
---|---|---|
324 | Note that ::environ may be null - see the libc implementation here: |
lib/sanitizer_common/sanitizer_linux.cc | ||
---|---|---|
324 | Why can't you use internal_strstr function here? |
lib/sanitizer_common/sanitizer_linux.cc | ||
---|---|---|
324 | I believe strstr() doesn't look up through an array of pointers? Or, if you mean to replace internal_strncmp(*Env, name, NameLen) == 0 with internal_strstr(*Env, name) == *Env, well, it would look a bit awkward to me. But no problem to fix, of course. |
lib/sanitizer_common/sanitizer_linux.cc | ||
---|---|---|
324 | Ah, sorry, please disregard my comment. |
Dmitry, your commit rL211417 does the same, but makes things libc-dependent. Do you think we should drop down this patch or replace your implementation? Thanks.
Update: getenv() relies on strncmp() and other intercepted funcs and thus breaks Asan initialization.
I all in favor of removing libc dependencies.
But where does "extern char **environ" came from? Doesn't it come from libc?
But where does "extern char **environ" came from? Doesn't it come from libc?
char **environ is provided by crt1 - it's here on FreeBSD -HEAD:
http://svnweb.freebsd.org/base/head/lib/csu/common/ignore_init.c?revision=245133&view=markup
I see.
Does the current version work on freebsd?
What's the purpose of removing libc dependency from there?
crt1 is a part of C runtime. I am interested in complete independence of C world for Go runtime.
But I see that now it's dependent on lib anyway, e.g. there is a call to pthread_self.
Does the current version work on freebsd?
Yes, though I need to update the patch to handle the case with null 'environ' first. Will do ASAP.
What's the purpose of removing libc dependency from there?
AFAIU, the less we tied to libc in things like that, the less the need to handle under-initialized sanitizers in intercepted functions.
crt1 is a part of C runtime. I am interested in complete independence of C world for Go runtime.
We would need a special implementation for Go then, I believe.
Note that ::environ may be null - see the libc implementation here:
http://svnweb.freebsd.org/base/head/lib/libc/stdlib/getenv.c?revision=253413&view=markup#l428