RE: segv at strcmp

From: Luck, Tony <tony.luck_at_intel.com>
Date: 2003-12-25 11:25:01
> We have hit a problem with strcmp() on UnitedLinux 1.0
> with kernel: 2.4.19 and glibc: 2.2.5.
> I am wondering if anybody has seen something like it
> or knows if already there is a patch. I do not have a
> small repro but i will try to explain:
> 
> The segv happens at memcmp() at a line like:
> 'strcmp(x, "this is 24 chars long")' where x is a char
> pointer with a length of 7 and the constant has a
> length of 24. x is located at the first 8 bytes of the
> last 16 bytes at the end of a non-contiguous shared
> memory segment. memcmp() segvs when it tries to load 8
> bytes from the "r19" register which initially has the
> address of x and points to the end of the segment when
> the segv happens.

Sounds like your compiler converted the strcmp(str, const_str)
into memcmp(str, const_str, strlen(const_str)) ... and then
the memcmp fell off the end of the page.

What version of gcc are you using, and what arguments are you
passing to gcc?

-Tony
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Wed Dec 24 19:25:24 2003

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:21 EST