passenger 3.0.5 → 3.0.6

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of passenger might be problematic. Click here for more details.

Files changed (198) hide show
  1. data/NEWS +19 -1
  2. data/build/packaging.rb +0 -1
  3. data/doc/cxxapi/Constants_8h_source.html +1 -1
  4. data/doc/cxxapi/Logging_8h_source.html +3 -3
  5. data/doc/cxxapi/MessageChannel_8h_source.html +2 -2
  6. data/doc/cxxapi/Utils_8h_source.html +407 -397
  7. data/doc/cxxapi/namespacePassenger.html +32 -0
  8. data/doc/cxxapi/namespacemembers.html +56 -1
  9. data/doc/cxxapi/namespacemembers_func.html +3 -0
  10. data/doc/cxxapi/ngx__http__passenger__module_8h_source.html +5 -5
  11. data/ext/apache2/Hooks.cpp +1 -1
  12. data/ext/common/AgentBase.cpp +86 -11
  13. data/ext/common/Constants.h +1 -1
  14. data/ext/common/Logging.h +3 -3
  15. data/ext/common/LoggingAgent/FilterSupport.h +1 -0
  16. data/ext/common/LoggingAgent/Main.cpp +8 -1
  17. data/ext/common/MessageChannel.h +2 -2
  18. data/ext/common/Utils.cpp +27 -3
  19. data/ext/common/Utils.h +10 -0
  20. data/ext/common/Watchdog.cpp +27 -1
  21. data/ext/nginx/HelperAgent.cpp +8 -8
  22. data/ext/oxt/thread.hpp +2 -2
  23. data/lib/phusion_passenger.rb +1 -1
  24. data/lib/phusion_passenger/abstract_installer.rb +6 -0
  25. data/lib/phusion_passenger/abstract_request_handler.rb +13 -2
  26. data/lib/phusion_passenger/analytics_logger.rb +15 -4
  27. data/lib/phusion_passenger/dependencies.rb +11 -26
  28. data/lib/phusion_passenger/platform_info.rb +96 -5
  29. data/lib/phusion_passenger/platform_info/apache.rb +13 -3
  30. data/lib/phusion_passenger/platform_info/compiler.rb +5 -0
  31. data/lib/phusion_passenger/rack/application_spawner.rb +3 -2
  32. data/lib/phusion_passenger/standalone/runtime_installer.rb +0 -1
  33. data/lib/phusion_passenger/standalone/start_command.rb +15 -8
  34. data/lib/phusion_passenger/templates/standalone/config.erb +1 -0
  35. metadata +5 -182
  36. data/doc/rdoc/classes/ConditionVariable.html +0 -215
  37. data/doc/rdoc/classes/Exception.html +0 -120
  38. data/doc/rdoc/classes/GC.html +0 -113
  39. data/doc/rdoc/classes/IO.html +0 -221
  40. data/doc/rdoc/classes/PhusionPassenger.html +0 -397
  41. data/doc/rdoc/classes/PhusionPassenger/AbstractInstaller.html +0 -180
  42. data/doc/rdoc/classes/PhusionPassenger/AbstractRequestHandler.html +0 -647
  43. data/doc/rdoc/classes/PhusionPassenger/AbstractServer.html +0 -654
  44. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/InvalidPassword.html +0 -92
  45. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerAlreadyStarted.html +0 -97
  46. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerError.html +0 -96
  47. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerNotStarted.html +0 -97
  48. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/UnknownMessage.html +0 -96
  49. data/doc/rdoc/classes/PhusionPassenger/AbstractServerCollection.html +0 -619
  50. data/doc/rdoc/classes/PhusionPassenger/AdminTools.html +0 -142
  51. data/doc/rdoc/classes/PhusionPassenger/AdminTools/MemoryStats.html +0 -368
  52. data/doc/rdoc/classes/PhusionPassenger/AdminTools/MemoryStats/Process.html +0 -231
  53. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance.html +0 -588
  54. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/CorruptedDirectoryError.html +0 -92
  55. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/GenerationsAbsentError.html +0 -92
  56. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Group.html +0 -147
  57. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Process.html +0 -279
  58. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/RoleDeniedError.html +0 -92
  59. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/StaleDirectoryError.html +0 -92
  60. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Stats.html +0 -123
  61. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/UnsupportedGenerationStructureVersionError.html +0 -92
  62. data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger.html +0 -368
  63. data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger/Lock.html +0 -194
  64. data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger/Log.html +0 -299
  65. data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger/SharedData.html +0 -206
  66. data/doc/rdoc/classes/PhusionPassenger/AppInitError.html +0 -155
  67. data/doc/rdoc/classes/PhusionPassenger/AppProcess.html +0 -367
  68. data/doc/rdoc/classes/PhusionPassenger/ClassicRails.html +0 -95
  69. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/ApplicationSpawner.html +0 -351
  70. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/ApplicationSpawner/Error.html +0 -98
  71. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/CGIFixed.html +0 -200
  72. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/FrameworkSpawner.html +0 -410
  73. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/FrameworkSpawner/Error.html +0 -98
  74. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/RequestHandler.html +0 -156
  75. data/doc/rdoc/classes/PhusionPassenger/ClassicRailsExtensions.html +0 -115
  76. data/doc/rdoc/classes/PhusionPassenger/ClassicRailsExtensions/AnalyticsLogging.html +0 -202
  77. data/doc/rdoc/classes/PhusionPassenger/ConsoleTextTemplate.html +0 -172
  78. data/doc/rdoc/classes/PhusionPassenger/DebugLogging.html +0 -273
  79. data/doc/rdoc/classes/PhusionPassenger/FrameworkInitError.html +0 -145
  80. data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +0 -162
  81. data/doc/rdoc/classes/PhusionPassenger/InitializationError.html +0 -141
  82. data/doc/rdoc/classes/PhusionPassenger/InvalidPath.html +0 -92
  83. data/doc/rdoc/classes/PhusionPassenger/MessageChannel.html +0 -673
  84. data/doc/rdoc/classes/PhusionPassenger/MessageChannel/InvalidHashError.html +0 -92
  85. data/doc/rdoc/classes/PhusionPassenger/MessageClient.html +0 -415
  86. data/doc/rdoc/classes/PhusionPassenger/NativeSupportLoader.html +0 -134
  87. data/doc/rdoc/classes/PhusionPassenger/Packaging.html +0 -129
  88. data/doc/rdoc/classes/PhusionPassenger/PlatformInfo.html +0 -1972
  89. data/doc/rdoc/classes/PhusionPassenger/Plugin.html +0 -237
  90. data/doc/rdoc/classes/PhusionPassenger/Rack.html +0 -91
  91. data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner.html +0 -312
  92. data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner/Error.html +0 -98
  93. data/doc/rdoc/classes/PhusionPassenger/Rack/RequestHandler.html +0 -218
  94. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions.html +0 -114
  95. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging.html +0 -259
  96. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ACExtension.html +0 -139
  97. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ASBenchmarkableExtension.html +0 -118
  98. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ExceptionLogger.html +0 -135
  99. data/doc/rdoc/classes/PhusionPassenger/SpawnManager.html +0 -378
  100. data/doc/rdoc/classes/PhusionPassenger/Standalone.html +0 -111
  101. data/doc/rdoc/classes/PhusionPassenger/Standalone/AppFinder.html +0 -252
  102. data/doc/rdoc/classes/PhusionPassenger/Standalone/Command.html +0 -161
  103. data/doc/rdoc/classes/PhusionPassenger/Standalone/ConfigFile.html +0 -368
  104. data/doc/rdoc/classes/PhusionPassenger/Standalone/ConfigFile/DisallowedContextError.html +0 -132
  105. data/doc/rdoc/classes/PhusionPassenger/Standalone/HelpCommand.html +0 -151
  106. data/doc/rdoc/classes/PhusionPassenger/Standalone/Main.html +0 -189
  107. data/doc/rdoc/classes/PhusionPassenger/Standalone/PackageRuntimeCommand.html +0 -177
  108. data/doc/rdoc/classes/PhusionPassenger/Standalone/RuntimeInstaller.html +0 -341
  109. data/doc/rdoc/classes/PhusionPassenger/Standalone/StartCommand.html +0 -203
  110. data/doc/rdoc/classes/PhusionPassenger/Standalone/StatusCommand.html +0 -156
  111. data/doc/rdoc/classes/PhusionPassenger/Standalone/StopCommand.html +0 -168
  112. data/doc/rdoc/classes/PhusionPassenger/Standalone/Utils.html +0 -86
  113. data/doc/rdoc/classes/PhusionPassenger/Standalone/VersionCommand.html +0 -135
  114. data/doc/rdoc/classes/PhusionPassenger/UnknownError.html +0 -125
  115. data/doc/rdoc/classes/PhusionPassenger/Utils.html +0 -1543
  116. data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher.html +0 -204
  117. data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher/DirInfo.html +0 -171
  118. data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher/FileInfo.html +0 -140
  119. data/doc/rdoc/classes/PhusionPassenger/Utils/HostsFileParser.html +0 -260
  120. data/doc/rdoc/classes/PhusionPassenger/Utils/PseudoIO.html +0 -194
  121. data/doc/rdoc/classes/PhusionPassenger/Utils/RewindableInput.html +0 -265
  122. data/doc/rdoc/classes/PhusionPassenger/Utils/RewindableInput/Tempfile.html +0 -120
  123. data/doc/rdoc/classes/PhusionPassenger/Utils/UnseekableSocket.html +0 -561
  124. data/doc/rdoc/classes/PhusionPassenger/VersionNotFound.html +0 -140
  125. data/doc/rdoc/classes/PhusionPassenger/WSGI.html +0 -89
  126. data/doc/rdoc/classes/PhusionPassenger/WSGI/ApplicationSpawner.html +0 -182
  127. data/doc/rdoc/classes/Process.html +0 -115
  128. data/doc/rdoc/classes/Signal.html +0 -139
  129. data/doc/rdoc/created.rid +0 -1
  130. data/doc/rdoc/files/DEVELOPERS_TXT.html +0 -280
  131. data/doc/rdoc/files/README.html +0 -157
  132. data/doc/rdoc/files/lib/phusion_passenger/abstract_installer_rb.html +0 -130
  133. data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +0 -135
  134. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_collection_rb.html +0 -126
  135. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +0 -128
  136. data/doc/rdoc/files/lib/phusion_passenger/admin_tools/memory_stats_rb.html +0 -126
  137. data/doc/rdoc/files/lib/phusion_passenger/admin_tools/server_instance_rb.html +0 -132
  138. data/doc/rdoc/files/lib/phusion_passenger/admin_tools_rb.html +0 -122
  139. data/doc/rdoc/files/lib/phusion_passenger/analytics_logger_rb.html +0 -129
  140. data/doc/rdoc/files/lib/phusion_passenger/app_process_rb.html +0 -127
  141. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/application_spawner_rb.html +0 -141
  142. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/cgi_fixed_rb.html +0 -126
  143. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/framework_spawner_rb.html +0 -146
  144. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/request_handler_rb.html +0 -125
  145. data/doc/rdoc/files/lib/phusion_passenger/classic_rails_extensions/init_rb.html +0 -132
  146. data/doc/rdoc/files/lib/phusion_passenger/console_text_template_rb.html +0 -126
  147. data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +0 -122
  148. data/doc/rdoc/files/lib/phusion_passenger/debug_logging_rb.html +0 -122
  149. data/doc/rdoc/files/lib/phusion_passenger/dependencies_rb.html +0 -147
  150. data/doc/rdoc/files/lib/phusion_passenger/exceptions_rb.html +0 -122
  151. data/doc/rdoc/files/lib/phusion_passenger/html_template_rb.html +0 -127
  152. data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +0 -120
  153. data/doc/rdoc/files/lib/phusion_passenger/message_client_rb.html +0 -127
  154. data/doc/rdoc/files/lib/phusion_passenger/native_support_rb.html +0 -132
  155. data/doc/rdoc/files/lib/phusion_passenger/packaging_rb.html +0 -122
  156. data/doc/rdoc/files/lib/phusion_passenger/platform_info/apache_rb.html +0 -127
  157. data/doc/rdoc/files/lib/phusion_passenger/platform_info/binary_compatibility_rb.html +0 -129
  158. data/doc/rdoc/files/lib/phusion_passenger/platform_info/compiler_rb.html +0 -127
  159. data/doc/rdoc/files/lib/phusion_passenger/platform_info/curl_rb.html +0 -126
  160. data/doc/rdoc/files/lib/phusion_passenger/platform_info/documentation_tools_rb.html +0 -126
  161. data/doc/rdoc/files/lib/phusion_passenger/platform_info/linux_rb.html +0 -126
  162. data/doc/rdoc/files/lib/phusion_passenger/platform_info/operating_system_rb.html +0 -127
  163. data/doc/rdoc/files/lib/phusion_passenger/platform_info/ruby_rb.html +0 -128
  164. data/doc/rdoc/files/lib/phusion_passenger/platform_info/zlib_rb.html +0 -126
  165. data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +0 -122
  166. data/doc/rdoc/files/lib/phusion_passenger/plugin_rb.html +0 -127
  167. data/doc/rdoc/files/lib/phusion_passenger/public_api_rb.html +0 -127
  168. data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +0 -137
  169. data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +0 -125
  170. data/doc/rdoc/files/lib/phusion_passenger/rails3_extensions/init_rb.html +0 -127
  171. data/doc/rdoc/files/lib/phusion_passenger/simple_benchmarking_rb.html +0 -122
  172. data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +0 -160
  173. data/doc/rdoc/files/lib/phusion_passenger/standalone/app_finder_rb.html +0 -127
  174. data/doc/rdoc/files/lib/phusion_passenger/standalone/command_rb.html +0 -136
  175. data/doc/rdoc/files/lib/phusion_passenger/standalone/config_file_rb.html +0 -126
  176. data/doc/rdoc/files/lib/phusion_passenger/standalone/help_command_rb.html +0 -126
  177. data/doc/rdoc/files/lib/phusion_passenger/standalone/main_rb.html +0 -126
  178. data/doc/rdoc/files/lib/phusion_passenger/standalone/package_runtime_command_rb.html +0 -127
  179. data/doc/rdoc/files/lib/phusion_passenger/standalone/runtime_installer_rb.html +0 -133
  180. data/doc/rdoc/files/lib/phusion_passenger/standalone/start_command_rb.html +0 -136
  181. data/doc/rdoc/files/lib/phusion_passenger/standalone/status_command_rb.html +0 -126
  182. data/doc/rdoc/files/lib/phusion_passenger/standalone/stop_command_rb.html +0 -126
  183. data/doc/rdoc/files/lib/phusion_passenger/standalone/utils_rb.html +0 -126
  184. data/doc/rdoc/files/lib/phusion_passenger/standalone/version_command_rb.html +0 -127
  185. data/doc/rdoc/files/lib/phusion_passenger/utils/file_system_watcher_rb.html +0 -126
  186. data/doc/rdoc/files/lib/phusion_passenger/utils/hosts_file_parser_rb.html +0 -120
  187. data/doc/rdoc/files/lib/phusion_passenger/utils/rewindable_input_rb.html +0 -100
  188. data/doc/rdoc/files/lib/phusion_passenger/utils/tmpdir_rb.html +0 -122
  189. data/doc/rdoc/files/lib/phusion_passenger/utils/unseekable_socket_rb.html +0 -126
  190. data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +0 -179
  191. data/doc/rdoc/files/lib/phusion_passenger/wsgi/application_spawner_rb.html +0 -132
  192. data/doc/rdoc/fr_class_index.html +0 -139
  193. data/doc/rdoc/fr_file_index.html +0 -108
  194. data/doc/rdoc/fr_method_index.html +0 -439
  195. data/doc/rdoc/index.html +0 -26
  196. data/doc/rdoc/rdoc-style.css +0 -187
  197. data/ext/common/libboost_oxt/aggregate.cpp +0 -10
  198. data/ext/common/libpassenger_common/aggregate.cpp +0 -16
@@ -164,6 +164,8 @@ string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="gr
164
164
  <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Check whether the specified directory is a valid Rack application root directory. <a href="group__Support.html#ga53969f8e3ee68d1d99ffe75af8db9be8"></a><br/></td></tr>
165
165
  <tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Support.html#gaaec51d2912999d611994c49341f36247">verifyWSGIDir</a> (const string &amp;dir, CachedFileStat *cstat=0, unsigned int throttleRate=0)</td></tr>
166
166
  <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Check whether the specified directory is a valid WSGI application root directory. <a href="group__Support.html#gaaec51d2912999d611994c49341f36247"></a><br/></td></tr>
167
+ <tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacePassenger.html#ad233ce971fa0e937182c637bf2d1f105">runAndPrintExceptions</a> (const function&lt; void()&gt; &amp;func, bool toAbort)</td></tr>
168
+ <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Runs the given function and catches any tracable_exceptions. <a href="#ad233ce971fa0e937182c637bf2d1f105"></a><br/></td></tr>
167
169
  <tr><td class="memItemLeft" align="right" valign="top">string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacePassenger.html#a1d0a66b0e207c46dc6124ff3b2f331e6">getHostName</a> ()</td></tr>
168
170
  <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the system's host name. <a href="#a1d0a66b0e207c46dc6124ff3b2f331e6"></a><br/></td></tr>
169
171
  <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a979cb43cef743bf261c329b13e712366"></a><!-- doxytag: member="Passenger::getSignalName" ref="a979cb43cef743bf261c329b13e712366" args="(int sig)" -->
@@ -543,6 +545,36 @@ string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="na
543
545
  <p>One should call this every time one forks a child process; non-default signal masks/handler dispositions can cause all kinds of weird quirks, like waitpid() malfunctioning on OS X.</p>
544
546
  <p>This function is async-signal safe. </p>
545
547
 
548
+ </div>
549
+ </div>
550
+ <a class="anchor" id="ad233ce971fa0e937182c637bf2d1f105"></a><!-- doxytag: member="Passenger::runAndPrintExceptions" ref="ad233ce971fa0e937182c637bf2d1f105" args="(const function&lt; void()&gt; &amp;func, bool toAbort)" -->
551
+ <div class="memitem">
552
+ <div class="memproto">
553
+ <table class="memname">
554
+ <tr>
555
+ <td class="memname">void Passenger::runAndPrintExceptions </td>
556
+ <td>(</td>
557
+ <td class="paramtype">const function&lt; void()&gt; &amp;&nbsp;</td>
558
+ <td class="paramname"> <em>func</em>, </td>
559
+ </tr>
560
+ <tr>
561
+ <td class="paramkey"></td>
562
+ <td></td>
563
+ <td class="paramtype">bool&nbsp;</td>
564
+ <td class="paramname"> <em>toAbort</em></td><td>&nbsp;</td>
565
+ </tr>
566
+ <tr>
567
+ <td></td>
568
+ <td>)</td>
569
+ <td></td><td></td><td></td>
570
+ </tr>
571
+ </table>
572
+ </div>
573
+ <div class="memdoc">
574
+
575
+ <p>Runs the given function and catches any tracable_exceptions. </p>
576
+ <p>Upon catching such an exception, its message and backtrace will be printed. If toAbort is true then it will call abort(), otherwise the exception is swallowed. thread_interrupted and all other exceptions are silently propagated. </p>
577
+
546
578
  </div>
547
579
  </div>
548
580
  </div>
@@ -33,12 +33,32 @@
33
33
  <li><a href="namespacemembers_eval.html"><span>Enumerator</span></a></li>
34
34
  </ul>
35
35
  </div>
36
+ <div class="tabs">
37
+ <ul>
38
+ <li><a href="#index_a"><span>a</span></a></li>
39
+ <li><a href="#index_c"><span>c</span></a></li>
40
+ <li><a href="#index_e"><span>e</span></a></li>
41
+ <li><a href="#index_f"><span>f</span></a></li>
42
+ <li><a href="#index_g"><span>g</span></a></li>
43
+ <li><a href="#index_m"><span>m</span></a></li>
44
+ <li><a href="#index_p"><span>p</span></a></li>
45
+ <li><a href="#index_r"><span>r</span></a></li>
46
+ <li><a href="#index_s"><span>s</span></a></li>
47
+ <li><a href="#index_v"><span>v</span></a></li>
48
+ </ul>
49
+ </div>
36
50
  </div>
37
51
  <div class="contents">
38
- Here is a list of all documented namespace members with links to the namespaces they belong to:<ul>
52
+ Here is a list of all documented namespace members with links to the namespaces they belong to:
53
+
54
+ <h3><a class="anchor" id="index_a">- a -</a></h3><ul>
39
55
  <li>AbstractSpawnManagerPtr
40
56
  : <a class="el" href="namespacePassenger.html#afd60d942a89fbb7f306e330d75704570">Passenger</a>
41
57
  </li>
58
+ </ul>
59
+
60
+
61
+ <h3><a class="anchor" id="index_c">- c -</a></h3><ul>
42
62
  <li>canonicalizePath()
43
63
  : <a class="el" href="group__Support.html#gaf3b0a483f0a252ae08d9de9f8b267d36">Passenger</a>
44
64
  </li>
@@ -48,6 +68,10 @@ Here is a list of all documented namespace members with links to the namespaces
48
68
  <li>createFile()
49
69
  : <a class="el" href="group__Support.html#ga6f414070373465da2e12947463f69953">Passenger</a>
50
70
  </li>
71
+ </ul>
72
+
73
+
74
+ <h3><a class="anchor" id="index_e">- e -</a></h3><ul>
51
75
  <li>escapeForXml()
52
76
  : <a class="el" href="group__Support.html#gae74addedf73782a1eb1f6dd48d6fce06">Passenger</a>
53
77
  </li>
@@ -57,6 +81,10 @@ Here is a list of all documented namespace members with links to the namespaces
57
81
  <li>extractDirName()
58
82
  : <a class="el" href="group__Support.html#gae651ece5281f22dc5fc974079f7c9187">Passenger</a>
59
83
  </li>
84
+ </ul>
85
+
86
+
87
+ <h3><a class="anchor" id="index_f">- f -</a></h3><ul>
60
88
  <li>fileExists()
61
89
  : <a class="el" href="group__Support.html#ga2a62e38a72c6c65992e3361f6d80c7ef">Passenger</a>
62
90
  </li>
@@ -75,6 +103,10 @@ Here is a list of all documented namespace members with links to the namespaces
75
103
  <li>FT_REGULAR
76
104
  : <a class="el" href="namespacePassenger.html#a14174b712df6046cb823cde43d7ef07da1538596a928321d1a282c6bb06e80563">Passenger</a>
77
105
  </li>
106
+ </ul>
107
+
108
+
109
+ <h3><a class="anchor" id="index_g">- g -</a></h3><ul>
78
110
  <li>getFileType()
79
111
  : <a class="el" href="group__Support.html#ga15298b031377d3ecb80295bd5b1a8180">Passenger</a>
80
112
  </li>
@@ -90,9 +122,17 @@ Here is a list of all documented namespace members with links to the namespaces
90
122
  <li>getSystemTempDir()
91
123
  : <a class="el" href="group__Support.html#ga68f4105c5a8e510520b5ea3eecb66213">Passenger</a>
92
124
  </li>
125
+ </ul>
126
+
127
+
128
+ <h3><a class="anchor" id="index_m">- m -</a></h3><ul>
93
129
  <li>makeDirTree()
94
130
  : <a class="el" href="namespacePassenger.html#a448f25263af0b37b91caee3d294ec4aa">Passenger</a>
95
131
  </li>
132
+ </ul>
133
+
134
+
135
+ <h3><a class="anchor" id="index_p">- p -</a></h3><ul>
96
136
  <li>parseModeString()
97
137
  : <a class="el" href="namespacePassenger.html#ada53f5a9bdcf3d22d4a710e7ea3678e9">Passenger</a>
98
138
  </li>
@@ -105,6 +145,10 @@ Here is a list of all documented namespace members with links to the namespaces
105
145
  <li>ptr()
106
146
  : <a class="el" href="group__Support.html#ga41b6c4a82fed72531a147de0505a8396">Passenger</a>
107
147
  </li>
148
+ </ul>
149
+
150
+
151
+ <h3><a class="anchor" id="index_r">- r -</a></h3><ul>
108
152
  <li>removeDirTree()
109
153
  : <a class="el" href="namespacePassenger.html#a8422d210cbd2f62d21254415b5a7f747">Passenger</a>
110
154
  </li>
@@ -114,9 +158,20 @@ Here is a list of all documented namespace members with links to the namespaces
114
158
  <li>resolveSymlink()
115
159
  : <a class="el" href="group__Support.html#gac3d2b3d608188527d888e63d22c5163c">Passenger</a>
116
160
  </li>
161
+ <li>runAndPrintExceptions()
162
+ : <a class="el" href="namespacePassenger.html#ad233ce971fa0e937182c637bf2d1f105">Passenger</a>
163
+ </li>
164
+ </ul>
165
+
166
+
167
+ <h3><a class="anchor" id="index_s">- s -</a></h3><ul>
117
168
  <li>SpawnManagerPtr
118
169
  : <a class="el" href="namespacePassenger.html#a6ab2d566ff87a2676c23d8aa40204587">Passenger</a>
119
170
  </li>
171
+ </ul>
172
+
173
+
174
+ <h3><a class="anchor" id="index_v">- v -</a></h3><ul>
120
175
  <li>verifyRackDir()
121
176
  : <a class="el" href="group__Support.html#ga53969f8e3ee68d1d99ffe75af8db9be8">Passenger</a>
122
177
  </li>
@@ -93,6 +93,9 @@
93
93
  <li>resolveSymlink()
94
94
  : <a class="el" href="group__Support.html#gac3d2b3d608188527d888e63d22c5163c">Passenger</a>
95
95
  </li>
96
+ <li>runAndPrintExceptions()
97
+ : <a class="el" href="namespacePassenger.html#ad233ce971fa0e937182c637bf2d1f105">Passenger</a>
98
+ </li>
96
99
  <li>verifyRackDir()
97
100
  : <a class="el" href="group__Support.html#ga53969f8e3ee68d1d99ffe75af8db9be8">Passenger</a>
98
101
  </li>
@@ -71,18 +71,18 @@
71
71
  <a name="l00046"></a>00046 <span class="comment">/**</span>
72
72
  <a name="l00047"></a>00047 <span class="comment"> * A static schema string to be assigned to Nginx &#39;upstream&#39; strctures.</span>
73
73
  <a name="l00048"></a>00048 <span class="comment"> */</span>
74
- <a name="l00049"></a>00049 <span class="keyword">extern</span> ngx_str_t passenger_schema_string;
74
+ <a name="l00049"></a>00049 <span class="keyword">extern</span> ngx_str_t passenger_schema_string;
75
75
  <a name="l00050"></a>00050
76
- <a name="l00051"></a>00051 <span class="keyword">extern</span> ngx_str_t passenger_placeholder_upstream_address;
76
+ <a name="l00051"></a>00051 <span class="keyword">extern</span> ngx_str_t passenger_placeholder_upstream_address;
77
77
  <a name="l00052"></a>00052 <span class="comment"></span>
78
78
  <a name="l00053"></a>00053 <span class="comment">/**</span>
79
79
  <a name="l00054"></a>00054 <span class="comment"> * A CachedFileStat object used for caching stat() calls.</span>
80
80
  <a name="l00055"></a>00055 <span class="comment"> */</span>
81
- <a name="l00056"></a>00056 <span class="keyword">extern</span> CachedFileStat *passenger_stat_cache;
81
+ <a name="l00056"></a>00056 <span class="keyword">extern</span> PassengerCachedFileStat *passenger_stat_cache;
82
82
  <a name="l00057"></a>00057
83
- <a name="l00058"></a>00058 <span class="keyword">extern</span> AgentsStarter *passenger_agents_starter;
83
+ <a name="l00058"></a>00058 <span class="keyword">extern</span> AgentsStarter *passenger_agents_starter;
84
84
  <a name="l00059"></a>00059
85
- <a name="l00060"></a>00060 <span class="keyword">extern</span> ngx_cycle_t *passenger_current_cycle;
85
+ <a name="l00060"></a>00060 <span class="keyword">extern</span> ngx_cycle_t *passenger_current_cycle;
86
86
  <a name="l00061"></a>00061
87
87
  <a name="l00062"></a>00062 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_NGINX_MODULE_H_ */</span>
88
88
  <a name="l00063"></a>00063
@@ -1058,7 +1058,7 @@ private:
1058
1058
  addHeader(headers, env[i].key, env[i].val);
1059
1059
  }
1060
1060
 
1061
- if (config->useUnionStation()) {
1061
+ if (!log->isNull()) {
1062
1062
  addHeader(headers, "PASSENGER_GROUP_NAME",
1063
1063
  config->getAppGroupName(appRoot).c_str());
1064
1064
  addHeader(headers, "PASSENGER_TXN_ID", log->getTxnId().c_str());
@@ -52,11 +52,10 @@ static const char digits[] = {
52
52
  '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'
53
53
  };
54
54
 
55
- // Pre-allocate some static memory for use in signal handlers in case the stack isn't usable.
56
- static char messageBuf[1024];
57
- #ifdef LIBC_HAS_BACKTRACE_FUNC
58
- static void *backtraceStore[512];
59
- #endif
55
+ // Pre-allocate an alternative stack for use in signal handlers in case
56
+ // the normal stack isn't usable.
57
+ static char *alternativeStack;
58
+ static unsigned int alternativeStackSize;
60
59
 
61
60
  static void
62
61
  ignoreSigpipe() {
@@ -117,6 +116,27 @@ appendULL(char *buf, unsigned long long value) {
117
116
  return buf + size;
118
117
  }
119
118
 
119
+ static char *
120
+ appendSignalName(char *buf, int signo) {
121
+ switch (signo) {
122
+ case SIGABRT:
123
+ buf = appendText(buf, "SIGABRT");
124
+ break;
125
+ case SIGSEGV:
126
+ buf = appendText(buf, "SIGSEGV");
127
+ break;
128
+ case SIGBUS:
129
+ buf = appendText(buf, "SIGBUS");
130
+ break;
131
+ default:
132
+ return appendULL(buf, (unsigned long long) signo);
133
+ }
134
+ buf = appendText(buf, "(");
135
+ buf = appendULL(buf, (unsigned long long) signo);
136
+ buf = appendText(buf, ")");
137
+ return buf;
138
+ }
139
+
120
140
  #define SI_CODE_HANDLER(name) \
121
141
  case name: \
122
142
  buf = appendText(buf, #name); \
@@ -125,6 +145,8 @@ appendULL(char *buf, unsigned long long value) {
125
145
  // Must be async signal safe.
126
146
  static char *
127
147
  appendSignalReason(char *buf, siginfo_t *info) {
148
+ bool handled = true;
149
+
128
150
  switch (info->si_code) {
129
151
  SI_CODE_HANDLER(SI_USER);
130
152
  #ifdef SI_KERNEL
@@ -141,8 +163,31 @@ appendSignalReason(char *buf, siginfo_t *info) {
141
163
  SI_CODE_HANDLER(SI_TKILL);
142
164
  #endif
143
165
  default:
144
- buf = appendText(buf, "#");
145
- buf = appendULL(buf, (unsigned long long) info->si_code);
166
+ switch (info->si_signo) {
167
+ case SIGSEGV:
168
+ switch (info->si_code) {
169
+ SI_CODE_HANDLER(SEGV_MAPERR);
170
+ SI_CODE_HANDLER(SEGV_ACCERR);
171
+ default:
172
+ handled = false;
173
+ break;
174
+ }
175
+ break;
176
+ case SIGBUS:
177
+ switch (info->si_code) {
178
+ SI_CODE_HANDLER(BUS_ADRALN);
179
+ SI_CODE_HANDLER(BUS_ADRERR);
180
+ SI_CODE_HANDLER(BUS_OBJERR);
181
+ default:
182
+ handled = false;
183
+ break;
184
+ }
185
+ break;
186
+ };
187
+ if (!handled) {
188
+ buf = appendText(buf, "#");
189
+ buf = appendULL(buf, (unsigned long long) info->si_code);
190
+ }
146
191
  break;
147
192
  }
148
193
 
@@ -159,6 +204,11 @@ appendSignalReason(char *buf, siginfo_t *info) {
159
204
  static void
160
205
  abortHandler(int signo, siginfo_t *info, void *ctx) {
161
206
  pid_t pid = getpid();
207
+ char messageBuf[1024];
208
+ #ifdef LIBC_HAS_BACKTRACE_FUNC
209
+ void *backtraceStore[512];
210
+ backtraceStore[0] = '\0'; // Don't let gdb print uninitialized contents.
211
+ #endif
162
212
 
163
213
  char *end = messageBuf;
164
214
  end = appendText(end, "[ pid=");
@@ -166,7 +216,7 @@ abortHandler(int signo, siginfo_t *info, void *ctx) {
166
216
  end = appendText(end, ", timestamp=");
167
217
  end = appendULL(end, (unsigned long long) time(NULL));
168
218
  end = appendText(end, " ] Process aborted! signo=");
169
- end = appendULL(end, (unsigned long long) signo);
219
+ end = appendSignalName(end, signo);
170
220
  end = appendText(end, ", reason=");
171
221
  end = appendSignalReason(end, info);
172
222
 
@@ -181,9 +231,11 @@ abortHandler(int signo, siginfo_t *info, void *ctx) {
181
231
  write(STDERR_FILENO, messageBuf, end - messageBuf);
182
232
 
183
233
  #ifdef LIBC_HAS_BACKTRACE_FUNC
184
- /* For some reason, it would appear that the ABRT signal
185
- * handler has a deadline on some systems: the process will
234
+ /* For some reason, it would appear that fatal signal
235
+ * handlers have a deadline on some systems: the process will
186
236
  * be killed if the signal handler doesn't finish in time.
237
+ * This killing appears to be triggered at some system calls,
238
+ * including but not limited to nanosleep().
187
239
  * backtrace() might be slow and running crash-watch is
188
240
  * definitely slow, so we do our work in a child process
189
241
  * in order not to be affected by the deadline. But preferably
@@ -226,16 +278,39 @@ abortHandler(int signo, siginfo_t *info, void *ctx) {
226
278
  #endif
227
279
 
228
280
  // Run default signal handler.
229
- kill(getpid(), SIGABRT);
281
+ kill(getpid(), signo);
230
282
  }
231
283
 
232
284
  static void
233
285
  installAbortHandler() {
286
+ alternativeStackSize = MINSIGSTKSZ + 64 * 1024;
287
+ alternativeStack = (char *) malloc(alternativeStackSize);
288
+ if (alternativeStack == NULL) {
289
+ fprintf(stderr, "Cannot allocate an alternative with a size of %u bytes!\n",
290
+ alternativeStackSize);
291
+ fflush(stderr);
292
+ abort();
293
+ }
294
+
295
+ stack_t stack;
296
+ stack.ss_sp = alternativeStack;
297
+ stack.ss_size = alternativeStackSize;
298
+ stack.ss_flags = 0;
299
+ if (sigaltstack(&stack, NULL) != 0) {
300
+ int e = errno;
301
+ fprintf(stderr, "Cannot install an alternative stack for use in signal handlers: %s (%d)\n",
302
+ strerror(e), e);
303
+ fflush(stderr);
304
+ abort();
305
+ }
306
+
234
307
  struct sigaction action;
235
308
  action.sa_sigaction = abortHandler;
236
309
  action.sa_flags = SA_RESETHAND | SA_SIGINFO;
237
310
  sigemptyset(&action.sa_mask);
238
311
  sigaction(SIGABRT, &action, NULL);
312
+ sigaction(SIGSEGV, &action, NULL);
313
+ sigaction(SIGBUS, &action, NULL);
239
314
  }
240
315
 
241
316
  bool
@@ -26,7 +26,7 @@
26
26
  #define _PASSENGER_CONSTANTS_H_
27
27
 
28
28
  /* Don't forget to update lib/phusion_passenger.rb too. */
29
- #define PASSENGER_VERSION "3.0.5"
29
+ #define PASSENGER_VERSION "3.0.6"
30
30
 
31
31
  #define FEEDBACK_FD 3
32
32
 
@@ -550,7 +550,7 @@ public:
550
550
  maxConnectTries = 1;
551
551
  }
552
552
  maxConnectTries = 10;
553
- reconnectTimeout = 60 * 1000000;
553
+ reconnectTimeout = 1000000;
554
554
  nextReconnectTime = 0;
555
555
  }
556
556
 
@@ -649,7 +649,7 @@ public:
649
649
 
650
650
  // Failed to connect.
651
651
  P_WARN("Cannot connect to the logging agent (" << serverAddress << "); " <<
652
- "retrying in " << reconnectTimeout / 1000000 << " seconds.");
652
+ "retrying in " << reconnectTimeout / 1000000 << " second(s).");
653
653
  nextReconnectTime = SystemTime::getUsec() + reconnectTimeout;
654
654
  }
655
655
  }
@@ -711,7 +711,7 @@ public:
711
711
 
712
712
  // Failed to connect.
713
713
  P_WARN("Cannot connect to the logging agent (" << serverAddress << "); " <<
714
- "retrying in " << reconnectTimeout / 1000000 << " seconds.");
714
+ "retrying in " << reconnectTimeout / 1000000 << " second(s).");
715
715
  nextReconnectTime = SystemTime::getUsec() + reconnectTimeout;
716
716
  }
717
717
  return ptr(new AnalyticsLog());
@@ -34,6 +34,7 @@
34
34
  #include <string>
35
35
  #include <set>
36
36
  #include <regex.h>
37
+ #include <cstdio>
37
38
  #include <cstring>
38
39
 
39
40
  #include <StaticString.h>
@@ -53,6 +53,7 @@ using namespace Passenger;
53
53
 
54
54
  static struct ev_loop *eventLoop;
55
55
  static LoggingServer *loggingServer;
56
+ static int exitCode = 0;
56
57
 
57
58
  static struct ev_loop *
58
59
  createEventLoop() {
@@ -119,6 +120,12 @@ void
119
120
  caughtExitSignal(ev::sig &watcher, int revents) {
120
121
  P_DEBUG("Caught signal, exiting...");
121
122
  ev_unloop(eventLoop, EVUNLOOP_ONE);
123
+ /* We only consider the "exit" command to be a graceful way to shut down
124
+ * the logging agent, so upon receiving an exit signal we want to return
125
+ * a non-zero exit code. This is because we want the watchdog to restart
126
+ * the logging agent when it's killed by SIGTERM.
127
+ */
128
+ exitCode = 1;
122
129
  }
123
130
 
124
131
  void
@@ -270,7 +277,7 @@ main(int argc, char *argv[]) {
270
277
  /********** Initialized! Enter main loop... **********/
271
278
 
272
279
  ev_loop(eventLoop, 0);
273
- return 0;
280
+ return exitCode;
274
281
  } catch (const tracable_exception &e) {
275
282
  P_ERROR("*** ERROR: " << e.what() << "\n" << e.backtrace());
276
283
  return 1;
@@ -577,14 +577,14 @@ public:
577
577
  unsigned int ret;
578
578
  try {
579
579
  ret = Passenger::readExact(fd, buf, size, &t);
580
- #ifdef __NetBSD__
580
+ #if defined(__NetBSD__) || defined(__OpenBSD__)
581
581
  *timeout = llround((double) t / 1000);
582
582
  #else
583
583
  *timeout = llroundl((long double) t / 1000);
584
584
  #endif
585
585
  return ret == size;
586
586
  } catch (...) {
587
- #ifdef __NetBSD__
587
+ #if defined(__NetBSD__) || defined(__OpenBSD__)
588
588
  *timeout = llround((double) t / 1000);
589
589
  #else
590
590
  *timeout = llroundl((long double) t / 1000);