<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>223051</bug_id>
          
          <creation_ts>2008-05-21 12:10 0000</creation_ts>
          <short_desc>net-proxy/squid will not work when compiled against &gt;=sys-kernel/linux-headers-2.6.25</short_desc>
          <delta_ts>2008-05-28 19:51:37 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Ebuilds</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>phantom4@gmx.net</reporter>
          <assigned_to>net-proxy@gentoo.org</assigned_to>
          <cc>josch09@gmail.com</cc>
    
    <cc>Martin.vGagern@gmx.net</cc>

      

      
          <long_desc isprivate="0">
            <who>phantom4@gmx.net</who>
            <bug_when>2008-05-21 12:10:39 0000</bug_when>
            <thetext>sys-kernel/linux-headers-2.6.25 and up changed _LINUX_CAPABILITY_VERSION.
As a result, if squid (2 and 3) is compiled against those headers, it will not be usable (although it will compile without complaining).

Recompiling squid with sys-kernel/linux-headers-2.6.24 solves the
problem.

Maybe it&apos;s a duplicate of Bug 221971.


Reproducible: Always

Steps to Reproduce:
1. compile squid with &gt;=sys-kernel/linux-headers-2.6.25
2. start squid

Actual Results:  
/etc/init.d/squid start
 * Initializing cache directories ...
*** glibc detected *** /usr/sbin/squid: free(): invalid next size (fast): 0x088659b0 ***
======= Backtrace: =========
/lib/libc.so.6[0xb7c0f7ff]
/lib/libc.so.6(cfree+0x89)[0xb7c114f9]
/usr/sbin/squid[0x81244e2]
======= Memory map: ========
...</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>josch09@gmail.com</who>
            <bug_when>2008-05-22 16:04:20 0000</bug_when>
            <thetext>after a world rebuild I had the same problem

sys-kernel/linux-headers-2.6.25-r3</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>mrness@gentoo.org</who>
            <bug_when>2008-05-25 20:08:12 0000</bug_when>
            <thetext>Did you guys tried to recompile glibc after you installed the new version of linux-headers?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>phantom4@gmx.net</who>
            <bug_when>2008-05-26 05:47:42 0000</bug_when>
            <thetext>Yes, I tried to recompile glibc after I installed the new version of
linux-headers. It doesn&apos;t solve the problem.
Installing sys-kernel/linux-headers-2.6.24 without recompiling glibc fixed it.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>Martin.vGagern@gmx.net</who>
            <bug_when>2008-05-27 01:58:09 0000</bug_when>
            <thetext>Trying to valgrind or mudflap this issue, I found two upstream bugs:
http://www.squid-cache.org/bugs/show_bug.cgi?id=2350
http://www.squid-cache.org/bugs/show_bug.cgi?id=2359

Neither of these solved the issue, though. Both valgrind and mudflap cause squid to start up without this glibc error message. There are some uninitialized writes in valgrind, and mudflap keeps complaining about CurrentDebug for reasons unknown, but I have no clue what all this has to do with the linux headers.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>mrness@gentoo.org</who>
            <bug_when>2008-05-27 22:19:04 0000</bug_when>
            <thetext>Hmm... I cannot reproduce the bug.

Steps I did:
  - emerge =sys-kernel/linux-headers-2.6.25-r3
  - set CFLAGS=-g and FEATURES=nostrip
  - emerge =squid-2.6.20
  - rm -rf /var/cache/squid/*
  - /etc/init.d/squid start
  - echo success

Probably I would have to re-emerge glibc for reproducing it.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>Martin.vGagern@gmx.net</who>
            <bug_when>2008-05-28 13:37:53 0000</bug_when>
            <thetext>I compiled against both 2.6.24 and 2.6.25-r3, disassembled all object files, and compared the resulting assembly code. The only relevant difference was in src/tools.o and resulted from a different value for _LINUX_CAPABILITY_VERSION.

This reminded me of a comment I had read in an upstream post, and in fact, http://www.squid-cache.org/bugs/show_bug.cgi?id=2350#c3 comment 3 mentions an issue with that constant while comment 4 contains a patch to fix it.

So with both patches from the attachments of upstream bug 2350 in place, squid compiles and starts cleanly with sys-kernel/linux-headers-2.6.25-r3.
Please add these patches to a new revision of the squid ebuild to close this.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>Martin.vGagern@gmx.net</who>
            <bug_when>2008-05-28 13:47:30 0000</bug_when>
            <thetext>(In reply to comment #0)
&gt; Maybe it&apos;s a duplicate of Bug 221971.

Yes, it is the same reason, the value of _LINUX_CAPABILITY_VERSION. If I had read that before, I might perhaps have saved some time. On the other hand, diffing assembly code of whole projects was a new experience, and the upstream report is still useful for the actual fix. And maybe bug 221971 can profit from these findings.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>mrness@gentoo.org</who>
            <bug_when>2008-05-28 19:51:37 0000</bug_when>
            <thetext>Fixed in squid-2.6.20-r1 and squid-3.0.6-r1. Thanks!

P.S. I still cannot reproduce the bug on squid-2.6.20.</thetext>
          </long_desc>
      
    </bug>

</bugzilla>