News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

SMF 2B4

Started by quiz_modder, November 29, 2008, 06:37:59 PM

Previous topic - Next topic

quiz_modder

Quote from: SlammedDime on December 11, 2008, 10:40:42 AM
If it were a problem with 2.0 itself in base form, more and more people would have problems with it... I've been running 2.0 on two different test environments with two different server configurations with no problems with core dumps.

m4tthall - My suggestion at this point would be to take a backup of all of your files, then upload a fresh copy of the Beta 4 files to your site and let it run for a few days.  If a core dump doesn't occur, start installing one mod at a time, and let it run for a few days before installing the next and see when the core dump occurs.

Is there any way I can upload a new set of files into a new folder, but point these to the existing database, then switch over?

I don't suppose RC1 is available either is it?

SlammedDime

Yes, and no and no.

You can upload a copy of SMF files to a seperate folder, and copy Settings.php to that folder, and adjust the urls and paths in the Settings.php file to reflect the change.

As for RC1 - not available yet.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

quiz_modder

Still struggling with this. Can anyone make sense of this to give a clue of where it is coming from?

Program terminated with signal 11, Segmentation fault.

#0 match (

eptr=0x9a566fe "int:id_member}, {int:log_time}, SUBSTRING({string:ip}, 1, 16), SUBSTRING({string:url}, 1, 65534), SUBSTRING({string:message}, 1, 65534), {string:session}, {string:error_type}, SUBSTRING({string:file},"..., ecode=0x8f6c342 "M",

mstart=0x9a566fd "{int:id_member}, {int:log_time}, SUBSTRING({string:ip}, 1, 16), SUBSTRING({string:url}, 1, 65534), SUBSTRING({string:message}, 1, 65534), {string:session}, {string:error_type}, SUBSTRING({string:file}"..., offset_top=2,

md=0xbf2ce5d0, ims=0, eptrb=0x0, flags=0, rdepth=1) at /home/cpeasyapache/src/php-5.2.6/ext/pcre/pcrelib/pcre_exec.c:403

403 {

(gdb) backtrace

#0 match (

eptr=0x9a566fe "int:id_member}, {int:log_time}, SUBSTRING({string:ip}, 1, 16), SUBSTRING({string:url}, 1, 65534), SUBSTRING({string:message}, 1, 65534), {string:session}, {string:error_type}, SUBSTRING({string:file},"..., ecode=0x8f6c342 "M",

mstart=0x9a566fd "{int:id_member}, {int:log_time}, SUBSTRING({string:ip}, 1, 16), SUBSTRING({string:url}, 1, 65534), SUBSTRING({string:message}, 1, 65534), {string:session}, {string:error_type}, SUBSTRING({string:file}"..., offset_top=2,

md=0xbf2ce5d0, ims=0, eptrb=0x0, flags=0, rdepth=1) at /home/cpeasyapache/src/php-5.2.6/ext/pcre/pcrelib/pcre_exec.c:403

#1 0x080b5b5d in match (eptr=<value optimized out>, ecode=<value optimized out>, mstart=<value optimized out>,

offset_top=2, md=0xbf2ce5d0, ims=0, eptrb=0x0, flags=0, rdepth=0)

at /home/cpeasyapache/src/php-5.2.6/ext/pcre/pcrelib/pcre_exec.c:688

#2 0x080bdaec in php_pcre_exec (argument_re=0x8f6c310, extra_data=0xbf2ce740,

subject=0x9a566fc "({int:id_member}, {int:log_time}, SUBSTRING({string:ip}, 1, 16), SUBSTRING({string:url}, 1, 65534), SUBSTRING({string:message}, 1, 65534), {string:session}, {string:error_type}, SUBSTRING({string:file"..., length=223,

start_offset=0, options=0, offsets=0x9a567e4, offsetcount=9)

at /home/cpeasyapache/src/php-5.2.6/ext/pcre/pcrelib/pcre_exec.c:4785

#3 0x080c0cae in php_pcre_replace_impl (pce=0x8f6c3a8,

subject=0x9a566fc "({int:id_member}, {int:log_time}, SUBSTRING({string:ip}, 1, 16), SUBSTRING({string:url}, 1, 65534), SUBSTRING({string:message}, 1, 65534), {string:session}, {string:error_type}, SUBSTRING({string:file"..., subject_len=223,

replace_val=0x9a56664, is_callable_replace=1, result_len=0xbf2ce860, limit=-1, replace_count=0x0, tsrm_ls=0x8c82458)

at /home/cpeasyapache/src/php-5.2.6/ext/pcre/php_pcre.c:1009

#4 0x080c1d98 in php_replace_in_subject (regex=0x9a56620, replace=0x9a56664, subject=0x9794264, result_len=0xbf2ce860,

limit=-1, is_callable_replace=1 '\001', replace_count=0x0, tsrm_ls=0x8c82458)

at /home/cpeasyapache/src/php-5.2.6/ext/pcre/php_pcre.c:1233

#5 0x080c23b9 in preg_replace_impl (ht=3, return_value=0x9a5667c, return_value_ptr=<value optimized out>, this_ptr=0x0,

return_value_used=1, tsrm_ls=0x8c82458, is_callable_replace=1 '\001')

at /home/cpeasyapache/src/php-5.2.6/ext/pcre/php_pcre.c:1331

#6 0xb6d4c7ed in get_module () from /usr/local/Zend/lib/Optimizer_TS-3.3.3/php-5.2.x/ZendOptimizer.so

#7 0x00000000 in ?? ()

(gdb) list

398

399 static int

400 match(REGISTER USPTR eptr, REGISTER const uschar *ecode, const uschar *mstart,

401 int offset_top, match_data *md, unsigned long int ims, eptrblock *eptrb,

402 int flags, unsigned int rdepth)

403 {

404 /* These variables do not need to be preserved over recursion in this function,

405 so they can be ordinary variables in all cases. Mark some of them with

406 "register" because they are used a lot in loops. */

407

(gdb) quit

quiz_modder

Just came across this, could it be related? http://aspn.activestate.com/ASPN/Mail/Message/php-dev/3653709

I created a file with the following code

preg_match("/http:\/\/(.)+\.ru/i", str_repeat("http://google.ru",2000));

I executed it on my server and a core dump was generated. So, could someone explain what that code is doing above and whether there is anything in SMF that could do something similar please?

Cheers

SlammedDime

Can you zip or tar all of your source files and email them to me at [email protected].  I'm leading to think the problem is coming from the db_query function, one of the regular expressions that parses the query info before the query is done.

In your specific case tho, or at least what you posted above, the query seems to be coming from the writeLog function that writes to the database when/where people are online on your board, at least on a default install.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

quiz_modder

Quote from: SlammedDime on December 14, 2008, 11:53:41 AM
Can you zip or tar all of your source files and email them to me at [email protected].  I'm leading to think the problem is coming from the db_query function, one of the regular expressions that parses the query info before the query is done.

In your specific case tho, or at least what you posted above, the query seems to be coming from the writeLog function that writes to the database when/where people are online on your board, at least on a default install.

Email sent, thanks.

SlammedDime

Ok, based on the above and tracing the code a bit more, it would appear that the log_error function is doing an insert query, and the preg_match that happens in the db_replacement__callback function is causing the core dump, at least from what I can tell.  There is only one preg_match from when that db_insert function is called until it returns in the callback function.

Let's try some testing... if you can disable error logging on your board for a short time and see if the core dumps stop, then re-enable it and see if they come back... see if we can narrow this down.


Does your forum encounter a lot of errors?

What it boils down to, though, is that in a properly configured host, a preg_match wouldn't cause a core dump, preg_match would return a value, even false.  We might be able to try bumping up the memory that SMF is using during execution.  Can you post a phpinfo file as well?  What is a phpinfo() file?
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

quiz_modder

I have sent you the PHP Info file. I won't pretend I know exactly what you meant in your reply though  ;)

How do you turn off the error logging?

Thanks again

SlammedDime

Under configuration > Security and moderation > General tab.  There is the option for disabling error logging.

Looks like the memory allowed for php scripts is okay on your host (that's what I needed the phpinfo page for)
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

quiz_modder

OK, turned off error logging, so will get back to you on whether I get any core dumps over the next day or so.

By the way, one error I was getting consistently in there was the following:

8: Undefined index: description
File: /public_html/board/Themes/default/GenericMenu.template.php
Line: 280

I am pretty sure this is related to a mod I had worked on, I just think I didn't set something for the admin tabs properly, as it happens on any navigation on the admin pages it has. Do you happen to know what I could check to see where the missing setting is please?

Thanks again

quiz_modder

Just to let you know I haven't had any core dumps today, so it may be related to error logging. Anyway, I will continue for another day or two with it off before enabling it again.

metallica48423

let us know if thats the case.

I have also had this problem with the AEVAC mod in the past when it was using callbacks.  Is it possible we've found a PHP bug?

Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

quiz_modder

Had a few now unfortunately, so I am still baffled as to what is causing it :(

I will try and go through the core dumps later and post any findings.

quiz_modder

Just went through a couple now, as they literally only happened recently. Got some more information, not sure if this is of any use? They seem to be different from previous ones:

GNU gdb Red Hat Linux (6.5-37.el5_2.2rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".

Core was generated by `/usr/bin/php /public_html/board/index.php'.
Program terminated with signal 11, Segmentation fault.
#0  0x082e0e5f in virtual_file_ex (state=0xbf52405c,
    path=0xaf9ee04 "/public_html/board/Themes/default/Errors.template.php", verify_path=0, use_realpath=2)
    at /usr/src/php-5.2.8/TSRM/tsrm_virtual_cwd.c:496
496   /usr/src/php-5.2.8/TSRM/tsrm_virtual_cwd.c: No such file or directory.
   in /usr/src/php-5.2.8/TSRM/tsrm_virtual_cwd.c
(gdb) bt
#0  0x082e0e5f in virtual_file_ex (state=0xbf52405c,
    path=0xaf9ee04 "/public_html/board/Themes/default/Errors.template.php", verify_path=0, use_realpath=2)
    at /usr/src/php-5.2.8/TSRM/tsrm_virtual_cwd.c:496
#1  0x082e2272 in virtual_access (
    pathname=0xaf9ee04 "/public_html/board/Themes/default/Errors.template.php", mode=0, tsrm_ls=0xa357458)
    at /usr/src/php-5.2.8/TSRM/tsrm_virtual_cwd.c:900
#2  0x08266517 in php_stat (
    filename=0xaf9ee04 "/public_html/board/Themes/default/Errors.template.php", filename_length=67, type=15, return_value=0xafc1694,
    tsrm_ls=0xa357458) at /usr/src/php-5.2.8/ext/standard/filestat.c:866
#3  0x08268184 in zif_is_link (ht=1, return_value=0xafc1694,
    return_value_ptr=0x0, this_ptr=0x0, return_value_used=1, tsrm_ls=0xa357458)
    at /usr/src/php-5.2.8/ext/standard/filestat.c:1078
#4  0xb6d2a14c in ?? ()
#5  0x00000001 in ?? ()
#6  0x0afc1694 in ?? ()
#7  0x00000000 in ?? ()





Program terminated with signal 11, Segmentation fault.
#0  0x082e7eef in vspprintf (pbuf=0xbf63d224, max_len=0,
    format=0x862c7c7 " must be greater than or equal zero",
    ap=0xbf63d18c "\002") at /usr/src/php-5.2.8/main/spprintf.c:766
766   /usr/src/php-5.2.8/main/spprintf.c: No such file or directory.
   in /usr/src/php-5.2.8/main/spprintf.c
(gdb) bt
#0  0x082e7eef in vspprintf (pbuf=0xbf63d224, max_len=0,
    format=0x862c7c7 " must be greater than or equal zero",
    ap=0xbf63d18c "\002") at /usr/src/php-5.2.8/main/spprintf.c:766
#1  0x083425fa in zend_throw_exception (exception_ce=0xbf63d224, message=0x0,
    code=140691399, tsrm_ls=0x2)
    at /usr/src/php-5.2.8/Zend/zend_exceptions.c:606
#2  0x08324a13 in _convert_to_string (op=0x10)
    at /usr/src/php-5.2.8/Zend/zend_operators.c:586
#3  0x0832d5c2 in zend_make_printable_zval (expr=0xb064d30,
    expr_copy=0xbf63d224, use_copy=0xbf63d238)
    at /usr/src/php-5.2.8/Zend/zend.c:199
#4  0x0832447c in concat_function (result=0xbf63d894, op1=0xb064d30,
    op2=0xa7c7924, tsrm_ls=0xa471458)
    at /usr/src/php-5.2.8/Zend/zend_operators.c:1199
#5  0x08386a73 in ZEND_CONCAT_SPEC_CV_CONST_HANDLER (execute_data=0xbf63daac,
    tsrm_ls=0xa471458) at /usr/src/php-5.2.8/Zend/zend_execute.c:209
#6  0x0834c3ce in execute (op_array=0xa75a9d0, tsrm_ls=0xa471458)
    at /usr/src/php-5.2.8/Zend/zend_vm_execute.h:64
#7  0xb6da4f74 in ?? ()
#8  0x0a75a9d0 in ?? ()
#9  0x0a471458 in ?? ()
#10 0x00000000 in ?? ()

metallica48423

SlammedDime, have you been able to find out anything about these?  I too am now getting coredumps regularly
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

riker

Quote from: metallica48423 on December 18, 2008, 03:22:08 AM
SlammedDime, have you been able to find out anything about these?  I too am now getting coredumps regularly

Told you it was happening more and more on SMF 2 so it can't all be blamed on the servers!

metallica48423

I don't have anything saying it is SMF causing it though.  I do have an entire site and other scripts ;)  These dumps didn't have any information pertaining to the script which caused them.  I've made a change though and checking to see if any more occur.  Then if so i can run gdb on them.
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

riker

Quote from: metallica48423 on December 18, 2008, 04:10:10 AM
I don't have anything saying it is SMF causing it though.  I do have an entire site and other scripts ;)  These dumps didn't have any information pertaining to the script which caused them.  I've made a change though and checking to see if any more occur.  Then if so i can run gdb on them.
When it last happened to me the errors were pointing to SMF2 files,

http://www.simplemachines.org/community/index.php?topic=276032.0

metallica48423

I remember reading somewhere, while debugging this problem with the AEVAC mod, something about a php bug in callbacks causing apache to segfault and coredump.  I can't seem to find it though.  It may even be certain configurations and versions, which makes it even more difficult to track down and kill

I may try to update PHP and see what that achieves, but i'd like to see what else SlammedDime knows, if anything :)
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

SlammedDime

#39
Well the core dump itself is pointing back to a php file (pcre originally), so I dont think this is an apache problem.  It may be a regular expression that happens to be trampling on a PHP bug, or it may have found one.

metallica & riker: if you can get your host to process the core files, or at least a few of them, and give you the output, then perhaps we can see if these are related.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Advertisement: