yesoce / serf

Automatically exported from code.google.com/p/serf
Apache License 2.0
0 stars 0 forks source link

Buckets v2 check doesn't work on Linux in the test suite (test_aggregate_buckets fails) #134

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
test_aggregate_buckets fails in Serf trunk (2.0) (currently r2221).
(This bug does not occur on 1.3.x branch. Currently all tests pass on 1.3.x 
branch.)

$ scons check
...
/usr/bin/python2.7 build/check.py
== Testing test/testcases/deflate.response ==
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
 <head>
  <title>Test of gzip Content-Encoding</title>
 </head>
 <body>
<h1>This is a test</h1>

<p>This file was created with mod_deflate on the server side.</p>
<pre>curl -i --output gzip.response -H "Accept-Encoding: gzip" 
http://localhost:8080/1.html</pre>

<hr />
<address>Apache</address>
</body></html>
###########################################################
== Testing test/testcases/chunked-empty.response ==
###########################################################
== Testing test/testcases/chunked-trailers.response ==
this is 1 test.
i am a test.this is a test.
Trailer-Test: f
###########################################################
== Testing test/testcases/simple.response ==
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>scotch.ics.uci.edu</title>
<!--base href="http://scotch.ics.uci.edu/" /-->
<link href="default.css" rel="stylesheet" type="text/css" />
</head>

<body>

<p>More to come!</p>

<p><a href="manual/">Apache httpd 2.0 manual</a></p>

<p><a href="CA.cert.pem">Trust our CA!</a></p>

<p><img src="apache_pb.gif" alt="Powered by Apache!" /></p>

</body>

</html>
###########################################################
== Testing test/testcases/chunked.response ==
this is 1 test.
i am a test.this is a test.
###########################################################
== Running the unit tests ==
...........................................F..........................

There was 1 failure:
1) test_aggregate_buckets: test/test_buckets.c:600: assert failed

!!!FAILURES!!!
Runs: 70 Passes: 69 Fails: 1

ERROR: test(s) failed in test_all
scons: *** [check] Error 1
scons: building terminated because of errors.

Original issue reported on code.google.com by Arfrever...@gmail.com on 17 Oct 2013 at 10:36

GoogleCodeExporter commented 9 years ago
While debugging this issue on Ubuntu 64bit, I've noticed that the problem is 
that the check:
#define serf_bucket_get_remaining(b) \
            ((b)->type->read_bucket == serf_buckets_are_v2 ? \
..
doesn't work.

Looking at the code the read_bucket pointer for aggregate buckets is indeed 
pointing to the serf_buckets_are_v2 function. However, in the debugger I see 
that read_bucket points to "serf_buckets_are_v2@plt". So comparison of function 
pointers doesn't work with gcc on Ubuntu/Gentoo (Arfrever's platform).

This function pointer comparison is fundamental to the serf bucket API version 
check (needed in serf 1.4 for get_remaining and dynamic logging), so to be 
fixed before 1.4.

Original comment by lieven.govaerts@gmail.com on 15 Nov 2013 at 1:00

GoogleCodeExporter commented 9 years ago
This is caused by both static and dynamic linking to serf in the test suite.

In this case there are multiple implementations of serfbuckets_are_v2 in 
different modules, with (of course) different addresses.

(I had this problem on Windows before and applied a fix for that, but that fix 
doesn't work on unix)

Original comment by b...@qqmail.nl on 15 Nov 2013 at 3:08

GoogleCodeExporter commented 9 years ago
Updated title with info that it only impacts the test suite per Bert's comment.

Original comment by lieven.govaerts@gmail.com on 30 Dec 2013 at 11:01