Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 195248 - net-misc/memcached-1.2.2 cannot use -P option with more than 1 running thread
Summary: net-misc/memcached-1.2.2 cannot use -P option with more than 1 running thread
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
: 198756 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-10-09 13:59 UTC by marlon
Modified: 2007-11-27 00:51 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description marlon 2007-10-09 13:59:31 UTC
When I emerged memcached-1.2.2 I noticed it didn't run after I used the -P option to write the pidfile to disk.

After looking at the source I noticed the daemon wants to write the pid file to disk after it started its threads. No problem when you run memcached with -t1 or without the -P option, but not a good idea when you have multiple threads writing to the same file pointer.

Reproducible: Always

Steps to Reproduce:
1. emerge memcached1.2.2 (and all other version that compile against posix threads)
2. run memcached with -P pidfile and -t2 or -t3 etc


Actual Results:  
segfault

Expected Results:  
a running daemon

I've written a patch to solve the issue

2672a2673
>       save_pid(getpid(), pid_file);
2721,2723c2722
<     /* save the PID in if we're a daemon */
<     if (daemonize)
<         save_pid(getpid(), pid_file);
---
>
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-11-11 08:36:09 UTC
*** Bug 198756 has been marked as a duplicate of this bug. ***
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2007-11-11 09:12:52 UTC
Would someone be kind enough to contact upstream with this information?
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2007-11-26 22:26:17 UTC
> Would someone be kind enough to contact upstream with this information?
> 

Already known...  http://lists.danga.com/pipermail/memcached/2007-October/005419.html

Please attach a *useful* unified diff next time.
Comment 4 Jakub Moc (RETIRED) gentoo-dev 2007-11-26 22:43:21 UTC
Please, test this ebuild and report back:

http://overlays.gentoo.org/svn/proj/php/testing/migration/net-misc/memcached/
Comment 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2007-11-26 23:59:03 UTC
I'm taking memcached per lisa's retirement email (and the fact that I have connections to the upstream).
Comment 6 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2007-11-27 00:51:15 UTC
This in the main tree now.
I was already using it in my own production stuff, but I hadn't put it back.