Ticket #663 (new enhancement)

Opened 5 months ago

Last modified 5 months ago

Varnish should auto-configure pthread support and VCC_CC

Reported by: slink Owned by:
Priority: high Milestone:
Component: build Version: trunk
Severity: normal Keywords: errno, mt-safety, pthread, reentrant
Cc:

Description

The issues described in  this thread on varnish-misc were found to be root-caused in missing compiler flags for an MT-safety.

I'll attach a patch to amend configure.ac with the ax_pthread macro, which hopefully will do the job of determining the correct settings cross platform.

I've tested this change with trunk (4606) on OpenSolaris? snv_111 with both

  • gcc version 3.4.3 (csl-sol210-3_4-20050802)
  • cc: Sun Ceres C 5.10 SunOS_i386 2009/03/06

and make check has not shown any reproducible issues. (I've seen random issues which were not reproducible and probably timing related, which I will have to investigate further).

Also I have improved auto-configuration of VCC_CC.

I am currently writing a test specific to errno MT-safety.

Attachments

r00663.vtc Download (1.6 KB) - added by slink 5 months ago.
VTC to check errno with VCL inclide code (probably by far not as nice as phks solution in cache_pool.c)
varnish_autoconf_pthread.patch Download (13.7 KB) - added by slink 5 months ago.
Updated patch to pass cmdline CFLAGS trough to VCC_CC

Change History

Changed 5 months ago by slink

When I tested a specific VTC file to check errno behavior, I noticed that phk had already committed [4567]. Great:

###  v1   debug| Child (13140) died signal=6 (core dumped)\n
###  v1   debug| Child (13140) Panic message: Assert error in wrk_herdtimer_thread(), cache_pool.c line 419:\n
###  v1   debug|   Condition(errno_is_multi_threaded != 0) not true.\n
###  v1   debug| thread = (wrk_herdtimer)\n
###  v1   debug| ident = -sfile,-hcritbit,no_waiter\n
###  v1   debug| Backtrace:\n
###  v1   debug|   8072b4d: /export/home/slink/Devel/varnish/trunk/varnish-cache/bin/varnishd/.libs/varnishd'pan_ic+0xa9 [0x8072b4d]\n
###  v1   debug|   807470e: /export/home/slink/Devel/varnish/trunk/varnish-cache/bin/varnishd/.libs/varnishd'wrk_herdtimer_thread+0x86 [0x807470e]\n
###  v1   debug|   fedacd56: /lib/libc.so.1'_thrp_setup+0x7e [0xfedacd56]\n
###  v1   debug|   fedacfe0: /lib/libc.so.1'_lwp_start+0x0 [0xfedacfe0]\n
###  v1   debug| \n
###  v1   debug| \n
###  v1   debug| Child cleanup complete\n

I'll attach my VTC code anyway, just in case...

Changed 5 months ago by slink

VTC to check errno with VCL inclide code (probably by far not as nice as phks solution in cache_pool.c)

Changed 5 months ago by slink

Updated patch to pass cmdline CFLAGS trough to VCC_CC

Changed 5 months ago by slink

For the record: The changeset I was referring to is [4569]

Note: See TracTickets for help on using tickets.