Florian Weimer | 28 Jun 16:12 2016
Picon

How to detect symbol interposition?

I need a way to detect symbol interposition from within libc.

It seems that this is not directly distinguishable from interposition 
based on addresses alone:

#include <stdio.h>
#include <stdlib.h>

int
main (void)
{
   printf ("main malloc: %p\n", malloc);
}

If I have a hidden alias of malloc within libc (say, __libc_malloc), so 
that I can get the original address, it will be not equal to malloc 
because malloc in the entire process will point to the PLT stub.  The 
PLT stub will call malloc, of course, but you cannot tell this from its 
address.

Any suggestions?

Thanks,
Florian

Joël Krähemann | 24 Jun 23:22 2016
Picon
Gravatar

free thread related memory created by pthread_create()

Hi all

The very last entry of following shows the issue with pthread_create():

http://pastebin.com/aQfAQV2q

The threads are detached and leaks I believe this could be the cause
of performance problems with GSequencer.

http://www.nongnu.org/gsequencer/

Cheers,
Joël

Huang Pei | 17 Jun 11:05 2016
Picon

One more question for BZ 19550

Hi,I have one more question for bug fix 19550 on N32's mmap64.

After bug fix 19550, N32' mmap64 can handle  2GB<= offset < 4GB,but it

can not handle 4GB <= offset < 2^44 - 1( offset is off64_t, the last arg 
of mmap64)

which is not identical to o32's mmap64. Since mips n32 does not have 
__NR_mmap2

syscall, if a O32 mmap64 application is transplanted into  N32, do we 
need to handle

this in N32's mmap64?

Carlo Kok | 12 Jun 00:12 2016
Gravatar

sigsegv dereferencing l_addr in link_map

On some (ubuntu 14.04.4, libc 2.19-0ubuntu6.9) systems I'm getting a 
sigsegv when casting the link_map's l_addr to Elf64_Ehdr. This is 
something libgc does and works fine on most linux systems, but not all.

What am I missing here, and if this isn't guaranteed to work, how else 
can I get all the loaded data segments.

Code like this shows it:

#include <link.h>
#include <stdio.h>

# pragma weak _DYNAMIC
extern Elf64_Dyn _DYNAMIC[];

int main() {
   int tag;
   Elf64_Dyn* dp;
   struct link_map* cachedResult;
   for( dp = _DYNAMIC; (tag = dp->d_tag) != 0; dp++ ) {
     if( tag == DT_DEBUG ) {
        struct link_map *lm = ((struct r_debug 
*)(dp->d_un.d_ptr))->r_map;
        if( lm != 0 ) cachedResult = lm->l_next; /* might be NULL */
           break;
      }
   }
   printf("%p cached result; %p dyn \n", cachedResult, dp->d_un.d_ptr);
   while(cachedResult) {
     printf("%p %p %s\n", cachedResult->l_addr, cachedResult->l_ld, 
(Continue reading)

YuGiOhJCJ Mailing-List | 9 Jun 04:38 2016
Picon

Why stdarg.h is part of GCC instead of libc?

Hello,

I was checking from what package the headers I am using for a program are provided:
* ctype.h: It is part of libc [1]
* errno.h: It is part of libc
* getopt.h: It is part of libc
* limits.h: It is part of libc
* ...

Then I was amazed to discover that:
* stdarg.h: It is part of gcc [2]

I don't understand why.
Maybe it is an historical reason or something like that.
I don't see any reason to make the stdarg.h header part of GCC instead of libc.
AFAIK, all these headers are standards C headers.
In other words, they should not be specific to the compiler.

Someone can explain me why stdarg.h is part of GCC instead of libc?
Is it documented somewhere that stdarg.h is not part of libc?
Are there other standard C headers like this one that are not part of libc?

Thank you.
Best regards.

[1] https://www.gnu.org/software/libc/
[2] https://gcc.gnu.org/

Picon
Gravatar

parse_dup_op duplicates the tree exponentially when using repeated +

Hi guys,

I reported this bug: https://sourceware.org/bugzilla/show_bug.cgi?id=20095

I'm wondering if I reported it to the proper place. It's a variant of a bug
raised/reported by Jim Meyering
(https://sourceware.org/bugzilla/show_bug.cgi?id=17150). In that case, the
issue was a memory problem (the repeated repetition operators consumed memory
exponentially, leading to memory allocation failures and null pointer
dereferencing).

Which I think was also assigned a CVE number:

  http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-4051

This case is a cpu usage problem. Given enough repetition operators, the
program will consume exponential amounts of cpu time (since for every repetiton
operator, it duplicates the data structure that holds the regex, or part of
it).

I'm not even sure why regcomp in libc allows for repeated use of +'s or {n,m}
like that. The regcomp implementation in FreeBSD has a similar issue (check the
BUGS section here: https://www.freebsd.org/cgi/man.cgi?query=regcomp&sektion=3&apropos=0&manpath=freebsd
), but at least it treats the .++ case for ERE correctly (as an invalid
expression).

--

-- 
Eduardo Bustamante
https://dualbus.me/

(Continue reading)

Michael Williamson | 1 Jun 19:50 2016
Picon

sscanf ~1000 slower that strtol

Hi,

I have a question. I was comparing the speed of reading some ASCII
integers by different methods, and I found that using sscanf (with the
characters consumed operand (%n)) is ~1000
slower than the fastest method, strtol. Why is it so slow?

I am using version ldd (Ubuntu EGLIBC 2.15-0ubuntu10.12) 2.15.

Thanks,
-Mike
Attachment (rs.cpp): text/x-c++src, 5126 bytes
Sreyan Chakravarty | 28 May 19:39 2016
Picon

Make Error - gnu_indirect_function not recognized

I am trying to build GLIBC on a Linux 2.6.25 machine. My configure has
completed without any errors but my make fails with the message-:

../sysdeps/x86_64/multiarch/strcspn.S:47: Error: unrecognized symbol
type "gnu_indirect_function"
make[2]: *** [/home/Sreyan/Desktop/glibc-2.14/build/string/strcspn.o] Error 1
make[2]: Leaving directory `/home/Sreyan/Desktop/glibc-2.14/string'
make[1]: *** [string/subdir_lib] Error 2
(more detail in attached file)

Any idea on how to solve this ? I am using gcc 4.3.0 for the build.
What can I do to solve this ?

The config.log (attached) states that gnu_indirect_function is not
supported. Shouldn't the configure script failed if that was not
available ?

Regards,
Sreyan Chakravarty
../sysdeps/x86_64/multiarch/strchr.S: Assembler messages:
../sysdeps/x86_64/multiarch/strchr.S:28: Error: unrecognized symbol type "gnu_indirect_function"
make[2]: *** [/home/Sreyan/Desktop/glibc-2.14/build/string/strchr.o] Error 1
make[2]: *** Waiting for unfinished jobs....
../sysdeps/x86_64/multiarch/strcpy.S: Assembler messages:
../sysdeps/x86_64/multiarch/strcpy.S:61: Error: unrecognized symbol type "gnu_indirect_function"
make[2]: *** [/home/Sreyan/Desktop/glibc-2.14/build/string/strcpy.o] Error 1
../sysdeps/x86_64/multiarch/strcmp.S: Assembler messages:
../sysdeps/x86_64/multiarch/strcmp.S:88: Error: unrecognized symbol type "gnu_indirect_function"
(Continue reading)

Preston Moore | 24 May 20:47 2016
Picon

Where is free() implemented?

Hey everyone,

Hopefully this is a quick question with a quick answer. Where is free() implemented? I’ve just found a
bunch of extern references in the glibc source I have. This is Ubuntu 14.04 LTS 32 bit.

Thanks,
Preston Moore
Sreyan Chakravarty | 21 May 18:32 2016
Picon

How to fix conftest.c problems ?

I am building GLIBC 2.14 on a Ubuntu Hardy Heron  system.

When I run the following command-:

../configure --prefix=/usr/local/glibc2.14

The configuration completes but I keep getting weird errors in my
config.log namely for a file called conftest.c

A quick google search revealed that conftest.c is actually a temporary
file generated by the autoconf script for testing purposes.

Now my question is how do I first dump conftest.c into an actual file
that I can see, secondly how do I fix the error that it is
encountering.

A sample of those errors is-:

configure:3118: gcc -E  conftest.c
conftest.c:9:28: error: ac_nonexistent.h: No such file or directory
configure:3118: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "c-library"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "glibc"
| #define PACKAGE_URL "http://www.gnu.org/software/c-library/"
| /* end confdefs.h.  */
(Continue reading)

Sreyan Chakravarty | 19 May 22:49 2016
Picon

Build Error - gcc must provide the <cpuid.h> header

Okay I understand that this is a pretty common problem, but one that
has different causes. I am on a Oracle VirtualBox running Ubuntu Hardy
Heron x86_64 as my guest OS. The reason I am on such an old OS is
because I have an application,which was written for Heron, that I need
to make workable.

I need GLIBC version 2.14 so I have downloaded the sources from -:

http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz

(is it the correct version that I want ?)

Okay so now I am trying to build GLIBC version 2.14 on my virtual
system but when I run configure in my build directory I keep getting
the following error message:

checking cpuid.h usability... no
checking cpuid.h presence... no
checking for cpuid.h... no
configure: error: gcc must provide the <cpuid.h> header

I think (correct me if I am wrong) that configure is thinking that I
want to cross-compile GLIBC. It may be because on my virtual system :
uname -p gives the output of "unknown" (since this is a virtual OS)
(you can verify in the attached log)

I have also not done anything to my include/ folder, should I delete
its contents before running configure ?

Need help please. I have attached my config.log and the configure
(Continue reading)


Gmane