It's ok - let's go back to work and forget
about it.
Hello and welcome!
One small request, can we please have log messages describing the general intent and
thinking behind a commit?
e.g. svn commit --message="Adding the SelectCategory extension" SelectCategory
... or if you want to write an essay, chuck it in a text file (e.g. ../msg.txt ), and
commit like so:
svn commit --file ../msg.txt includes/File-You-Modified.php
includes/Another-File-You-Modified.php RELEASE-NOTES
Other potentially helpful notes and stuff at:
http://www.mediawiki.org/wiki/Commit_access
(and please feel free to add anything you
find useful).
Also, I found the SelectCategory extension gives my apache2 web server segfaults when I
edit a page:
----------------------------------
[Thu Nov 30 19:56:23 2006] [notice] child pid 18508 exit signal Segmentation fault (11)
[Thu Nov 30 19:57:20 2006] [notice] child pid 16733 exit signal Segmentation fault (11)
[Thu Nov 30 19:58:46 2006] [notice] child pid 18948 exit signal Segmentation fault (11)
[Thu Nov 30 19:58:48 2006] [notice] child pid 3263 exit signal Segmentation fault (11)
[Thu Nov 30 19:59:30 2006] [notice] child pid 9535 exit signal Segmentation fault (11)
----------------------------------
With some slow binary searching I tracked it down to this line, line # 195 of
SpecialCategoryFunctions.php :
// $m_allCats = array_merge( array( $m_row['title'] => $m_prefix ),
fnSelectCategoryGetChildren( $m_row['title'], ++$m_prefix ) );
... with this line commented out, will run without segfaulting, with it enabled will
segfault.
At this point, it may help to see my categorylinks table, which contains some deliberately
whacky category test data:
====================================
mysql> select * from categorylinks;
+---------+---------------------------------+--------------------------+---------------------+
| cl_from | cl_to | cl_sortkey | cl_timestamp
|
+---------+---------------------------------+--------------------------+---------------------+
| 1 | Sydney | Main Page | 2006-11-29
03:47:22 |
| 1533 | Blog | Fake | 2006-09-12
04:20:54 |
| 1534 | Fake | Blog | 2006-09-12
04:22:26 |
| 1535 | Blog | Fish | 2006-09-12
04:23:59 |
| 1536 | Fish | Animial | 2006-09-12
04:24:30 |
| 1537 | Australian_media | Sydney | 2006-09-12
04:26:58 |
| 1537 | Sydney_culture | Media in Sydney | 2006-09-12
04:26:58 |
| 1538 | Australian_culture | Sydney culture | 2006-09-12
04:27:08 |
| 1538 | Culture_by_city | Sydney culture | 2006-09-12
04:27:08 |
| 1538 | Sydney | Culture of Sydney | 2006-09-12
04:27:08 |
| 1539 | Australian_capital_cities | Sydney | 2006-09-12
04:27:41 |
| 1539 | Cities_in_New_South_Wales | Sydney | 2006-09-12
04:27:41 |
| 1539 | Metropolitan_areas_of_Australia | Sydney | 2006-09-12
04:27:41 |
| 1540 | Fake | '); alert('Ownage'); (' |
2006-09-12 05:41:25 |
| 1541 | Fake | "onmouseover=alert(123); | 2006-09-12
05:44:42 |
| 1542 | Fake | \'); alert('Ownage'); (' |
2006-09-12 05:46:35 |
+---------+---------------------------------+--------------------------+---------------------+
16 rows in set (0.00 sec)
====================================
... and here it is as an ASCII diagram: [cheers Tels!]
====================================
+---------------------------+
| Cities_in_New_South_Wales |
+---------------------------+
|
|
v
+---------------------------+ +---------------------------+
+---------------------------------+
| Australian_capital_cities | --> | | --> |
Main Page |
+---------------------------+ | Sydney |
+---------------------------------+
+---------------------------+ | |
+---------------------------------+
| Australian_media | --> | | <-- |
Metropolitan_areas_of_Australia |
+---------------------------+ +---------------------------+
+---------------------------------+
|
|
v
+---------------------------+ +---------------------------+
+---------------------------------+ +---------+
+> | Blog | -+ | Culture of Sydney | |
Fish | --> | Animial |
| +---------------------------+ | +---------------------------+
+---------------------------------+ +---------+
| | | ^
| | +--------------------------------------+
| v
| +---------------------------+ +---------------------------+
+- | | --> | "onmouseover=alert(123); |
| Fake | +---------------------------+
| | +---------------------------+
| | --> | '); alert('Ownage'); (' |
+---------------------------+ +---------------------------+
|
|
v
+---------------------------+
| \'); alert('Ownage'); (' |
+---------------------------+
+---------------------------+ +---------------------------+
+---------------------------------+
| Australian_culture | --> | Sydney culture | <-- |
Culture_by_city |
+---------------------------+ +---------------------------+
+---------------------------------+
+---------------------------+ +---------------------------+
| Sydney_culture | --> | Media in Sydney |
+---------------------------+ +---------------------------+
====================================
In particular, note the circular "Blog" <--> "Fake" relationship
(i.e. on this test wiki, Category:Blog has a subcategory
Category:Fake, and Category:Fake has a subcategory Category:Blog).
Then taking fnSelectCategoryGetChildren() and fnSelectCategoryGetAllCategories(), and
putting them into a separate command line test
script that calls them, and running that, confirmed the problem:
================================
root@bling:/var/www/hosts/mediawiki/wiki/maintenance# php test-script-del.php
Fatal error: Maximum function nesting level of '100' reached, aborting! in
/var/www/hosts/mediawiki/wiki/includes/LoadBalancer.php
on line 404
Call Stack:
0.0006 111672 1. {main}()
/var/www/hosts/mediawiki/wiki/maintenance/test-script-del.php:0
0.1017 7094816 2. fnSelectCategoryGetAllCategories()
/var/www/hosts/mediawiki/wiki/maintenance/test-script-del.php:77
0.1248 8247608 3. fnSelectCategoryGetChildren()
/var/www/hosts/mediawiki/wiki/maintenance/test-script-del.php:37
0.1251 8247920 4. fnSelectCategoryGetChildren()
/var/www/hosts/mediawiki/wiki/maintenance/test-script-del.php:67
0.1254 8248520 5. fnSelectCategoryGetChildren()
/var/www/hosts/mediawiki/wiki/maintenance/test-script-del.php:67
0.1257 8249120 6. fnSelectCategoryGetChildren()
/var/www/hosts/mediawiki/wiki/maintenance/test-script-del.php:67
0.1260 8250008 7. fnSelectCategoryGetChildren()
/var/www/hosts/mediawiki/wiki/maintenance/test-script-del.php:67
0.1263 8251744 8. fnSelectCategoryGetChildren()
/var/www/hosts/mediawiki/wiki/maintenance/test-script-del.php:67
0.1266 8253840 9. fnSelectCategoryGetChildren()
/var/www/hosts/mediawiki/wiki/maintenance/test-script-del.php:67
0.1270 8256072 10. fnSelectCategoryGetChildren()
/var/www/hosts/mediawiki/wiki/maintenance/test-script-del.php:67
[ ... snip ... ]
0.1549 8450736 93. fnSelectCategoryGetChildren()
/var/www/hosts/mediawiki/wiki/maintenance/test-script-del.php:67
0.1553 8452984 94. fnSelectCategoryGetChildren()
/var/www/hosts/mediawiki/wiki/maintenance/test-script-del.php:67
0.1556 8455232 95. fnSelectCategoryGetChildren()
/var/www/hosts/mediawiki/wiki/maintenance/test-script-del.php:67
0.1556 8455456 96. wfGetDB()
/var/www/hosts/mediawiki/wiki/maintenance/test-script-del.php:52
0.1556 8455752 97. LoadBalancer->getConnection()
/var/www/hosts/mediawiki/wiki/includes/GlobalFunctions.php:2054
0.1557 8456488 98. LoadBalancer->openConnection()
/var/www/hosts/mediawiki/wiki/includes/LoadBalancer.php:364
0.1557 8456568 99. LoadBalancer->isOpen()
/var/www/hosts/mediawiki/wiki/includes/LoadBalancer.php:381
root@bling:/var/www/hosts/mediawiki/wiki/maintenance#
================================
I.e. looks like if you've got circular categories, then you'll exhaust your stack
or segfault by recursing infinitely.
The English Wikipedia definitely has circular categories, or at least it used to
[indirectly, not directly - there was some talk
about this a few months ago]. :-)
All the best,
Nick.