Stuart Henderson wrote:
oh, please also keep /tmp/pkglist around in case anyone wants to see it..
On 2010-02-26, Stuart Henderson <s...@spacehopper.org> wrote:
On 2010-02-25, Chris Bennett <ch...@bennettconstruction.biz> wrote:
Stuart Henderson wrote:
On 2010-02-23, Chris Bennett <ch...@bennettconstruction.biz> wrote:
I just upgraded a production server to -current (needed latest PostgreSQL)
Did you upgrade all packages? Specifically, any Perl XS modules must
have been built with a version of Perl matching the Perl binary, so if
you didn't upgrade these (e.g. DBD::Pg) that could be the problem.
I decided to delete DBD::Pg and added latest through CPAN.
This eliminated the core dumps, but not the Segmentation Faults.
Please first uninstall DBD::Pg from CPAN (mixing things
from CPAN and OpenBSD packages is going to cause confusion at best
and won't help track down the problem with the packages.
I was giving DBD::Pg as an example but you must have other XS modules
on your system if you're using DBD::Pg. Did you upgrade __all__ packages?
If not please do so (pkg_add -ui or similar) and re-test.
If you've already done that and it's still failing, try reinstalling
all the perl things:
- save a copy of your package list
pkg_info > /tmp/pkglist
- uninstall all p5-* packages and things they pull in
pkg_delete -i /var/db/pkg/p5-*
(and answer yes to uninstalling the dependent pkg's)
- reinstall the packages from the list you saved
pkg_add -z -l /tmp/pkglist
and test again.
If it's broken after just doing pkg_add -u but deleting+reinstalling
these packages fixes things, we need to know *absolutely ASAP* if we're
to stand a chance of changing anything for release.
This is the script causing the problem.
The problem seems to disappear when I added print "What is commented out\n";
at every comment.
#!/usr/bin/perl
#------------------------------------------------------------------------------
# mwForum - Web-based discussion forum
# Copyright (c) 1999-2010 Markus Wichitill
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#------------------------------------------------------------------------------
use strict;
use warnings;
no warnings qw(uninitialized redefine);
# Imports
use Getopt::Std ();
use MwfMain;
#------------------------------------------------------------------------------
# Get arguments
my %opts = ();
Getopt::Std::getopts('f:', \%opts);
my $forumId = $opts{f};
# Init
my ($m, $cfg, $lng) = MwfMain->newShell(forumId => $forumId);
exit if !$cfg->{subsDigest};
$m->dbBegin();
# Get last sent time
my $lastSentTime = $m->max($m->getVar('crnSubLst') || 0, $m->{now} -
86400 * 5);
# Get boards
my $boards = $m->fetchAllHash("
SELECT * FROM boards WHERE lastPostTime > ?", $lastSentTime);
# Board subscriptions
for my $board (@$boards) {
# Get posts
my $posts = $m->fetchAllHash("
SELECT posts.postTime, posts.body, posts.userNameBak,
topics.subject
FROM posts AS posts
INNER JOIN topics AS topics
ON topics.id = posts.topicId
WHERE posts.postTime > :lastSentTime
AND posts.boardId = :boardId
AND posts.approved = 1
ORDER BY posts.topicId, posts.postTime",
{ lastSentTime => $lastSentTime, boardId => $board->{id} });
next if !...@$posts;
# Concatenate all posts
my $subject = "$cfg->{forumName} - \"$board->{title}\"
$lng->{subSubjBrdDg}";
my $body = $lng->{subNoReply} . "\n\n" . "-" x 70 . "\n\n";
for my $post (@$posts) {
$m->dbToEmail($board, $post);
my $timeStr = $m->formatTime($post->{postTime});
$body = $body
. $lng->{subTopic} . $post->{subject} . "\n"
. $lng->{subBy} . $post->{userNameBak} . "\n"
. $lng->{subOn} . $timeStr . "\n\n"
. $post->{body}
. "\n\n" . "-" x 70 . "\n\n";
}
# Get subscribers
my $subscribers = $m->fetchAllHash("
SELECT users.*
FROM boardSubscriptions AS boardSubscriptions
INNER JOIN users AS users
ON users.id = boardSubscriptions.userId
WHERE boardSubscriptions.boardId = :boardId
AND boardSubscriptions.instant = 0
AND users.email <> ''
AND users.dontEmail = 0",
{ boardId => $board->{id} });
next if !...@$subscribers;
# Send to subscribers if they still have board access
for my $subscriber (@$subscribers) {
next if !$m->boardVisible($board, $subscriber);
$m->sendEmail(user => $subscriber, subject => $subject, body =>
$body);
}
}
# Topic subscriptions
for my $board (@$boards) {
# Get topics
my $topics = $m->fetchAllHash("
SELECT id, subject FROM topics WHERE lastPostTime > ? AND
boardId = ?",
$lastSentTime, $board->{id});
# For each topic
for my $topic (@$topics) {
# Get posts
my $posts = $m->fetchAllHash("
SELECT posts.postTime, posts.body, posts.userNameBak
FROM posts AS posts
WHERE posts.postTime > :lastSentTime
AND posts.topicId = :topicId
AND posts.approved = 1
ORDER BY posts.postTime",
{ lastSentTime => $lastSentTime, topicId => $topic->{id} });
next if !...@$posts;
# Concatenate all posts
my $subject = "$cfg->{forumName} - \"$topic->{subject}\"
$lng->{subSubjTpcDg}";
my $body = $subject . "\n\n"
. $lng->{subNoReply} . "\n\n"
. "-" x 70 . "\n\n";
for my $post (@$posts) {
$m->dbToEmail($board, $post);
my $timeStr = $m->formatTime($post->{postTime});
$body = $body
. $lng->{subBy} . $post->{userNameBak} . "\n"
. $lng->{subOn} . $timeStr . "\n\n"
. $post->{body}
. "\n\n" . "-" x 70 . "\n\n";
}
# Get recipients
my $subscribers = $m->fetchAllHash("
SELECT users.*
FROM topicSubscriptions AS topicSubscriptions
INNER JOIN users AS users
ON users.id = topicSubscriptions.userId
WHERE topicSubscriptions.topicId = :topicId
AND topicSubscriptions.instant = 0
AND users.email <> ''
AND users.dontEmail = 0",
{ topicId => $topic->{id} });
next if !...@$subscribers;
# Send to subscribers if they still have board access
for my $subscriber (@$subscribers) {
next if !$m->boardVisible($board, $subscriber);
$m->sendEmail(user => $subscriber, subject => $subject, body
=> $body);
}
}
}
# Set last sent time
$m->setVar('crnSubLst', $m->{now}, 0);
# Log action and commit
$m->logAction(1, 'cron', 'subscr');
$m->dbCommit();
This for a multi-forum installation of mwforum from www.mwforum.org
--
A human being should be able to change a diaper, plan an invasion,
butcher a hog, conn a ship, design a building, write a sonnet, balance
accounts, build a wall, set a bone, comfort the dying, take orders,
give orders, cooperate, act alone, solve equations, analyze a new
problem, pitch manure, program a computer, cook a tasty meal, fight
efficiently, die gallantly. Specialization is for insects.
-- Robert Heinlein