DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD Ports and Packages

FreeBSD Ports and Packages Installation and upgrading of ports and packages on FreeBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 9th October 2008
Weaseal's Avatar
Weaseal Weaseal is offline
Package Pilot
 
Join Date: May 2008
Location: East Coast, US
Posts: 177
Thanked 7 Times in 7 Posts
Default Portsnap causes system to reboot

Whenever I run portsnap fetch update (edit: it also happens for a simple portsnap fetch), my system reboots unexpectedly. Here's the output:
Code:
# portsnap fetch update
Looking up portsnap.FreeBSD.org mirrors... 3 mirrors found.
Fetching snapshot tag from portsnap2.FreeBSD.org... done.
Fetching snapshot metadata... done.
Updating from Wed Sep 24 00:04:04 EEST 2008 to Thu Oct  9 10:28:42 EEST 2008.
Fetching 3 metadata patches.. done.
Applying metadata patches... done.
Fetching 3 metadata files... done.
Fetching 602 patches.....10....20....30....40....50....60....70....80....90....100....110....120....130....140....150....160....170....180....190....200....210....220....230....240....250....260....270....280....290....300....310....320....330....340....350....360....370....380....390....400....410....420....430....440....450....460....470....480....490....500....510....520....530....540....550....560....570....580....590....600. done.
Applying patches... Read from remote host X: Connection reset by peer
Connection to X closed.
And then I can log-in again a few minutes later, and the uptime has gone down to a few seconds, so I know it rebooted. Any ideas why this is happening?

Some background info:
Code:
$ uname -mrs
FreeBSD 7.0-RELEASE-p5 i386
And:
Code:
$ cat /etc/make.conf
# added by use.perl 2008-07-16 15:32:01
PERL_VER=5.8.8
PERL_VERSION=5.8.8

CFLAGS=-O2 -pipe
COPTFLAGS=-O2 -pipe
CPUTYPE=athlon-xp

NO_PROFILE=true
Since this started happening, I have still successfully updated ports by csup'ing the ports tree. I can also still rebuild the world and kernel without issue.
__________________
FreeBSD addict since 4.2-RELEASE.
My FreeBSD wiki.

Last edited by Weaseal; 9th October 2008 at 08:18 AM.
Reply With Quote
  #2   (View Single Post)  
Old 9th October 2008
graudeejs's Avatar
graudeejs graudeejs is offline
Real Name: Aldis Berjoza
formerly killasmurf86
 
Join Date: Jul 2008
Location: Riga, Latvia
Posts: 588
Thanked 29 Times in 26 Posts
Default

Quote:
Originally Posted by Weaseal View Post
And then I can log-in again a few minutes later, and the uptime has gone down to a few seconds, so I know it rebooted.
This sentence is confusing....
are you updating remote box?




Have you tried using portsnap from console (without X running)
Reply With Quote
  #3   (View Single Post)  
Old 9th October 2008
Weaseal's Avatar
Weaseal Weaseal is offline
Package Pilot
 
Join Date: May 2008
Location: East Coast, US
Posts: 177
Thanked 7 Times in 7 Posts
Default

Yes, it's a remote box. And no, I never use X with it, so portsnap was certainly from console.
__________________
FreeBSD addict since 4.2-RELEASE.
My FreeBSD wiki.
Reply With Quote
  #4   (View Single Post)  
Old 9th October 2008
graudeejs's Avatar
graudeejs graudeejs is offline
Real Name: Aldis Berjoza
formerly killasmurf86
 
Join Date: Jul 2008
Location: Riga, Latvia
Posts: 588
Thanked 29 Times in 26 Posts
Default

try building
ports-mgmt/portsnap
from ports
Reply With Quote
  #5   (View Single Post)  
Old 9th October 2008
graudeejs's Avatar
graudeejs graudeejs is offline
Real Name: Aldis Berjoza
formerly killasmurf86
 
Join Date: Jul 2008
Location: Riga, Latvia
Posts: 588
Thanked 29 Times in 26 Posts
Default

Quote:
Originally Posted by Weaseal View Post
Code:
$ cat /etc/make.conf
# added by use.perl 2008-07-16 15:32:01
PERL_VER=5.8.8
PERL_VERSION=5.8.8

CFLAGS=-O2 -pipe
COPTFLAGS=-O2 -pipe
CPUTYPE=athlon-xp

NO_PROFILE=true
Why do you ppl use custom flags?????
Don't you know, it ain't nothing but a problem

By default there are more flags specified, than you did, and you only specified few(2) default flags, basically you disabled some, that's all.

remove CFLAGS (and , i'm not sure what is COPTFLAGS, but seams to me that thei are about the same) and recompile what you compiled with these flags

Last edited by graudeejs; 9th October 2008 at 05:11 PM.
Reply With Quote
  #6   (View Single Post)  
Old 9th October 2008
BSDKaffee's Avatar
BSDKaffee BSDKaffee is offline
Real Name: Jason Hale
Coffee Addict
 
Join Date: May 2008
Location: Wintersville, Ohio
Posts: 212
Thanked 36 Times in 34 Posts
Default

Quote:
Originally Posted by killasmurf86 View Post
Why do you ppl use custom flags?????
Don't you know, it ain't nothing but a problem

By default there are more flags specified, than you did, and you only specified few(2) default flags, basically you disabled some, that's all.

remove CFLAGS (and , i'm not sure what is COPTFLAGS, but seams to me that thei are about the same) and recompile what you compiled with these flags
There really isn't anything out of the ordinary with that make.conf. Infact it is really quite minimal.

COPTFLAGS are the CFLAGS used for building the kernel only. It is usually best just to keep it at:
COPTFLAGS= -O -pipe

Here is my /etc/make.conf
Code:
CPUTYPE?=core2
CFLAGS=-O2 -fno-strict-aliasing -pipe
COPTFLAGS=-O -pipe
WITH_OPENSSL_BASE=yes
WANT_FAM_SYSTEM=gamin
PERL_VER=5.8.8
PERL_VERSION=5.8.8
I don't think this is a problem with make.conf. Weaseal, is this the same box as here: http://www.daemonforums.org/showthread.php?t=2058?
Reply With Quote
  #7   (View Single Post)  
Old 9th October 2008
phoenix's Avatar
phoenix phoenix is offline
Risen from the ashes
 
Join Date: May 2008
Posts: 699
Thanked 90 Times in 81 Posts
Default

The lack of -fno-strict-aliasing when specifying -O2 is known to cause problems with FreeBSD systems. All kinds of strange errors will occur with a world and kernel compiled with that set of CFLAGS.
__________________
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
Reply With Quote
  #8   (View Single Post)  
Old 9th October 2008
Weaseal's Avatar
Weaseal Weaseal is offline
Package Pilot
 
Join Date: May 2008
Location: East Coast, US
Posts: 177
Thanked 7 Times in 7 Posts
Default

Yes, same box as that other post with the panic.
Yes, I know that means the disk may be bad. I'm just hoping it isn't.
__________________
FreeBSD addict since 4.2-RELEASE.
My FreeBSD wiki.
Reply With Quote
  #9   (View Single Post)  
Old 9th October 2008
mdh's Avatar
mdh mdh is offline
Real Name: Matt D. Harris
FreeBSD 2.2.6 User
 
Join Date: Oct 2008
Location: West Virginia
Posts: 139
Thanked 8 Times in 8 Posts
Default

I just replied to your -questions post. Do you have any core dumps in /var/crash?
Also, check dmesg for information from the reboot.

This sounds like, as another -questions poster said, a filesystem issue. Unfortunately, it may be one that fsck doesn't fix - I had this happen to me (fsck says all is well, but hitting certain places on the FS causes a kernel panic due to a vfs dup alloc.)
Try running a "dmesg |grep -i vfs" and see if it says anything. If not, check out /var/crash.
Reply With Quote
Old 9th October 2008
mdh's Avatar
mdh mdh is offline
Real Name: Matt D. Harris
FreeBSD 2.2.6 User
 
Join Date: Oct 2008
Location: West Virginia
Posts: 139
Thanked 8 Times in 8 Posts
Default

One other thing - keep the /var/crash files if you can; you may need to newfs and rebuild the afflicted partition but it'd be nice to actually get a dump submitted to developers to fix this issue. Unfortunately when it happened to me, I had to get things rolling again fast and didn't have a chance to save the files in /var/crash.
Reply With Quote
Old 9th October 2008
Weaseal's Avatar
Weaseal Weaseal is offline
Package Pilot
 
Join Date: May 2008
Location: East Coast, US
Posts: 177
Thanked 7 Times in 7 Posts
Default

Code:
$ cat /var/crash/
..minfreboundsçinfo.0ç                                                        vmcore.0zinfo.vmcore.1zinfo.vmcore.2zinfo.vmcore.3zinfo.vmcore.4zinfo.vmcore.5zinfo.vmcore.6zinfo.7vmcore.7zÀ
Does that mean anything to anyone?
__________________
FreeBSD addict since 4.2-RELEASE.
My FreeBSD wiki.
Reply With Quote
Old 9th October 2008
mdh's Avatar
mdh mdh is offline
Real Name: Matt D. Harris
FreeBSD 2.2.6 User
 
Join Date: Oct 2008
Location: West Virginia
Posts: 139
Thanked 8 Times in 8 Posts
Default

Quote:
Originally Posted by Weaseal View Post
Code:
$ cat /var/crash/
..minfreboundsçinfo.0ç                                                        vmcore.0zinfo.vmcore.1zinfo.vmcore.2zinfo.vmcore.3zinfo.vmcore.4zinfo.vmcore.5zinfo.vmcore.6zinfo.7vmcore.7zÀ
Does that mean anything to anyone?
/var/crash is a directory... maybe paste the output from "ls -l /var/crash/" please.

Also, let us know when the last time it rebooted this way was. If you can stomach it, run a portsnap fetch to trigger it, then as soon as it comes back up, run a "dmesg" and post the output here, along with output from "ls -l /var/crash/" and "date" so we can compare when it bounced with the vmcore files, etc etc. Thanks!
Reply With Quote
Old 9th October 2008
Weaseal's Avatar
Weaseal Weaseal is offline
Package Pilot
 
Join Date: May 2008
Location: East Coast, US
Posts: 177
Thanked 7 Times in 7 Posts
Default

D'oh. I'm a bit tired, clearly.
I found this in vmcore.7:
Code:
<118>Checking for core dump on /dev/ad4s1b...
<118>savecore: reboot after panic: ffs_clusteralloc: map mismatch
<118>Oct  9 11:16:26 freebsd savecore: reboot after panic: ffs_clusteralloc: map mismatch
<118>savecore: writing core to vmcore.6
__________________
FreeBSD addict since 4.2-RELEASE.
My FreeBSD wiki.
Reply With Quote
Old 9th October 2008
mdh's Avatar
mdh mdh is offline
Real Name: Matt D. Harris
FreeBSD 2.2.6 User
 
Join Date: Oct 2008
Location: West Virginia
Posts: 139
Thanked 8 Times in 8 Posts
Default

Can you correlate the times of the coredumps to the times that the system rebooted due to the portsnap being run?

Do you have any way to boot into single user mode and run "fsck -y" ? If not, try running "fsck -y" as root anyway in multi-user mode and see if it complains about any errors.

If it doesn't, you've likely stumbled upon the bug I was plagued by. The bad news: I had to newfs parts of my system to get rid of the afflicted filesystems and reinstall. The good news: the reinstall prompted me to try out KDE4, which is a pretty nice upgrade.
Reply With Quote
Old 9th October 2008
graudeejs's Avatar
graudeejs graudeejs is offline
Real Name: Aldis Berjoza
formerly killasmurf86
 
Join Date: Jul 2008
Location: Riga, Latvia
Posts: 588
Thanked 29 Times in 26 Posts
Default

Quote:
Originally Posted by BSDKaffee View Post
There really isn't anything out of the ordinary with that make.conf. Infact it is really quite minimal.

COPTFLAGS are the CFLAGS used for building the kernel only. It is usually best just to keep it at:
COPTFLAGS= -O -pipe
It's best to not specify them at all.
Why do you need to write things that are by default as they are in your config (not counting missed flags)?


If it ain't broke, don't fix it

Last edited by graudeejs; 9th October 2008 at 09:56 PM.
Reply With Quote
Old 9th October 2008
mdh's Avatar
mdh mdh is offline
Real Name: Matt D. Harris
FreeBSD 2.2.6 User
 
Join Date: Oct 2008
Location: West Virginia
Posts: 139
Thanked 8 Times in 8 Posts
Default

Quote:
Originally Posted by killasmurf86 View Post
It's best to not specify them at all.
Why do you need to write things that are by default as they are in your config (not counting missed flags)?
I've always specified my flags in make.conf, and always specified a cputype. I've never had problems because of it. You can cause gcc to produce better-optimized code for your platform by using it appropriately.

I'd be interested in seeing what sort of problems you've had because of it though - it's possible you pinched a few gcc bugs, which is always interesting and noteworthy - on a seperate thread.
Reply With Quote
Old 9th October 2008
phoenix's Avatar
phoenix phoenix is offline
Risen from the ashes
 
Join Date: May 2008
Posts: 699
Thanked 90 Times in 81 Posts
Default

mdh:
Quote:
Originally Posted by phoenix View Post
The lack of -fno-strict-aliasing when specifying -O2 is known to cause problems with FreeBSD systems. All kinds of strange errors will occur with a world and kernel compiled with that set of CFLAGS.
Those who muck with CFLAGS and COPTFLAGS be playing with dragons. Best to tread lightly, and carry a big stick.

[Seriously, does anyone actually read the stuff I post, or does everyone just gloss over it?]
__________________
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
Reply With Quote
Old 10th October 2008
mdh's Avatar
mdh mdh is offline
Real Name: Matt D. Harris
FreeBSD 2.2.6 User
 
Join Date: Oct 2008
Location: West Virginia
Posts: 139
Thanked 8 Times in 8 Posts
Default

Quote:
Originally Posted by phoenix View Post
Those who muck with CFLAGS and COPTFLAGS be playing with dragons. Best to tread lightly, and carry a big stick.

[Seriously, does anyone actually read the stuff I post, or does everyone just gloss over it?]
The documentation says explicitly that it may break some ports...

Code:
# Compiling with -fstrict-aliasing optimization breaks some [notable] ports.
# GCC turns on -fstrict-aliasing optimization at all levels above -O[1], so
# explicitly turn it off when using compiling with the -O2 optimization level.
Therefore, that one caveat should be obvious to anyone who reads the documentation, so I didn't think it worth worrying about. I just don't think it's worthwhile to ignore a potential means of having a more efficient system just because of one well-documented issue that is easily dealt with by using -fno-strict-aliasing.
Reply With Quote
Old 10th October 2008
phoenix's Avatar
phoenix phoenix is offline
Risen from the ashes
 
Join Date: May 2008
Posts: 699
Thanked 90 Times in 81 Posts
Default

Exactly. That's what I said. Mucking about with the default CFLAGS is just asking for trouble. The defaults are -O2 -pipe -fno-strict-aliasing. The CFLAGS presented by the OP explicitly did not include the last option.

Seriously, does anyone actually read what I write?
__________________
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
Reply With Quote
Old 10th October 2008
richardpl richardpl is offline
Spam Deminer
 
Join Date: May 2008
Location: Croatia
Posts: 284
Thanked 25 Times in 24 Posts
Default

Well if OP used these flags from make.conf to build kernel and world ... that is very very bad and ugly idea.

When building kernel remove your make.conf !!!!!

For ports you can put it back if that will make you more happy.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cleaning Portsnap files in /var/db/portsnap/files bram85 FreeBSD Ports and Packages 2 5th October 2009 09:54 AM
problem to first reboot after installation openbsd OpenBSD Installation and Upgrading 3 16th May 2009 06:30 PM
Problem with PORTSNAP and my router cedcot FreeBSD Ports and Packages 2 22nd April 2009 11:32 AM
Reboot loop on 7.0 upgraded to 7.1 EricM FreeBSD Installation and Upgrading 3 25th March 2009 04:25 AM
Instant reboot with 7.0-RELEASE davidgurvich FreeBSD Installation and Upgrading 5 4th June 2008 08:15 PM


All times are GMT. The time now is 10:47 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick