473,385 Members | 1,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Problem: apache plugin initialises C++ statics twice

I work on a large Apache plugin for an Internet Bank. Logging shows
that many or all static objects in the plugin are being initialised
twice at startup time.

The platform is C++, AIX Unix, using the vaccp compiler. The plugin is
built as a shared object (.so) file.

My first thought was that Apache's parent process loads the shared
object and initialises it, and then it forks to a child process which
does the same. But the logging gives the same PID for both
initialisations of each of the static objects. It appears to occur in
the child process.

Running the same classes in a test harness (not a plugin) shows normal
behaviour. The problem appears to be related to the Apache
environment.

Can anyone explain this?

tropos

------------------------------------------------
Reply to this newsgroup, please.
Jan 9 '08 #1
1 1352
tropos wrote:
I work on a large Apache plugin for an Internet Bank. Logging shows
that many or all static objects in the plugin are being initialised
twice at startup time.
I believe this is a known feature of the way Apache loads modules; it's
something like it loads it once to see if it will load without error,
and then loads it again "for real". In my apache module code, I have a
comment something like this which I added when I discovered this behaviour:

// This gets executed approximately once when the module is loaded

Note the word "approximately" in there.

I think you need to work around it by (a) not having anything
substantial in statics, and/or (b) accepting a certain amount of
leakage. I would avoid static objects in dynamically loaded code in any
case; I'm not sure about current compilers, but in the past I would have
worried about whether they are executed at all.

Anyway, the Apache mailing lists are the right place to ask about this;
expect to get a few "OFF TOPIC HERE" replies from this group's regulars....
Phil.
Jan 9 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: mark | last post by:
Should I be seeing Apache.exe running (twice) when I ctrl/alt/delete under processes? I have apache installed on my XP home machine, but it's not started. When I do start it up, I have 3...
6
by: Brian | last post by:
Here's the example: You have a world writable file called lastquote.cfg on your server with a one or two digit number in it. When you run the script below, it reads the value, increments the...
5
by: Stuart MacMartin | last post by:
I have a problem with static lifetime (order of destruction of statics within different cpp files). I have a workaround that happens to work in my case. I'd like to know if this is luck or...
2
by: Thomas Hermann | last post by:
A newbie question: With the config mentioned in the topic, all on localhost, Win xpsp2, i created a caledar-table. The output should be a daily calendar for half a year with about 15 cols. ...
14
by: Jim Michaels | last post by:
mysql_query("START TRANSACTION", $link2); $q2=mysql_query("SELECT pictures.pid AS pid FROM pictures,counter WHERE pictures.pid>counter.pid LIMIT 1", $link2); if ($row2=mysql_fetch_assoc($q2)) {...
2
by: Aravind | last post by:
I have 3rd party dll plugin COM interface, when loaded executes the following functions. public class Test: IPlugin { public void Innitialize(IPluginApp obj, int pluginHandle) { //gets the...
20
by: Aek | last post by:
We recently moved our large codebase over from VS7 to 8 and found that we now get access violations in atexit calls at shutdown when debugging the application in VS2005. This occurs in static...
1
by: marylipscomb | last post by:
I am getting several error messages when we try to upload a file. Here are all the error messages I am getting. I have no idea what they mean. Any help would be greatly appreciated. Thanks in...
3
by: amanjsingh | last post by:
Hi, I am trying to implement Java Web Service using Apache Axis2 and Eclipse as a tool. I have created the basic code and deployed the service using various eclipse plugin but when I try to invoke...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.